Generics
Generics can be used to reuse types
or inputs
that have some
small subset of the fields slightly different from each other:
Source GraphQXL | Compiled GraphQL |
|
|
Notice how the generic type definition is omitted from the generated GraphQL. If
a type
or an input
is declared with generic type parameters, it will not be
present in the generated GraphQL.
It can even be combined with inheritance:
Source GraphQXL | Compiled GraphQL |
|
|