Skip to content
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

Error with ALL CAPS graphql enums #239

Closed
vishalrao8 opened this issue Jun 11, 2021 · 1 comment
Closed

Error with ALL CAPS graphql enums #239

vishalrao8 opened this issue Jun 11, 2021 · 1 comment

Comments

@vishalrao8
Copy link

Build value generator throws this error

[SEVERE] built_value_generator:built_value on lib/schema.schema.gql.dart (cached):
Error in BuiltValueGenerator for /lorikeet/lib/schema.schema.gql.dart.
Please make the following changes to use built_value serialization:

1. Declare GENUM_USERSPERMISSIONSUSER_STATUS.serializer as: static Serializer<GENUM_USERSPERMISSIONSUSER_STATUS> get 
serializer => _$gENUMUSERSPERMISSIONSUSERSTATUSSerializer; got static Serializer<GENUM_USERSPERMISSIONSUSER_STATUS> get serializer => _$genumUserspermissionsuserStatusSerializer;
2. Declare GENUM_USERSPERMISSIONSUSER_USERTYPE.serializer as: static Serializer<GENUM_USERSPERMISSIONSUSER_USERTYPE> 
get serializer => _$gENUMUSERSPERMISSIONSUSERUSERTYPESerializer; got static Serializer<GENUM_USERSPERMISSIONSUSER_USERTYPE> get serializer => _$genumUserspermissionsuserUsertypeSerializer;

for a graphql schema file with enums defined as -

enum ENUM_USERSPERMISSIONSUSER_USERTYPE {
  member
  guest
  visitor
  applicant
  admin
}
enum ENUM_USERSPERMISSIONSUSER_STATUS {
  approved
  rejected
  pending
}

This bug is resolved by manually changing generated enum class name's case but this workaround has to be done every time the graphql schema gets updated.

enum Enum_userspermissionsuser_status {
  approved
  rejected
  pending
}
enum Enum_userspermissionsuser_usertype {
  member
  guest
  visitor
  applicant
  admin
}
@knaeckeKami
Copy link
Collaborator

this is fixed by #225

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants