-
Notifications
You must be signed in to change notification settings - Fork 668
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
Exist basic scalar type in downloaded schema and got Schema errors #5126
Comments
Hi 👋 . This is a known issue in the GraphQL IntelliJ plugin. These types needs to be in the schema because there exists several versions of them (deprecated input fields, repeated directives, etc... have been introduced more recently). And we need to know what version is used to do proper validation. |
Thank you! How does knowing the version affect the parser? |
It's affecting validation and/or introspection. Take the latest builtin type __InputValue {
name: String!
description: String
type: __Type!
defaultValue: String
isDeprecated: Boolean!
deprecationReason: String
} And write this query: {
__schema {
types {
inputFields {
isDeprecated
}
}
}
} It will validate well for Apollo Kotlin because |
I see! I didn't know that 'isDeprecated' was missing from old spec Introspection's __InputValue. Thank you for the detailed explanation. |
@martinbonnin Hi! I found this section in GraphQL Draft spec. |
PR here |
Thanks 👍 |
@sonatard: for the record, I opened this PR in the GraphQL spec to explicit how introspection types should be handled in SDL. The tldr; is that it's not easy and will probably require to change to introspection and how servers declare their capabilities to other tools. You can read more in yesterday's working group meeting notes |
Thinking more about this, one actionable item for us is to add to the following comment to the builtin types: # noinspection GraphQLTypeRedefinition At least it'll remove the warning until the spec moves forward |
3 changes in
I'll close this issue again as I believe there nothing more we can do in Apollo Kotlin in the current state of things. For discussions about how to handle full schemas in the GraphQL spec, see graphql/graphql-wg#1367 |
Question
When I download the Schema with
gradlew :app:downloadApolloSchema
, the basic scalar type(ID, Int, Float...) exists in Schema file. Probably because of this, Android Studio is throwing an error, but how should I deal with this?There is no problem with the operation such as building or sending requests.
Also, I sometimes write code to parse GraphQL schemas in Go, but I get the same error there and cannot parse it. Should the Go GraphQL parser be made not to throw an error, or should the schema not include a basic scalar type, which is correct?
The text was updated successfully, but these errors were encountered: