question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Outstanding breaking changes in buildClientSchema

See original GitHub issue

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 calling buildClientSchema.

History and related links

Reproduction

https://github.com/trevor-scheer/buildClientSchema-changes

Install and run

yarn
node index.js

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.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
IvanGoncharovcommented, Sep 4, 2019

@trevor-scheer No problem. Your investigation was exceptionally helpful and finally clarified what was going on. I think the current behavior is fully spec-compliant. Since we stop active development on 14.x.x and 15.0.0 should be spec-compliant in that regard I’m closing this issue.

1reaction
IvanGoncharovcommented, Jun 29, 2019

@trevor-scheer Thanks for a detailed description and especially for the repo 👍 Now I finally understand what happened here.

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.

So every introspection result should include all types it references even standard scalars. Especially since we can add new standard scalars in future (e.g. OffsetDateTime RFC) so we can’t rely on both client and server have the exact same set of standard scalars.

So technically it wasn’t a breaking change since your example introspection is invalid and util 14.2.0 we had a bug that was just masking this problem.

That said can you please describe how did you get this introspection? Did you use some GraphQL library on your server that has this bug? Or do you do remove standard scalars from introspection in your code?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Schema checks - Apollo GraphQL Docs
GraphOS provides schema checks to help you identify breaking changes before you make them, and to help you identify when a potentially dangerous...
Read more >
graphql/language
A query language for your API — GraphQL provides a complete description of the data in your API, gives clients the power to...
Read more >
graphql: Versions - Openbase
v17.0.0-alpha.2 (2022-09-22) Breaking Change. #3622 fix: update remaining GraphQLNonNull<GraphQLType> codepoints to GraphQLNonNull<GraphQLNullableType> ...
Read more >
Mocking – GraphQL Tools
import { buildClientSchema } from 'graphql' import * as introspectionResult from 'schema.json' ... Breaking Change: Mock Functions Signature.
Read more >
GraphQL: Fixing Breaking Schema Changes
Rewrite broken queries in middleware. The best solution would be if we could put something between our client and our server that could...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found