Skip to content

Commit ef4e7d0

Browse files
caffeinefloknaeckeKami
authored andcommitted
feat(vars-builder-generator): Adding documentation for new codegen options
1 parent 3b28cf1 commit ef4e7d0

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

docs/codegen.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,10 @@ Supported keys are `when` and `maybeWhen`, and the values are booleans indicatin
210210
generation of the extension method not.
211211
By default, both are disabled.
212212

213+
`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.
214+
215+
`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.
216+
213217
Example:
214218

215219
```yaml

packages/ferry_generator/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ topics:
1212
- codegen
1313
dependencies:
1414
gql: '>=0.14.0 <2.0.0'
15-
gql_code_builder: ^0.9.2
15+
gql_code_builder: ^0.10.0
1616
gql_tristate_value: ^1.0.0
1717
built_collection: ^5.0.0
1818
code_builder: ^4.3.0

0 commit comments

Comments
 (0)