Skip to content

Commit

Permalink
Adding documentation for new codegen options
Browse files Browse the repository at this point in the history
  • Loading branch information
caffeineflo committed Jan 12, 2024
1 parent 684136f commit b37ac8c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions docs/codegen.md
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,10 @@ Supported keys are `when` and `maybeWhen`, and the values are booleans indicatin
generation of the extension method not.
By default, both are disabled.

`tristate_optionals`: \[bool\] Whether to use tristate optionals for nullable variables and input types. A Value class is used to represent the three possible states: absence of a value, presence of a value that is null, and presence of a non-null value. This class is used by the generated code for GraphQL variables and input types that are nullable in order to distinguish between the absence of a value and the presence of a null value, typically used for "update" Mutations. Defaults to false.

`vars_create_factories`: \[bool\] Whether to generate an additional factory constructor for the variables class. In contrast to the `built_value` builders, this factory constructor respects nullability for it's parameters. Defaults to false.

Example:

```yaml
Expand Down

0 comments on commit b37ac8c

Please sign in to comment.