Input Objects
Creating Input objects
Input objects can be created using builder.inputType
.
Recursive inputs
Types for recursive inputs get slightly more complicated to implement because their types can't easily be inferred. Referencing other input types works without any additional logic, as long as there is no circular reference to the original type.
To build input types with recursive references you can use builder.inputRef
along with a type or
interface that describes the fields of your input object. The builder will still ensure all the
types are correct, but needs type definitions to help infer the correct values.
Additional way to define Input types
If you're unable to use the builder ref directly by assigning it to a variable as depicted above,
you can provide an Inputs
type to the SchemaBuilder
.
This is useful in a scenario where you have multiple schema builders.