-
-
Notifications
You must be signed in to change notification settings - Fork 796
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
fix(mergeSchemas): Prevent custom resolvers from being overwritten by default resolvers #4368
Conversation
… default resolvers
|
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/theguild/graphql-tools/7WDnpFqtQFQjsGaCVJCVAQxUQ49R |
Hey @mattkrick just looking at the PR, it looks like it hasn't been touched in a while, is this something you are still working on? @ardatan if this passes tests is this something you would be happy to merge? I am happy to help get this one over the line if required. It would help us with an issue we are having over at KeystoneJS keystonejs/keystone#7527 Thanks! |
@@ -30,7 +30,8 @@ export function mergeSchemas(config: MergeSchemasConfig) { | |||
extractedResolvers.push(getResolversFromSchema(schema)); | |||
extractedSchemaExtensions.push(extractExtensionsFromSchema(schema)); | |||
} | |||
|
|||
extractedResolvers.push(asArray(config.resolvers || [])) |
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.
Using the following here, resolved the type errors in the tests for me
const resolvers = config.resolvers || [];
for (const resolver of asArray(resolvers)) {
extractedResolvers.push(resolver);
}
@@ -30,7 +30,8 @@ export function mergeSchemas(config: MergeSchemasConfig) { | |||
extractedResolvers.push(getResolversFromSchema(schema)); |
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.
Instead of the change above, we can basically change this push
tounshift
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.
Hi @ardatan
Yes, this looks to work from my testing today...
I don't have access to make this change, @mattkrick is this a change you are able to make?
@ardatan if @mattkrick is not able to do this, is this something you are able to push, or would you like me to create a new PR with this change and the changeset
?
Thanks!
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.
We'd love to accept a new PR :)
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.
I'm afraid this can be a breaking change for the existing users relying on this behavior. |
Closed in favor of #4455 |
Description
custom resolvers should overwrite default resolvers
Related #4367
Type of change
Please delete options that are not relevant.
How Has This Been Tested?