Allow empty selection sets - flag version - #4852
martinbonnin wants to merge 7 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
Co-authored-by: Benjie <benjie@jemjie.com>
|
With the parser now accepting The spec's Single Root Field rule says the collected fields map "must have exactly one entry", and this PR doesn't change that rule. if (groupedFieldSet.size > 1) {That was enough while the grammar guaranteed at least one selection. Now it lets an empty subscription through, and the same goes for Suggestion: report when For reference, Hot Chocolate's implementation of this change (ChilliCream/graphql-platform#10337) allows empty selection sets on query and mutation roots and on composite fields, but keeps rejecting an empty subscription root. Drafted by Claude (Anthropic AI assistant). |
|
@glen-84 sorry I forgot to reply here but the case where a subscription has no root field is now handled in this PR. Thank you and Claude for catching it. |
|
@yaacovCR the spec is merged, can we merge this one? |
See graphql/graphql-spec#1227
There is a new (and already deprecated!) parser/validation option
allowEmptySelectionSets. It is true by default (new behaviour). Set it tofalseto switch back to the old behaviour.