-
-
Notifications
You must be signed in to change notification settings - Fork 816
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
Make it easy to prevent merging of root query fields #439
Comments
We want to add namespacing utilities so that one can namespace stuff this way before merging. You can also filter the query after mergingSchemas, through eg https://github.com/graphcool/graphql-transform-schema. |
@freiksenet any idea when this namespacing functionality will be finished? The project I'm working on really needs this kind of feature. |
I think this is super important when using an in house schema and stitching to a schema that can change often, like GraphCMS. Instead of having to deal with multiple graphql endpoints or making sure the two schemas don't collide, we could easily do something like the following:
where all of our often changing CMS schema is namespaced safely and won't interfere with our own schema. |
I believe this is now possible with the new graphql-tools 3.0! https://dev-blog.apollodata.com/the-next-generation-of-schema-stitching-2716b3b259c0 |
Such a requested (and obvious) feature and no receipt yet (( |
This is a great idea! I think it's just a matter of implementing the right transform and making it easy to use/documented. Anyone want to help with that? |
Currently I have an implementation that makes this by renaming types in remote schemas and constructing a new schema with service-specific fields, that have resolvers that delegate queries to corresponding remote schemas. I feel that my implementation is very rough and not very efficient, but the concept is something like this:
|
I honestly feel that renaming types (as documented in 3.0) doesn't go far enough to resolve this issue for larger datasets. If you are using GraphQL as a proxy to host many remote APIs under a single server, then merging upwards of a dozen or more remote schemas will get messy, particularly when there are multiple root-level nodes on each schema. Adding a root stub where a remote schema can be attached is much cleaner and more scalable than simply prefixing types with a schema-specific value. Has anyone been able to do this successfully? |
WrapType transform can be used on the root type to namespace. Also see the Gatsby transforms that achieve this. |
When merging multiples apis (e.g. GitHub and Yelp), instead of generating this schema:
I'd prefer to be able to generate this:
Is that possible or planned?
Thank you.
The text was updated successfully, but these errors were encountered: