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:
(
objectType
,
fragmentType
)
- If
fragmentType
is an Object Type:
- if objectType and fragmentType are the same type, return true , otherwise return false .
- If
fragmentType
is an Interface Type:
- if objectType is an implementation of fragmentType , return true otherwise return false .
- If
fragmentType
is a Union:
- if objectType is a possible type of fragmentType , return true otherwise return false .