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

The variable type rule has an issue when the variable type is a non-null type. #262

Closed
michaelstaib opened this issue Sep 11, 2018 · 4 comments · Fixed by #274
Closed

The variable type rule has an issue when the variable type is a non-null type. #262

michaelstaib opened this issue Sep 11, 2018 · 4 comments · Fixed by #274
Assignees
Milestone

Comments

@michaelstaib
Copy link
Member

Describe the bug
The variable type rule has an issue when the variable type is a non-null type.

To Reproduce
The following query is rejected by the server:

query f($x: Episode!){
  hero(episode:$x)
  {
    name
  }
}

with the following error:

{
  "errors": [
    {
      "VariableName": "x",
      "Message": "The variable value is not of the correct type."
    }
  ]
}

The hero signature looks like the following hero(episode: Episode!): Character.

Expected behavior
The query should have not been rejected.

@michaelstaib michaelstaib added this to the 0.5.0 milestone Sep 11, 2018
@michaelstaib michaelstaib self-assigned this Sep 11, 2018
@michaelstaib
Copy link
Member Author

private void CheckForInvalidValueType(in Variable variable)
        {
            if (!variable.Type.IsInstanceOfType(variable.Value))
            {
                throw new QueryException(new VariableError(
                    "The variable value is not of the correct type.",
                    variable.Name));
            }
        }

@michaelstaib
Copy link
Member Author

The bug is caused by our temporary workaround to fix a serialization issue with enums. So, now we have to put a good solution in place and not another workaround.

@michaelstaib
Copy link
Member Author

michaelstaib commented Sep 11, 2018

This issue is related to #219 and #218

@michaelstaib
Copy link
Member Author

This issue is fixed with PR #274

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 a pull request may close this issue.

1 participant