-
Notifications
You must be signed in to change notification settings - Fork 2
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
Invalid default value for a clauses
argument
#1
Comments
Hey @OlegIlyenko, thanks for opening the issue. I'm not exactly following why If we think about JSON, then
On the server-side, we simply take the |
Thanks a lot for looking into it! I totally agree with what you have described, I think it is right behaviour. I think the issue boils down to an encoding of As you have described, According to the spec, the {
"defaultValue" : "\"[]\"",
"description" : "array of {key: value} or 'string' where clauses",
"name" : "clauses",
"type" : {
"kind" : "SCALAR",
"name" : "JSON",
"ofType" : null
}
}
Currently introspection result looks like this: {
"defaultValue" : "[]",
"description" : "array of {key: value} or 'string' where clauses",
"name" : "clauses",
"type" : {
"kind" : "SCALAR",
"name" : "JSON",
"ofType" : null
}
} If we translate it back in your example query, this would imply that query should look like this: query {
host(id: "someId") {
report(clauses: []) {
columns
preview
}
}
} So It often gets confusing when it comes to string escaping. Let me know if you could follow my explanation. |
Recently I noticed that Universe GraphQL schema has changed a bit and new
JSON
scalar type as well as a default value were introduced. In the introspection JSON it looks like this:Based on my understanding of the GraphQL spec, the default value
[]
is not compatible the the argument type. According to the GraphQL spec:The argument type is a simple scalar value. This means that it can't have value like
[]
(the default value is described with GraphQL syntax, not JSON). I'm not sure how JSON scalar type is implemented internally, but if it is represented with aString
literal, then the default value should be something like"defaultValue": "\"[]\""
.I was not 100% sure where to report this issue, so I decided to put it here. Would be great if somebody could look into it.
The text was updated successfully, but these errors were encountered: