Fragment spread is possible

Formal Specification

  • For each spread (named or inline) defined in the document.
  • Let fragment be the target of spread
  • Let fragmentType be the type condition of fragment
  • Let parentType be the type of the selection set containing spread
  • Let applicableTypes be the intersection of GetPossibleTypes ( fragmentType ) and GetPossibleTypes ( parentType )
  • applicableTypes must not be empty.

GetPossibleTypes

(

type

)

  1. If type is an object type, return a set containing type
  2. If type is an interface type, return the set of types implementing type
  3. If type is a union type, return the set of possible types of type

Explanatory Text

Fragments are declared on a type and will only apply when the runtime object type matches the type condition. They also are spread within the context of a parent type. A fragment spread is only valid if its type condition could ever apply within the parent type.

results matching ""

    No results matching ""