Skip to content

TypeInfo.getEnumValue() and EnumType.getValue(name)#674

Merged
leebyron merged 1 commit intomasterfrom
enum-value
Jan 19, 2017
Merged

TypeInfo.getEnumValue() and EnumType.getValue(name)#674
leebyron merged 1 commit intomasterfrom
enum-value

Conversation

@leebyron
Copy link
Copy Markdown
Contributor

This adds two new APIs to the schema utilities. One is for TypeInfo which is typically used alongside an AST visitor - now you can call getEnumValue() to get the GraphQLEnumValue instance referred to by the EnumValue ast node under visit.

Also, EnumType.getValue(name) accepts the name of an enum value and returns the GraphQLEnumValue instance associated with it. Beats running a getValues().find(...).

This adds two new APIs to the schema utilities. One is for `TypeInfo` which is typically used alongside an AST visitor - now you can call `getEnumValue()` to get the GraphQLEnumValue instance referred to by the EnumValue ast node under visit.

Also, `EnumType.getValue(name)` accepts the name of an enum value and returns the GraphQLEnumValue instance associated with it. Beats running a `getValues().find(...)`.
@leebyron leebyron merged commit 1f93cf4 into master Jan 19, 2017
@leebyron leebyron deleted the enum-value branch January 19, 2017 00:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants