-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
chore: bump graphql and graphql-compose major versions #29090
Conversation
New version of graphql-compose adds type composers added via `createTemp` to schemaComposer. So before the upgrade `schemaComposer.has(typeName)` always returned false for temp types, now it returns true (as the temp composer is already added).
In the new version of graphql-compose the list of actual final types is stored in SchemaComposer itself, not TypeMapper. Also the same composer may have multiple keys
graphql-compose now adds temporary types to schemaComposer which is unfortunate. The suggested workaround is not to pass schemaComposer to createTemp (so use new schemaComposer under the hood). That's what we do here but still use the original composer to resolve fields and types.
Those thunks cause stack overflow in graphql-compose. Indicates a bug in graphql-compose that warrants additional investigation.
graphql-compose introduced another behavior change for input type generation and unions. Previously it was ignoring fields of union types, now it throws. Introduced here: graphql-compose/graphql-compose@b6363be
Another behavior change is that inputTypeComposer.getFields() now returns a map of fields where types are composers while our current code expects types to be types of graphql-js
Also had to update tests due to this issue: graphql-compose/graphql-compose#313
…type composer `typeComposer.getInterfaces()` now returns a list of interface composers not `GraphQLInterface` instances. Also schemaComposer has multiple entries of the same type with different keys now.
…ema merging" This reverts commit 395e460
`getType` method creates AST node under the hood that produces a duplicate type in the schema 🤷
GraphQL 15 is stricter with enum values after graphql/graphql-js#1827
GraphQL 15 is stricter with enum values after graphql/graphql-js#1827
graphql-compose will unwrap `interfaces` and `types` thunk right away. As a result it may try to access some types before they were added to schemaComposer
const inputTypeComposer = typeComposer.getInputTypeComposer() | ||
// toInputObjectType() will fail to convert fields of union types, e.g. | ||
// union FooBar = Foo | Bar | ||
// type Baz { | ||
// fooBar: FooBar | ||
// } | ||
// Unfortunately there is no way to just exclude such fields from the input type in graphql-compose v7+, | ||
// so simply replacing them with booleans as the least confusing option :/ | ||
const inputTypeComposer = toInputObjectType(typeComposer, { | ||
fallbackType: schemaComposer.getSTC(`Boolean`), | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this is confusing. But the best approach to it would be to fix graphql-compose
itself (make it allow the old behavior). I'll work on it after higher priority work is done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's dooooo this!!!! 👍
Description
This PR bumps
graphql-js
major from v14 to v15 andgraphql-compose
from v6 to v7Closes #25906