Skip to content
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

mergeSchemas: extractedResolvers are overwritten by default resolvers from schema #4367

Closed
mattkrick opened this issue Apr 6, 2022 · 1 comment

Comments

@mattkrick
Copy link

Describe the bug

In mergeSchemas, the resolvers passed in via the resolvers argument should overwrite any resolvers coming from the schemas.

To Reproduce
Steps to reproduce the behavior:

const mySchema = mergeSchemas(...) // this will add a default resolver to every field
const withNestedSchema = mergeSchemas({
  schemas: [mySchema],
  resolvers: {_extQuery: { projects: () => 42}} // this resolver gets overwritten during merge!
})

Expected behavior

The custom resolvers I pass in are the ones that are used.
Simplest solution is to just add the custom resolvers to the end of the array before merging.

master...mattkrick:patch-1#diff-a47be556064f0c5e1d5cd8d16ee14fc36b8f15b5d53f9aecbe5cebf5f1bb3b6aL22-R34

@mattkrick
Copy link
Author

ack! sorry for ghosting this issue.
thanks for getting this across the line!
fixed in #4463

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant