Skip to content

Conversation

@bbakerman
Copy link
Member

@bbakerman bbakerman commented May 22, 2023

This PR creates a callback mechanism that supports conditional node inclusion using mechanisms beyond the standard @skip / @include

A ConditionalNodeDecision instance must be included in the graphql context and this is then used during conditional node support code to make a custom decision.

This will allowing something like

query q {
    foo
    bar @featureFlag( variant : $x) 
}

And then on the back end the value of the feature flag can be securely checked (say to a FF service like LaunchDarkly say) to see if the field should be included or not

@skip is driven by the client - this allows field exclusion / inclusion driven by the server

See #1811

@bbakerman bbakerman added this to the 2023 July milestone May 22, 2023
Copy link
Member

@dondonz dondonz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! If you're mega keen you could add more test cases for fragments etc

@bbakerman bbakerman added this pull request to the merge queue May 29, 2023
Merged via the queue into master with commit 494685c May 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants