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
Replaces the baked-in recursive selection with two pieces:
- Default selection is now scalar/enum leaves of the return type only. This is
always valid (leaves need no sub-selection) and small enough to stay under a
server's query-complexity budget. Composite fields, and fields whose required
arguments cannot be synthesized, are no longer emitted bare or argument-less.
- Tools expose an optional `select` input carrying a GraphQL selection set,
spliced into the operation at invoke time, so callers request nested/list data
(and supply nested required arguments) per call instead of inheriting one
frozen, arbitrarily-bounded selection.
The old depth cap and first-12-fields truncation are gone: depth/breadth are now
the caller's choice via `select`, bounded by the server's own complexity limits.
Copy file name to clipboardExpand all lines: .changeset/graphql-valid-selections.md
+5-1Lines changed: 5 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,4 +2,8 @@
2
2
"@executor-js/plugin-graphql": patch
3
3
---
4
4
5
-
Fix the GraphQL plugin generating invalid operations against large schemas. The auto-generated selection set no longer emits composite (object/connection) fields without a sub-selection, and no longer selects nested fields whose required arguments it cannot supply. Generated tools now validate against rich schemas (such as GitLab's) instead of failing on every call against a rich return type.
5
+
Fix the GraphQL plugin generating invalid operations against large schemas, and make field selection caller-controlled instead of a baked-in guess.
6
+
7
+
Previously each tool froze a recursive, depth- and count-bounded selection at sync time. Against a rich schema (GitLab) this produced invalid GraphQL (composite fields with no sub-selection, nested fields missing required arguments) so every call over a rich return type failed, and the arbitrary bound silently truncated which fields came back.
8
+
9
+
Generated tools now default to selecting only scalar/enum leaf fields of the return type (always valid, always within a server's query-complexity budget), and expose an optional `select` input carrying a GraphQL selection set so a caller can request nested or list data per call (including supplying nested required arguments). Fixes #1146.
description: `Optional GraphQL selection set for the \`${returnTypeName}\` return type. Overrides the default, which selects only scalar fields. Provide the fields to return, with sub-selections for nested objects and arguments where required, e.g. "id name items { id title }". Omit for the default.`,
0 commit comments