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

Variables in complex input types incorrectly validated as unused. #745

Closed
nigel-sampson opened this issue May 15, 2019 · 1 comment · Fixed by #746
Closed

Variables in complex input types incorrectly validated as unused. #745

nigel-sampson opened this issue May 15, 2019 · 1 comment · Fixed by #746
Assignees
Labels
🐾 duplicate This issue or pull request already exists
Milestone

Comments

@nigel-sampson
Copy link
Contributor

When a variable is used in a decomposed complex input types it is incorrectly validated as being unused.

The following unit test added to the test suite shows the scenario, this test fails with the error message The following variables were not used: name..

[Fact]
public void VariableUsedInComplexInput()
{
    // arrange
    Schema schema = ValidationUtils.CreateSchema();
    DocumentNode query = Parser.Default.Parse(@"
        query queryWithComplexInput($name: String)
        {
            findDog(complex: { name: $name }) {
                name
            }
        }");

    // act
    QueryValidationResult result = Rule.Validate(schema, query);

    // assert
    Assert.False(result.HasErrors);
}
@michaelstaib
Copy link
Member

Yeah we are on this one already. #215 will be fixed with version 9.

@michaelstaib michaelstaib added this to the 9.0.0 milestone May 15, 2019
@michaelstaib michaelstaib added 🐾 duplicate This issue or pull request already exists bug labels May 15, 2019
@michaelstaib michaelstaib self-assigned this May 15, 2019
nigel-sampson pushed a commit to nigel-sampson/hotchocolate that referenced this issue May 15, 2019
nigel-sampson pushed a commit to nigel-sampson/hotchocolate that referenced this issue May 15, 2019
nigel-sampson pushed a commit to nigel-sampson/hotchocolate that referenced this issue May 15, 2019
nigel-sampson pushed a commit to nigel-sampson/hotchocolate that referenced this issue May 15, 2019
nigel-sampson pushed a commit to nigel-sampson/hotchocolate that referenced this issue May 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐾 duplicate This issue or pull request already exists
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants