-
Notifications
You must be signed in to change notification settings - Fork 19
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
Change TypedDocumentNode to a specification for embedding Operation/Fragment and Variable types within a TypeScript type #143
Comments
79 tasks
I did a quick test in graphql code generator by replacing It seems to work quite well! export const FilmItemFragmentDoc = {
kind: 'Document',
definitions: [
{
kind: 'FragmentDefinition',
name: { kind: 'Name', value: 'FilmItem' },
typeCondition: { kind: 'NamedType', name: { kind: 'Name', value: 'Film' } },
selectionSet: {
kind: 'SelectionSet',
selections: [
{ kind: 'Field', name: { kind: 'Name', value: 'id' } },
{ kind: 'Field', name: { kind: 'Name', value: 'title' } },
{ kind: 'Field', name: { kind: 'Name', value: 'releaseDate' } },
{ kind: 'Field', name: { kind: 'Name', value: 'producers' } },
],
},
},
],
} as unknown as import('graphql').DocumentNode & { __apiType?: (variables: unknown) => FilmItemFragment }; |
Related #148 |
14 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In terms of typed-document-node I think we should rather make it a specification for baking-in types into a TypeScript type and showing how to extract the type from it:
In case we later decide to change the method we could call it __graphql_types_v2 or sth.
What do you think?
Related:
The text was updated successfully, but these errors were encountered: