Algorithms

This specification describes some algorithms used by the static and runtime semantics, they’re defined in the form of a function‐like syntax along with a list of algorithmic steps to take.

For example, this describes if a fragment should be spread into place given a runtimeobjectTypeand the fragment’sfragmentType:

doesFragmentTypeApply

(

objectType

,

fragmentType

)

  1. If fragmentType is an Object Type:
    1. if objectType and fragmentType are the same type, return true , otherwise return false .
  2. If fragmentType is an Interface Type:
    1. if objectType is an implementation of fragmentType , return true otherwise return false .
  3. If fragmentType is a Union:
    1. if objectType is a possible type of fragmentType , return true otherwise return false .

results matching ""

    No results matching ""