Executing Selection Sets

To execute a selection set, the object value being evaluated and the object type need to be known, as well as whether it must be executed serially, or may be executed in parallel.

First, the selection set is turned into a grouped field set; then, each represented field in the grouped field set produces an entry into a response map.

ExecuteSelectionSet

(

selectionSet

,

objectType

,

objectValue

,

variableValues

)

  1. Let groupedFieldSet be the result of CollectFields ( objectType , selectionSet , variableValues ) .
  2. Initialize resultMap to an empty ordered map.
  3. For each groupedFieldSet as responseKey and fields :
    1. Let fieldName be the name of the first entry in fields . Note: This value is unaffected if an alias is used.
    2. Let fieldType be the return type defined for the field fieldName of objectType .
    3. If fieldType is null :
      1. Continue to the next iteration of groupedFieldSet .
    4. Let responseValue be ExecuteField ( objectType , objectValue , fields , fieldType , variableValues ) .
    5. Set responseValue as the value for responseKey in resultMap .
  4. Return resultMap .

responseMap

is ordered by which fields appear first in the query. This is explained in greater detail in the Field Collection section below.

results matching ""

    No results matching ""