-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Relay constructing wrong query when querying for missing fields on a connection #305
Comments
Thanks for reporting this. It looks like |
Summary: Addresses the issue in #305: `diffRelayQuery` creates top-level queries for missing information but did not wrap the fields in fragments based on type. Rather than use `refragmentRelayQuery` which requires a full traversal of the query, this change relies on the fact that input queries are already correctly fragmented, and only needs to group the top-level fields into fragments by type. The schema changes are required because otherwise `... on FeedUnit` would not be allowed in a `Node` context. Closes #316 Reviewed By: @wincent Differential Revision: D2442000
@KyleAMathews thanks again for reporting this - the issue is now fixed on master, i'm going to close. |
Thanks for the fix! Also great talk yesterday @scale. Watched it this
|
thanks! :-) |
Summary: Addresses the issue in #305: `diffRelayQuery` creates top-level queries for missing information but did not wrap the fields in fragments based on type. Rather than use `refragmentRelayQuery` which requires a full traversal of the query, this change relies on the fact that input queries are already correctly fragmented, and only needs to group the top-level fields into fragments by type. The schema changes are required because otherwise `... on FeedUnit` would not be allowed in a `Node` context. Closes #316 Reviewed By: @wincent Differential Revision: D2442000
I have one component with this query fragment:
If I click from that component to another one that has the same query except it also asks for the body field e.g.:
Relay then sends in parallel 5 queries that look like:
{ query: 'query Router{node(id:"UG9zdDo1MA=="){body,id}}
This errors as the
Node
type doesn't have a body field.The text was updated successfully, but these errors were encountered: