Fields
GraphQL queries look the same for both single items or list of items.
Arguments
In GraphQL, every field and nested object can get its own set of arguments. You can even pass arguments into scalar fields.
Aliases
Alias let you rename the result of a field to anything you want.
Fregments
Fregments let you construct sets of fields, and then include them in queries where you need.
Variables
GraphQL has a first-class way to factor dynamic values out of the query, and pass them as a seperate dictionary.
All declared variables must be either scalars, enums or input object types.
Variable definition can be optional or required. Since there isn't a !
next to the Episode
type, it's optional.
Directives
A directive can be attached to a field or fragment inclusion.
The core GraphQL specification includes exactly two directives.
@include(if: Boolean)
@skip(if: Boolean)
Mutations
The review variable we passed in is an input object type.
While query fields are executed in parallel, mutation fields run in series, on after the other, ensuring that we don't end up with a race condition with ourselves.
Inline Fragments
If you are querying a field that returns a interface or a union type, you will need to use inline fragments to access data on the underlying concrete type.