Skip to content

Change TypedDocumentNode to a specification for embedding Operation/Fragment and Variable types within a TypeScript type #143

@n1ru4l

Description

@n1ru4l

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:

type OperationString<TVariables, TResult> = string & {
  ["  __graphql_types_v1"]?: (variables: TVariables) => TResult
}

In case we later decide to change the method we could call it __graphql_types_v2 or sth.

What do you think?


Related:

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions