-
Notifications
You must be signed in to change notification settings - Fork 56
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
Support nested imports #8
Comments
@schickling I think this would be a very valuable addition, also based on recent questions on Apollo Slack by others regarding stitching schemas and needing root query/mutation/subscription fields. Are you okay to move ahead with this? |
I'd love to see some more examples for this and explore other syntax options. @stubailo @freiksenet do you have an opinion about this? |
Apart from Another alternative (just to have options to choose from) would be inspired by mixins/include syntax from libraries like sass. The type Query {
# import * from 'b.graphql'
# import allPosts from 'c.graphql'
# import create* from 'd.graphql'
otherfield: [Post]
} |
After thinking a bit about this and seeing more use cases, I like the initially proposed syntax: # import Query.feed from "a.graphql" There are two ways this can be implemented:
extend type Query {
feed: ...
}
Since there isn't final consensus yet around the Cases to consider
|
Another edge case:
Question @schickling: |
I suggest, it should throw an error. |
Is this limited to certain types? I can see this getting out of hand if something like this is allowed: # import Store.products from "store.graphql"
type Store {
hours
} |
@jlengstorf It's limited to root types (Query, Mutation, Subscription). |
What's the final syntax chosen here? I wasn't able to find an example in My use case is that I want to define queries and mutations in separate |
Found it in the fixtures: # import Query.* from 'b.graphql' |
@marktani Did you get the nesting to work? Was the nested using the prisma.graphql that was generated or only custom? I'm trying to split them apart like you did. |
For the following schema in
a.graphql
I'd like to be able to do something like this:
In
b.graphql
and that query automatically gets appended to my other queries in b.graphql
The text was updated successfully, but these errors were encountered: