You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: GraphQL fields listed after a fragment spread are silently dropped #3861
Note: The below was written and discovered by claude but I have independently verified it myself as well.
What happened?
When a selection set contains a fragment spread (or inline fragment), every field listed after it in the same selection set is never added to the SQL query. Those fields come back null with no error. This applies to both scalar fields and relationship fields.
Repro:
query {
book_by_pk(id: 1) {
...bookFieldstitlepublishers { name }
}
}
fragmentbookFieldsonbook { id }
Expected: id, title and publishers are populated.
Actual: id is populated; title and publishers are null.
The same query works if ...bookFields is moved to the end of the selection set, or removed.
Cause: in SqlQueryStructure.AddGraphQLFields, both the FragmentSpread and the InlineFragment branches recurse into the fragment and then return;. That exits the foreach over the remaining selections. These look like they should be continue;:
The return; dates from #1236, which added fragment support for #1235. The Cosmos path (GenerateQueryColumns) iterates over every selection and isn't affected.
Activity