Skip to content

Commit

Permalink
feat(vars-builder-generator): Adding documentation for new codegen op…
Browse files Browse the repository at this point in the history
…tions
  • Loading branch information
caffeineflo committed Jan 16, 2024
1 parent 684136f commit e573084
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
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
2 changes: 1 addition & 1 deletion packages/ferry_generator/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ topics:
- codegen
dependencies:
gql: '>=0.14.0 <2.0.0'
gql_code_builder: ^0.9.2
gql_code_builder: ^0.10.0
gql_tristate_value: ^1.0.0
built_collection: ^5.0.0
code_builder: ^4.3.0
Expand Down

0 comments on commit e573084

Please sign in to comment.