Skip to content

Instantly share code, notes, and snippets.

@fersilva16
Created February 10, 2022 22:31
Show Gist options
  • Save fersilva16/208a65f6ab4d5671d08c8f523ff62258 to your computer and use it in GitHub Desktop.
Save fersilva16/208a65f6ab4d5671d08c8f523ff62258 to your computer and use it in GitHub Desktop.
Get the GraphQL fields type from a type
export type GraphQLFields<T, C> = {
[K in keyof T]: Omit<GraphQLFieldConfig<T, C>, 'type' | 'resolve'> & {
type: GraphQLScalarTypeConfig<T[K], T[K]>,
resolve?: GraphQLFieldResolver<T, C, any, T[K]>
};
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment