Open KevinDespoulainsTR opened 6 months ago
Thanks!
Most likely related to https://github.com/gql-dart/gql/issues/436 and https://github.com/google/built_value.dart/issues/124
Ok, I see, thank you for the links!
Do you have a workaround for it? (Excluding adding addBuilderFactory
to the serializers.gql.g.dart
file because if someone else runs the build_runner
command it will erase it)
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 Workaround
type to the graphql schema which has the list in the non-nullable form.
type Workaround {
field: [PokemonUpdateInput!]!
}
This would add the builder factory.
Actually, I think a workaround would be to add a
Workaround
type to the graphql schema which has the list in the non-nullable form.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 :input PokemonUpdateInput { id: Int! name: String! }
mutation UpdatePokemons($pokemons: [PokemonUpdateInput!]) { updatePokemons(pokemons: $pokemons) }
targets: $default: builders: ferry_generator|graphql_builder: enabled: true options: schema: pokemon_explorer|lib/schema.graphql tristate_optionals: true when_extensions: when: true maybeWhen: true ferry_generator|serializer_builder: enabled: true options: schema: pokemon_explorer|lib/schema.graphql
... ..addBuilderFactory( const FullType( BuiltList, const [const FullType(GPokemonUpdateInput)]), () => new ListBuilder())
...
StateError (Bad state: No builder factory for BuiltList. Fix by adding one, see SerializersBuilder.addBuilderFactory.)