-
Notifications
You must be signed in to change notification settings - Fork 161
Support multiple operations per query document #31
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
Comments
This is important because it's the most natural way to share fragments between multiple operations (an operation is either a query, a mutation or a subscription). |
I started implementing that - the question is whether we should keep the 1:1 match between a struct under derive and an operation, or generate multiple implementors of the I tend to prefer the first option, as it's more explicit and gives more control to users (and it's not a lot of boilerplate to define additional structs with nearly the same options but a different name). |
Question: should we select the operation with the name of the struct by default, or the first one, or a combination of both? I think the struct name, with a fallback on the first one makes sense - or maybe struct name, and error if there is no match. |
See issue #31 for a discussion of the feature. We should document this at some point, probably not in the README or it is going to get cluttered.
done! |
Probably via a struct attribute on the query struct to specify which operation it should implement.
For now we should document that we only support one operation by document (like Apollo Client, I think?)
The text was updated successfully, but these errors were encountered: