-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Outstanding breaking changes in buildClientSchema #2005
Comments
@trevor-scheer Thanks for a detailed description and especially for the repo 👍
So every introspection result should include all types it references even standard scalars. So technically it wasn't a breaking change since your example introspection is invalid and util That said can you please describe how did you get this introspection? |
@trevor-scheer I just added a test to check for the current behavior, see #2006 |
Hey @IvanGoncharov, apologies it's taken so long to get back to your question. Our own schema allows a consumer to request an introspection with or without builtin types, which is where I think the invalid introspections are coming from. I understand how this is a mistake on our part, and that we previously depended on a bug. I'm unsure what to recommend going forward, but it will be some time before I'm able to revisit this issue anyhow (and it's not requiring our immediate attention). If you'd like to close this issue for now, please feel free to - I'm happy to reopen it another time if necessary. You may leave it open if you prefer to, though I don't suspect any other users depended on this bug. |
@trevor-scheer No problem. Your investigation was exceptionally helpful and finally clarified what was going on. |
@IvanGoncharov @trevor-scheer Could you explain to me the current accepted behavior regarding builtin scalars? I have no programming experience in JS. This implementation is considered the main one and I would like to do the same for .NET. Now I am working on graphql-dotnet/graphql-dotnet/#1423 . Also I asked about this in graphql/graphql-spec#648 . I will try to break my question into several statements/assertions. I assume that everything should be answered yes. Is it so?
Thus, I expect that the current state is such that neither the SDL nor the introspection result contain more than the minimum data that is needed for functioning (there is no unnecessary, redundant information). I would be grateful for the comments. |
This issue is a follow-up to an ongoing problem with breaking changes in
buildClientSchema
.A breakdown of events
v<14.2.0
:buildClientSchema
pulls in only the built-in scalar types that are referenced within the schema.v14.2.0
:buildClientSchema
doesn't pull in any built-in scalar types. (original breaking change)v14.2.1-14.3.0
:buildClientSchema
pulls in all of the built-in scalar types, whether they're referenced within the schema or not. The fix addressed one issue, but introduced another and added unintended behavior.14.3.1-14.4.1
(latest):buildClientSchema
doesn't add any built-in scalars, meaning the schema must be provided complete. We previously depended on pre-14.2.0 behavior, this is a break that we could only work around by pulling in the missing scalars ourselves before callingbuildClientSchema
.History and related links
Reproduction
https://github.com/trevor-scheer/buildClientSchema-changes
Install and run
The included schema for demonstration intentionally leaves out all built-in types in order to show how behavior changed over time. There is a field in the schema which depends on the
Int
type.The text was updated successfully, but these errors were encountered: