-
Notifications
You must be signed in to change notification settings - Fork 275
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
fix(federation): remove redundant typename for inline fragments #5864
Conversation
@dariuszkuc, please consider creating a changeset entry in |
CI performance tests
|
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.
Sweet! 🥳
@@ -895,7 +895,19 @@ impl Selection { | |||
} | |||
|
|||
fn sub_selection_type_position(&self) -> Option<CompositeTypeDefinitionPosition> { |
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 function now doesn't return the subselection's type position (...for inline fragments without a type condition). I think we should rename it or inline the function where it's used (as it's only used in one place).
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.
Decided to inline it to contain to just that single function call. Otherwise it would have to be something like field_sub_selection_type_position_or_fragment_type_condition
or something along those lines.
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.
approved assuming comment addressed : )
When adding `__typename` field for abstract types, we need to check for inline fragment type condition and not the parent selection set. If we have an inline fragment without type condition and it is pointing to and abstract type, then the required `__typename` field should have already been added to its parent field.
db097cb
to
dfb0404
Compare
When adding `__typename` field for abstract types, we need to check for inline fragment type condition and not the parent selection set. If we have an inline fragment without type condition and it is pointing to and abstract type, then the required `__typename` field should have already been added to its parent field. We continue adding `__typename` for fragments with a type condition as their type condition _may_ be different than the parent type. ```graphql foo { # if this is abstract type we will add __typename a ... @Skip(if: false) { # if this fragment is on abstract type we don't need to add anything as # we already added the __typename to the parent selection b } } ```
When adding
__typename
field for abstract types, we need to check for inline fragment type condition and not the parent selection set. If we have an inline fragment without type condition and it is pointing to and abstract type, then the required__typename
field should have already been added to its parent field.We continue adding
__typename
for fragments with a type condition as their type condition may be different than the parent type.Checklist
Complete the checklist (and note appropriate exceptions) before the PR is marked ready-for-review.
Exceptions
Note any exceptions here
Notes
Footnotes
It may be appropriate to bring upcoming changes to the attention of other (impacted) groups. Please endeavour to do this before seeking PR approval. The mechanism for doing this will vary considerably, so use your judgement as to how and when to do this. ↩
Configuration is an important part of many changes. Where applicable please try to document configuration examples. ↩
Tick whichever testing boxes are applicable. If you are adding Manual Tests, please document the manual testing (extensively) in the Exceptions. ↩