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

feat: Accept ReadonlyArray<T> for enum members #916

Merged

Conversation

tom-sherman
Copy link
Contributor

Closes #455

I added in a new isArray util which just calls Array.isArray but correctly narrows the type of the input. This is to workaround the issue described here, the solution was taken from the since reverted microsoft/TypeScript#39258

@tom-sherman tom-sherman changed the title Accept ReadonlyArray<T> for enum members feat: Accept ReadonlyArray<T> for enum members May 24, 2021
@tom-sherman tom-sherman force-pushed the enum-members-accept-readonlyarray branch from 23c77ab to 30d7d15 Compare May 24, 2021 21:20
@codecov
Copy link

codecov bot commented May 24, 2021

Codecov Report

Merging #916 (30d7d15) into main (31a6137) will increase coverage by 0.00%.
The diff coverage is 100.00%.

❗ Current head 30d7d15 differs from pull request most recent head fceb8bb. Consider uploading reports for the commit fceb8bb to get more accurate results

@@           Coverage Diff           @@
##             main     #916   +/-   ##
=======================================
  Coverage   93.91%   93.91%           
=======================================
  Files          46       46           
  Lines        2957     2960    +3     
  Branches      692      692           
=======================================
+ Hits         2777     2780    +3     
  Misses        178      178           
  Partials        2        2           

@tom-sherman tom-sherman changed the title feat: Accept ReadonlyArray<T> for enum members feat: Accept ReadonlyArray<T> for enum members May 24, 2021
src/utils.ts Outdated Show resolved Hide resolved
Copy link
Member

@jasonkuhrt jasonkuhrt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ty!

@jasonkuhrt jasonkuhrt merged commit 3a92760 into graphql-nexus:main May 25, 2021
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

Successfully merging this pull request may close these issues.

Can enumType.members allow readonly string[]?
2 participants