Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to use @include or @skip when stitching #937

Closed
tunurgitr opened this issue Jul 29, 2019 · 2 comments
Closed

Unable to use @include or @skip when stitching #937

tunurgitr opened this issue Jul 29, 2019 · 2 comments
Assignees
Milestone

Comments

@tunurgitr
Copy link
Contributor

Describe the bug
Stitched queries that use @include or @skip directives that refer to a variable return a message that the variable is not declared. This effectively means that @include and @Skip don't work when stitching as the primary use-case would be having them handle a variable.

To Reproduce
Steps to reproduce the behavior:

  1. Create a stitched schema
  2. Attempt to use an @include directive with a boolean field in playground. For example:
query TEST($ok:Boolean!) {
  hey {
    hello @include(if:$ok)
  }
}
  1. Note the error: "The following variables were not declared: YOUR_VARIABLE."

Expected behavior
Same behavior as if the literal true or false were passed to the @include directive.

Additional context
In some limited debugging, it looks like these variables are not in the _usedVariables list in AllVariablesUsedVisitor.cs, I'm guessing they're not being sent to the client endpoint, but I haven't dug-in that deep.

@michaelstaib michaelstaib self-assigned this Jul 30, 2019
@michaelstaib michaelstaib added this to the 10.0.0 milestone Jul 30, 2019
@michaelstaib
Copy link
Member

OK, this one is more complicated :) the query rewriter does not correctly visit the directive hence the variables are not touched. I will look at this tomorrow.

@michaelstaib
Copy link
Member

This bug is now fixed.

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

No branches or pull requests

2 participants