Enum value is not resolved to internal value for directive argumets and default values
See original GitHub issuethe original issue was submitted to the graphql-tools repo, but it seems that it never made it here.
the issue is that after following the official documentation the enum value is not resolved to the internal value when used as a default value or in directives.
the test attached to the original issue provided by @JakeDawkins https://gist.github.com/JakeDawkins/66f5b026cf21515f1004f057754a2cd4
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:7 (5 by maintainers)
Top Results From Across the Web
What you need to know about GraphQL enums
Apollo Server will resolve enum values to their proper internal values ( resolvers.AuthType ) for both input and output data ( Mutation ...
Read more >Directives - Apollo GraphQL Docs
Default directives Marks the schema definition of a field or enum value as deprecated with an optional reason. @skip(if: Boolean!) If true...
Read more >How to use a typescript enum value in an Angular2 ngSwitch ...
This question is about ngSwitch based upon a particular value of an enum. Although the same approach of creating an class-internal reference to ......
Read more >Enumeration declaration - cppreference.com
An enumeration is a distinct type whose value is restricted to a range of values (see below for details), which may include several ......
Read more >Enums - C# language specification - Microsoft Learn
An enum type is a distinct value type (§8.3) that declares a set of named ... Shall resolve to an integral type other...
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

@raduflp With current
graphql-jsdesigndefaultValueshould be in internal representation. So to correct @JakeDawkins example you need to do:Same goes for custom scalars, arrays or any other example of input coercion. For example
IDcoerce numbers to strings but this coercion is not applied ondefaultValue:Current behavior is expected 👍