-
-
Notifications
You must be signed in to change notification settings - Fork 818
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
Allow passing an array of resolver objects to makeExecutableSchema
#576
Conversation
makeExecutableSchema
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.
This is a great idea but let's avoid using lodash.merge
.
We should be able to get a similar result in a much simpler way by doing two loops over the input objects.
package.json
Outdated
"deprecated-decorator": "^0.1.6", | ||
"graphql-subscriptions": "^0.5.6", | ||
"lodash.merge": "^4.6.0", |
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 don't think we need lodash.merge - we could just write a simple function that loops through a few objects and merges them. Shouldn't be more than 10-20 lines of code I think since we don't need to support all the stuff that lodash.merge does.
We've intentionally kept the lodash dependency out.
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 is https://github.com/apollographql/graphql-tools/blob/master/src/stitching/mergeSchemas.ts#L306-L322. You can extract it and use it for merging.
…es (#586) Fixing the args with zero value or false
* Also recreate astNode for fields In a [previous commit](fd9f626) we added the `astNode` property in the `reacreateCompositeType` function. That resulted in cache control working with schema stitching but only for GraphQL Types. By recreating the `astNode` prop also in `fieldToFieldConfig` cache control also works for fields. This is required for caching fields and hence queries. * Add ast to input field node too
cool thanks for the review guys! Let me know if you want me to move |
I've combined your two PRs and will merge them together. |
@stubailo here is the PR. I just wanted to get initial feedback before:
Copying overlodash.merge
and adding local type defs (this is my first time ever writing Typescript 😄)Note: there are already 16 transient dependencies on other lodash modulesThe issue here in not the copying (hehe), but rather writing the typedefs for what turns out is a 2000 line file (mostly comments albeit).mergeSchemas
TODO: