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

Is there a way to override the name of a Value in an Enum? #128

Open
cshadek opened this issue Nov 10, 2023 · 2 comments
Open

Is there a way to override the name of a Value in an Enum? #128

cshadek opened this issue Nov 10, 2023 · 2 comments

Comments

@cshadek
Copy link
Contributor

cshadek commented Nov 10, 2023

A use case of this would be to use enums as camelCase in resolvers, but have the API be snake_case. Or maybe even use a totally different name in the schema. I understand that most other types in the schema allow this.

@cshadek
Copy link
Contributor Author

cshadek commented Nov 17, 2023

@NeedleInAJayStack do you know if this would be difficult implement?

@NeedleInAJayStack
Copy link
Member

Hey, I haven't looked too deeply at it, but I think you'd need to add some code here where you would accept the dictionary key instead of setting it directly from the enum value: https://github.com/GraphQLSwift/Graphiti/blob/main/Sources/Graphiti/Enum/Enum.swift#L17

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