Mutations that use Enums
See original GitHub issueMutations that use Enum values for inputs do not work as it creates the query string with double quotes around the Enum types
GraphQL schema
type ProviderHours {
day: DayOfWeek!
isOpen: Boolean!
}
enum DayOfWeek {
MONDAY
TUESDAY
...
}
Node
let mutation = {
mutation: {
updateProviderHours: {
__args: {
id: 1,
input: [{
day: 'MONDAY',
isOpen: false
}]
},
hours: {
day: true,
isOpen: true
}
}
}
}
mutation = jsonToGraphQLQuery(mutation)
the above gives me
mutation { updateProviderHours (providerId: 1, input: [{day: "MONDAY", isOpen: false}]) { hours { day isOpen } } }
using “MONDAY” in the string.
Is there anyway to not quote these values when they’re enumerators?
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Mutations that use Enums · Issue #2 · vkolgi/json-to-graphql ...
Mutations that use Enum values for inputs do not work as it creates the query string with double quotes around the Enum types...
Read more >How to use GraphQL enum and its best practices - Medium
In the following image, we illustrate the hierarchical tree graph of the response for our queries and mutations. Enum Types. Enums are basically...
Read more >GraphQL - Passing an enum value directly to a mutation as an ...
Show activity on this post. use the enum variable name as defined in the mutation and send it to Graphql, like I have...
Read more >What you need to know about GraphQL enums
Learn how GraphQL enums can help you build more robust and discoverable APIs, create simple interfaces, maintain slim resolvers, and more.
Read more >How to use GraphQL enum and its best practices
The enum class allows us to map enum values to internal values represented by integers (or different strings etc.). By defining enumerated ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Published
v1.2.0which supports this feature @steezeburger . Cheers @douglaseggleton 😃🦖Opened a PR for this. https://github.com/dupski/json-to-graphql-query/pull/3