-
Notifications
You must be signed in to change notification settings - Fork 121
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot use tristate_optionals: true
in mutations having lists in their parameters
#571
Comments
Thanks! Most likely related to |
Ok, I see, thank you for the links! Do you have a workaround for it? (Excluding adding |
unfortunately, no workaround at this time. (other than forking gql_code_builder and adding the builder factories here https://github.com/gql-dart/gql/blob/master/codegen/gql_code_builder/lib/serializer.dart#L54 ) |
Actually, I think a workaround would be to add a type Workaround {
field: [PokemonUpdateInput!]!
} This would add the builder factory. |
This is a nice idea, thank you for your help! |
Hi!
I found an issue when using the
tristate_optionals: true
option inferry_generator|graphql_builder
.I forked the project and updated the
pokemon_explorer
example to show you how to easily reproduce the issue.What I have done :
gql_tristate_value: ^1.0.0
package into pubspec.yamlschema.graphql
file with this mutation :update_pokemon.graphql
file under thesrc/graphql/
folder containing the following code :Here, if you run the
dart run build_runner build --delete-conflicting-outputs
, everything is working as expected 👌Now, if you add the
tristate_optionals: true
to thebuild.yaml
file :And run the
dart run build_runner build --delete-conflicting-outputs
command, theserializes.gql.g.dart
file is missing the following builder factory :Therefore, when the code is running and the
GPokemonUpdateInput
needs to be serialized, there is an exception indicating that no serializer is found for theBuiltList<GPokemonUpdateInput>
.If you turn
off
thetristate_optionals
, the builder factory is added as expected and the code is running perfectly (but the tristate feature cannot be used).Is there anything missing to be able to use
tristate_optionals
with mutations having lists in their parameters?Thank you for your help and don't hesitate if you need more details!
The text was updated successfully, but these errors were encountered: