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

Looks like Enum with reserved keyword causes problems #223

Open
elnygren opened this issue Nov 29, 2020 · 1 comment
Open

Looks like Enum with reserved keyword causes problems #223

elnygren opened this issue Nov 29, 2020 · 1 comment

Comments

@elnygren
Copy link

I have a GraphQL enum with values "public" and "other".

enum Visibility {
  public
  other
}

and query similar to:

module MyThingFragment = [%graphql {|

  fragment MyThingFragment on ListedShift {
    visibility
  }

|}];

Apparently "public" becomes `public_ (note underscore) but something else is wrong in the generated code and it's still looking for `public (without underscore) as I get an error that says:

Error: This pattern matches values of type [? `public ]
       but a pattern was expected which matches values of type
         t_visibility
       The second variant type does not allow tag(s) `public
@jfrolich
Copy link
Collaborator

We have to add an _ to poly variants that are keywords. It looks like it is somehow not escaped everywhere in the generated code, thanks for the bug report!

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

2 participants