-
-
Notifications
You must be signed in to change notification settings - Fork 29
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
Typing array elements #67
Comments
Thanks! I'll check it later. |
Very slow response, but I've finally checked it. import { query, types } from 'typed-graphqlify'
const UserType = ['Student', 'Teacher',] as const
query('getUser', {
user: {
id: types.number,
name: types.string,
type: types.oneOf(UserType),
},
}) We may also support TS < 3.4 with overload signature. And this utility-type do the same thing: |
@laurensdijkstra |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In the Readme.MD you wrote
Note: Currently creating type from array element is not supported in TypeScript. See https://github.com/Microsoft/TypeScript/issues/28046
In that issue thread someone seems to have posted a solution that works with TS > 3.4. Does this help typed-graphqlify?
microsoft/TypeScript#28046 (comment)
The text was updated successfully, but these errors were encountered: