We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
JsonValue
@graphql-codegen/flutter-freezed
The current version of json_serializable uses JsonValue as the Enum json serialize key.
https://stackblitz.com/edit/github-mc3hpg?file=app_models.dart
Schema.graphql
enum BookCategory { BusinessCareer Family }
Generate
enum BookCategory { @JsonKey(name: 'BusinessCareer') businessCareer, @JsonKey(name: 'Family') family, }
freezed generate
const _$BookCategoryEnumMap = { BookCategory.businessCareer: 'businessCareer', BookCategory.family: 'family', }
freezed use $enumDecode(_$BookCategoryEnumMap, e); to trans from json.
$enumDecode(_$BookCategoryEnumMap, e);
got error
Invalid argument(s): `BusinessCareer` is not one of the supported values: businessCareer, family,
enum BookCategory { @JsonValue('BusinessCareer') businessCareer, @JsonValue('Family') family, }
No response
"@graphql-codegen/cli": "5.0.2", "@graphql-codegen/flutter-freezed": "^4.0.0", "@graphql-codegen/introspection": "4.0.3", "@graphql-codegen/typescript": "4.0.6", "@graphql-codegen/typescript-resolvers": "4.0.6",
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Which packages are impacted by your issue?
@graphql-codegen/flutter-freezed
Describe the bug
The current version of json_serializable uses
JsonValue
as the Enum json serialize key.Your Example Website or App
https://stackblitz.com/edit/github-mc3hpg?file=app_models.dart
Steps to Reproduce the Bug or Issue
Schema.graphql
Generate
freezed generate
freezed use
$enumDecode(_$BookCategoryEnumMap, e);
to trans from json.got error
Expected behavior
Screenshots or Videos
No response
Platform
Codegen Config File
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: