dotansimha / dotansimha/graphql-typed-document-node

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

Open
#143 2 comments 0 reactions 1 assignee Claimed by @n1ru4l View on GitHub
Dominant language
TypeScript
Stars
412
Forks
22
PR merge metrics
No merged PRs in 30d

Description

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:

```ts
type OperationString = 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:
- https://twitter.com/n1rual/status/1560506403709648898
- https://twitter.com/n1rual/status/1559164014701301763
- https://github.com/dotansimha/graphql-code-generator/issues/8296

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.