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

Overriding default behavior for enum mapping #25

Open
josemduarte opened this issue Jun 22, 2018 · 1 comment
Open

Overriding default behavior for enum mapping #25

josemduarte opened this issue Jun 22, 2018 · 1 comment

Comments

@josemduarte
Copy link

First of all thank you for such a great library and documentation.

I am facing a problem where my enums in POJOs have values that are not allowed in GraphQL enums (e.g. spaces):

public enum MyEnum {
        MY_FIRST_VAL("valid_value"),
        MY_SECOND_VAL("invalid value with spaces");
}

Schemagen-graphql then fails at validating the values, when trying to convert those enum values to graphql enum values.

What I would like to achieve is to change the default behavior and treat my enums from POJOs as Strings in graphql schema, instead of treating them as explicit enums in graphql schema.

Is that achievable with a type mapper? Alternatively does anyone know of other workarounds?

josemduarte added a commit to josemduarte/schemagen-graphql that referenced this issue Jun 22, 2018
@josemduarte
Copy link
Author

This test demonstrates the issue: josemduarte@60b5310

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

1 participant