skip to content

Operations & Documents

What a client sends: operations, selection sets, variables, fragments and the validation a document must survive — the fastest way to tell who has written GraphQL from who has only read about it.

part ofGraphQLoverview, primer and where to startread it →
on this pageshow

questions

page 2 of 2

Why is a custom executable directive in a GraphQL document not portable?

level: middleimportance: nice to knowfreq 24%

basics

~20 s

Only @skip and @include are executable directives every GraphQL server must support. Anything else is defined by one server, with behaviour the specification never describes, so a document using it fails validation elsewhere as an unknown directive.

open as a page

What does a GraphQL inline fragment with no type condition mean?

level: middleimportance: nice to knowfreq 21%

basics

~20 s

The type condition is optional. Written as ... { ... }, the fragment takes the enclosing selection set's type as its condition, so it always applies. Its practical use is grouping several fields under one directive.

open as a page

In a GraphQL response, how does a fragment spread's position affect key order?

level: seniorimportance: nice to knowfreq 22%

basics

~20 s

Response keys follow the order the document requests them, with each fragment expanded in place at its spread. A response key that appears twice keeps its first position, so a later duplicate never moves it to the end.

open as a page

Why can't one GraphQL subscription operation watch two event streams at once?

level: seniorimportance: nice to knowfreq 24%

basics

~20 s

Because a subscription operation's root selection set must collapse to exactly one field, and that field is what creates the event source. Two streams means two subscription operations, or one root field emitting a union of event shapes.

open as a page

showing 31–34 of 34