Skip to content

Conversation

@kmoore-intuit
Copy link
Collaborator

What Changed

Why

Todo:

  • Add tests
  • Add docs

@kmoore-intuit kmoore-intuit changed the base branch from master to defer-support February 22, 2023 23:52
if(!node.getDirectives(DEFER_DIRECTIVE_NAME).isEmpty()) {
Argument deferArg = node.getDirectives(DEFER_DIRECTIVE_NAME).get(0).getArgument(DEFER_IF_ARG);
if(graphQLContext.getOrDefault(USE_DEFER, false) && (deferArg == null || ((BooleanValue)deferArg.getValue()).isValue())) {
decreaseParentSelectionSetCount(context.getParentContext());
Copy link
Contributor

Choose a reason for hiding this comment

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

If I understood this correctly, USE defer is a feature flag? If yes, throwing an exception might be a good option as well. i.e. if feature is not enabled but someone use defer, we can throw an exception

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I was assuming the feature flag would set hasDefer to false and forward to regular graphql execute to avoid clients queries breaking if we suddenly turn it off


if(!node.getDirectives(DEFER_DIRECTIVE_NAME).isEmpty()) {
Argument deferArg = node.getDirectives(DEFER_DIRECTIVE_NAME).get(0).getArgument(DEFER_IF_ARG);
if(graphQLContext.getOrDefault(USE_DEFER, false) && (deferArg == null || ((BooleanValue)deferArg.getValue()).isValue())) {
Copy link
Contributor

Choose a reason for hiding this comment

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

looks like this code is repeated

@kmoore-intuit kmoore-intuit merged commit f73a6ea into defer-support Mar 1, 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