-
Notifications
You must be signed in to change notification settings - Fork 162
Support fragments in interfaces #153
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
Conversation
fec1d6b
to
e4d2ff1
Compare
@h-michael tagging you in case you want to review this (no obligation of course). |
iface.field_impls_for_selection(context, &self.selection, &self.name)?; | ||
let fields = | ||
iface.response_fields_for_selection(context, &self.selection, &self.name)?; | ||
(field_impls, fields) |
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 code isn't pretty, we could make it a trait. On the other hand we have to support type-refining fragments so it may not be the right time to abstract more.
} | ||
|
||
type InterfaceQuery { | ||
everything: [Named!] | ||
everything: [Named!] | ||
} |
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.
Weird, I wonder if it's .editorconfig.
4ab0429
to
2b1ce4f
Compare
This is limited to the interface’s own fields for now. We do not support type-refining fragments (see this issue: #154).
It fixes a panic on previous versions in some cases when multiple fields in a struct are marked with #[flatten]. We do that in interfaces.
Also enable #[deny(missing_docs)] on the codegen crate.
2b1ce4f
to
a05f0b5
Compare
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.
LGTM.
And it works when I tried use fragments for interface that is in my project. 🎉
Great, thanks :) It's the last thing I wanted in for the 0.5 release, so it's happening soon! |
No description provided.