Skip to content

Commit 3848a2b

Browse files
authored
Add @defer directive support (#9196)
1 parent a12b060 commit 3848a2b

File tree

120 files changed

+2665
-134
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

120 files changed

+2665
-134
lines changed

.changeset/eleven-news-lay.md

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
'@graphql-codegen/typed-document-node': minor
3+
'@graphql-codegen/visitor-plugin-common': minor
4+
'@graphql-codegen/typescript-operations': minor
5+
'@graphql-codegen/typescript': minor
6+
'@graphql-codegen/typescript-resolvers': minor
7+
'@graphql-codegen/client-preset': minor
8+
---
9+
10+
Add `@defer` directive support

.changeset/modern-clouds-prove.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@graphql-codegen/client-preset': patch
3+
---
4+
5+
Pass `emitLegacyCommonJSImports` and `isStringDocumentMode` to the client preset config

dev-test/githunt/typed-document-nodes.ts

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ export type InputMaybe<T> = Maybe<T>;
44
export type Exact<T extends { [key: string]: unknown }> = { [K in keyof T]: T[K] };
55
export type MakeOptional<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]?: Maybe<T[SubKey]> };
66
export type MakeMaybe<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]: Maybe<T[SubKey]> };
7+
export type MakeEmpty<T extends { [key: string]: unknown }, K extends keyof T> = { [_ in K]?: never };
8+
export type Incremental<T> = T | { [P in keyof T]?: P extends ' $fragmentName' | '__typename' ? T[P] : never };
79
/** All built-in and custom scalars, mapped to their actual values */
810
export type Scalars = {
911
ID: string;

dev-test/githunt/types.avoidOptionals.ts

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ export type InputMaybe<T> = Maybe<T>;
33
export type Exact<T extends { [key: string]: unknown }> = { [K in keyof T]: T[K] };
44
export type MakeOptional<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]?: Maybe<T[SubKey]> };
55
export type MakeMaybe<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]: Maybe<T[SubKey]> };
6+
export type MakeEmpty<T extends { [key: string]: unknown }, K extends keyof T> = { [_ in K]?: never };
7+
export type Incremental<T> = T | { [P in keyof T]?: P extends ' $fragmentName' | '__typename' ? T[P] : never };
68
/** All built-in and custom scalars, mapped to their actual values */
79
export type Scalars = {
810
ID: string;

dev-test/githunt/types.d.ts

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ export type InputMaybe<T> = Maybe<T>;
33
export type Exact<T extends { [key: string]: unknown }> = { [K in keyof T]: T[K] };
44
export type MakeOptional<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]?: Maybe<T[SubKey]> };
55
export type MakeMaybe<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]: Maybe<T[SubKey]> };
6+
export type MakeEmpty<T extends { [key: string]: unknown }, K extends keyof T> = { [_ in K]?: never };
7+
export type Incremental<T> = T | { [P in keyof T]?: P extends ' $fragmentName' | '__typename' ? T[P] : never };
68
/** All built-in and custom scalars, mapped to their actual values */
79
export type Scalars = {
810
ID: string;

dev-test/githunt/types.enumsAsTypes.ts

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ export type InputMaybe<T> = Maybe<T>;
33
export type Exact<T extends { [key: string]: unknown }> = { [K in keyof T]: T[K] };
44
export type MakeOptional<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]?: Maybe<T[SubKey]> };
55
export type MakeMaybe<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]: Maybe<T[SubKey]> };
6+
export type MakeEmpty<T extends { [key: string]: unknown }, K extends keyof T> = { [_ in K]?: never };
7+
export type Incremental<T> = T | { [P in keyof T]?: P extends ' $fragmentName' | '__typename' ? T[P] : never };
68
/** All built-in and custom scalars, mapped to their actual values */
79
export type Scalars = {
810
ID: string;

dev-test/githunt/types.flatten.preResolveTypes.ts

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ export type InputMaybe<T> = Maybe<T>;
33
export type Exact<T extends { [key: string]: unknown }> = { [K in keyof T]: T[K] };
44
export type MakeOptional<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]?: Maybe<T[SubKey]> };
55
export type MakeMaybe<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]: Maybe<T[SubKey]> };
6+
export type MakeEmpty<T extends { [key: string]: unknown }, K extends keyof T> = { [_ in K]?: never };
7+
export type Incremental<T> = T | { [P in keyof T]?: P extends ' $fragmentName' | '__typename' ? T[P] : never };
68
/** All built-in and custom scalars, mapped to their actual values */
79
export type Scalars = {
810
ID: string;

dev-test/githunt/types.immutableTypes.ts

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ export type InputMaybe<T> = Maybe<T>;
33
export type Exact<T extends { [key: string]: unknown }> = { [K in keyof T]: T[K] };
44
export type MakeOptional<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]?: Maybe<T[SubKey]> };
55
export type MakeMaybe<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]: Maybe<T[SubKey]> };
6+
export type MakeEmpty<T extends { [key: string]: unknown }, K extends keyof T> = { [_ in K]?: never };
7+
export type Incremental<T> = T | { [P in keyof T]?: P extends ' $fragmentName' | '__typename' ? T[P] : never };
68
/** All built-in and custom scalars, mapped to their actual values */
79
export type Scalars = {
810
ID: string;

dev-test/githunt/types.preResolveTypes.onlyOperationTypes.ts

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ export type InputMaybe<T> = Maybe<T>;
33
export type Exact<T extends { [key: string]: unknown }> = { [K in keyof T]: T[K] };
44
export type MakeOptional<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]?: Maybe<T[SubKey]> };
55
export type MakeMaybe<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]: Maybe<T[SubKey]> };
6+
export type MakeEmpty<T extends { [key: string]: unknown }, K extends keyof T> = { [_ in K]?: never };
7+
export type Incremental<T> = T | { [P in keyof T]?: P extends ' $fragmentName' | '__typename' ? T[P] : never };
68
/** All built-in and custom scalars, mapped to their actual values */
79
export type Scalars = {
810
ID: string;

dev-test/githunt/types.preResolveTypes.ts

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ export type InputMaybe<T> = Maybe<T>;
33
export type Exact<T extends { [key: string]: unknown }> = { [K in keyof T]: T[K] };
44
export type MakeOptional<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]?: Maybe<T[SubKey]> };
55
export type MakeMaybe<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]: Maybe<T[SubKey]> };
6+
export type MakeEmpty<T extends { [key: string]: unknown }, K extends keyof T> = { [_ in K]?: never };
7+
export type Incremental<T> = T | { [P in keyof T]?: P extends ' $fragmentName' | '__typename' ? T[P] : never };
68
/** All built-in and custom scalars, mapped to their actual values */
79
export type Scalars = {
810
ID: string;

dev-test/githunt/types.ts

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ export type InputMaybe<T> = Maybe<T>;
33
export type Exact<T extends { [key: string]: unknown }> = { [K in keyof T]: T[K] };
44
export type MakeOptional<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]?: Maybe<T[SubKey]> };
55
export type MakeMaybe<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]: Maybe<T[SubKey]> };
6+
export type MakeEmpty<T extends { [key: string]: unknown }, K extends keyof T> = { [_ in K]?: never };
7+
export type Incremental<T> = T | { [P in keyof T]?: P extends ' $fragmentName' | '__typename' ? T[P] : never };
68
/** All built-in and custom scalars, mapped to their actual values */
79
export type Scalars = {
810
ID: string;

dev-test/gql-tag-operations-masking/gql/fragment-masking.ts

+20-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
import { ResultOf, DocumentTypeDecoration } from '@graphql-typed-document-node/core';
1+
import { ResultOf, DocumentTypeDecoration, TypedDocumentNode } from '@graphql-typed-document-node/core';
2+
import { FragmentDefinitionNode } from 'graphql';
3+
import { Incremental } from './graphql.js';
24

35
export type FragmentType<TDocumentType extends DocumentTypeDecoration<any, any>> =
46
TDocumentType extends DocumentTypeDecoration<infer TType, any>
5-
? TType extends { ' $fragmentName'?: infer TKey }
7+
? [TType] extends [{ ' $fragmentName'?: infer TKey }]
68
? TKey extends string
79
? { ' $fragmentRefs'?: { [key in TKey]: TType } }
810
: never
@@ -46,3 +48,19 @@ export function makeFragmentData<F extends DocumentTypeDecoration<any, any>, FT
4648
): FragmentType<F> {
4749
return data as FragmentType<F>;
4850
}
51+
export function isFragmentReady<TQuery, TFrag>(
52+
queryNode: DocumentTypeDecoration<TQuery, any>,
53+
fragmentNode: TypedDocumentNode<TFrag>,
54+
data: FragmentType<TypedDocumentNode<Incremental<TFrag>, any>> | null | undefined
55+
): data is FragmentType<typeof fragmentNode> {
56+
const deferredFields = (queryNode as { __meta__?: { deferredFields: Record<string, (keyof TFrag)[]> } }).__meta__
57+
?.deferredFields;
58+
59+
if (!deferredFields) return true;
60+
61+
const fragDef = fragmentNode.definitions[0] as FragmentDefinitionNode | undefined;
62+
const fragName = fragDef?.name?.value;
63+
64+
const fields = fragName ? deferredFields[fragName] : [];
65+
return fields.length > 0 && fields.every(field => data && field in data);
66+
}

dev-test/gql-tag-operations-masking/gql/graphql.ts

+2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ export type InputMaybe<T> = Maybe<T>;
55
export type Exact<T extends { [key: string]: unknown }> = { [K in keyof T]: T[K] };
66
export type MakeOptional<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]?: Maybe<T[SubKey]> };
77
export type MakeMaybe<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]: Maybe<T[SubKey]> };
8+
export type MakeEmpty<T extends { [key: string]: unknown }, K extends keyof T> = { [_ in K]?: never };
9+
export type Incremental<T> = T | { [P in keyof T]?: P extends ' $fragmentName' | '__typename' ? T[P] : never };
810
/** All built-in and custom scalars, mapped to their actual values */
911
export type Scalars = {
1012
ID: string;

dev-test/gql-tag-operations-urql/gql/fragment-masking.ts

+20-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
import { ResultOf, DocumentTypeDecoration } from '@graphql-typed-document-node/core';
1+
import { ResultOf, DocumentTypeDecoration, TypedDocumentNode } from '@graphql-typed-document-node/core';
2+
import { FragmentDefinitionNode } from 'graphql';
3+
import { Incremental } from './graphql.js';
24

35
export type FragmentType<TDocumentType extends DocumentTypeDecoration<any, any>> =
46
TDocumentType extends DocumentTypeDecoration<infer TType, any>
5-
? TType extends { ' $fragmentName'?: infer TKey }
7+
? [TType] extends [{ ' $fragmentName'?: infer TKey }]
68
? TKey extends string
79
? { ' $fragmentRefs'?: { [key in TKey]: TType } }
810
: never
@@ -46,3 +48,19 @@ export function makeFragmentData<F extends DocumentTypeDecoration<any, any>, FT
4648
): FragmentType<F> {
4749
return data as FragmentType<F>;
4850
}
51+
export function isFragmentReady<TQuery, TFrag>(
52+
queryNode: DocumentTypeDecoration<TQuery, any>,
53+
fragmentNode: TypedDocumentNode<TFrag>,
54+
data: FragmentType<TypedDocumentNode<Incremental<TFrag>, any>> | null | undefined
55+
): data is FragmentType<typeof fragmentNode> {
56+
const deferredFields = (queryNode as { __meta__?: { deferredFields: Record<string, (keyof TFrag)[]> } }).__meta__
57+
?.deferredFields;
58+
59+
if (!deferredFields) return true;
60+
61+
const fragDef = fragmentNode.definitions[0] as FragmentDefinitionNode | undefined;
62+
const fragName = fragDef?.name?.value;
63+
64+
const fields = fragName ? deferredFields[fragName] : [];
65+
return fields.length > 0 && fields.every(field => data && field in data);
66+
}

dev-test/gql-tag-operations-urql/gql/graphql.ts

+2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ export type InputMaybe<T> = Maybe<T>;
55
export type Exact<T extends { [key: string]: unknown }> = { [K in keyof T]: T[K] };
66
export type MakeOptional<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]?: Maybe<T[SubKey]> };
77
export type MakeMaybe<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]: Maybe<T[SubKey]> };
8+
export type MakeEmpty<T extends { [key: string]: unknown }, K extends keyof T> = { [_ in K]?: never };
9+
export type Incremental<T> = T | { [P in keyof T]?: P extends ' $fragmentName' | '__typename' ? T[P] : never };
810
/** All built-in and custom scalars, mapped to their actual values */
911
export type Scalars = {
1012
ID: string;

dev-test/gql-tag-operations/gql/fragment-masking.ts

+20-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
import { ResultOf, DocumentTypeDecoration } from '@graphql-typed-document-node/core';
1+
import { ResultOf, DocumentTypeDecoration, TypedDocumentNode } from '@graphql-typed-document-node/core';
2+
import { FragmentDefinitionNode } from 'graphql';
3+
import { Incremental } from './graphql.js';
24

35
export type FragmentType<TDocumentType extends DocumentTypeDecoration<any, any>> =
46
TDocumentType extends DocumentTypeDecoration<infer TType, any>
5-
? TType extends { ' $fragmentName'?: infer TKey }
7+
? [TType] extends [{ ' $fragmentName'?: infer TKey }]
68
? TKey extends string
79
? { ' $fragmentRefs'?: { [key in TKey]: TType } }
810
: never
@@ -46,3 +48,19 @@ export function makeFragmentData<F extends DocumentTypeDecoration<any, any>, FT
4648
): FragmentType<F> {
4749
return data as FragmentType<F>;
4850
}
51+
export function isFragmentReady<TQuery, TFrag>(
52+
queryNode: DocumentTypeDecoration<TQuery, any>,
53+
fragmentNode: TypedDocumentNode<TFrag>,
54+
data: FragmentType<TypedDocumentNode<Incremental<TFrag>, any>> | null | undefined
55+
): data is FragmentType<typeof fragmentNode> {
56+
const deferredFields = (queryNode as { __meta__?: { deferredFields: Record<string, (keyof TFrag)[]> } }).__meta__
57+
?.deferredFields;
58+
59+
if (!deferredFields) return true;
60+
61+
const fragDef = fragmentNode.definitions[0] as FragmentDefinitionNode | undefined;
62+
const fragName = fragDef?.name?.value;
63+
64+
const fields = fragName ? deferredFields[fragName] : [];
65+
return fields.length > 0 && fields.every(field => data && field in data);
66+
}

dev-test/gql-tag-operations/gql/graphql.ts

+2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ export type InputMaybe<T> = Maybe<T>;
55
export type Exact<T extends { [key: string]: unknown }> = { [K in keyof T]: T[K] };
66
export type MakeOptional<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]?: Maybe<T[SubKey]> };
77
export type MakeMaybe<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]: Maybe<T[SubKey]> };
8+
export type MakeEmpty<T extends { [key: string]: unknown }, K extends keyof T> = { [_ in K]?: never };
9+
export type Incremental<T> = T | { [P in keyof T]?: P extends ' $fragmentName' | '__typename' ? T[P] : never };
810
/** All built-in and custom scalars, mapped to their actual values */
911
export type Scalars = {
1012
ID: string;

dev-test/gql-tag-operations/graphql/fragment-masking.ts

+20-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
import { ResultOf, DocumentTypeDecoration } from '@graphql-typed-document-node/core';
1+
import { ResultOf, DocumentTypeDecoration, TypedDocumentNode } from '@graphql-typed-document-node/core';
2+
import { FragmentDefinitionNode } from 'graphql';
3+
import { Incremental } from './graphql.js';
24

35
export type FragmentType<TDocumentType extends DocumentTypeDecoration<any, any>> =
46
TDocumentType extends DocumentTypeDecoration<infer TType, any>
5-
? TType extends { ' $fragmentName'?: infer TKey }
7+
? [TType] extends [{ ' $fragmentName'?: infer TKey }]
68
? TKey extends string
79
? { ' $fragmentRefs'?: { [key in TKey]: TType } }
810
: never
@@ -46,3 +48,19 @@ export function makeFragmentData<F extends DocumentTypeDecoration<any, any>, FT
4648
): FragmentType<F> {
4749
return data as FragmentType<F>;
4850
}
51+
export function isFragmentReady<TQuery, TFrag>(
52+
queryNode: DocumentTypeDecoration<TQuery, any>,
53+
fragmentNode: TypedDocumentNode<TFrag>,
54+
data: FragmentType<TypedDocumentNode<Incremental<TFrag>, any>> | null | undefined
55+
): data is FragmentType<typeof fragmentNode> {
56+
const deferredFields = (queryNode as { __meta__?: { deferredFields: Record<string, (keyof TFrag)[]> } }).__meta__
57+
?.deferredFields;
58+
59+
if (!deferredFields) return true;
60+
61+
const fragDef = fragmentNode.definitions[0] as FragmentDefinitionNode | undefined;
62+
const fragName = fragDef?.name?.value;
63+
64+
const fields = fragName ? deferredFields[fragName] : [];
65+
return fields.length > 0 && fields.every(field => data && field in data);
66+
}

dev-test/gql-tag-operations/graphql/graphql.ts

+2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ export type InputMaybe<T> = Maybe<T>;
55
export type Exact<T extends { [key: string]: unknown }> = { [K in keyof T]: T[K] };
66
export type MakeOptional<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]?: Maybe<T[SubKey]> };
77
export type MakeMaybe<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]: Maybe<T[SubKey]> };
8+
export type MakeEmpty<T extends { [key: string]: unknown }, K extends keyof T> = { [_ in K]?: never };
9+
export type Incremental<T> = T | { [P in keyof T]?: P extends ' $fragmentName' | '__typename' ? T[P] : never };
810
/** All built-in and custom scalars, mapped to their actual values */
911
export type Scalars = {
1012
ID: string;

dev-test/modules/types.ts

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ export type InputMaybe<T> = Maybe<T>;
44
export type Exact<T extends { [key: string]: unknown }> = { [K in keyof T]: T[K] };
55
export type MakeOptional<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]?: Maybe<T[SubKey]> };
66
export type MakeMaybe<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]: Maybe<T[SubKey]> };
7+
export type MakeEmpty<T extends { [key: string]: unknown }, K extends keyof T> = { [_ in K]?: never };
8+
export type Incremental<T> = T | { [P in keyof T]?: P extends ' $fragmentName' | '__typename' ? T[P] : never };
79
export type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
810
export type RequireFields<T, K extends keyof T> = Omit<T, K> & { [P in K]-?: NonNullable<T[P]> };
911
/** All built-in and custom scalars, mapped to their actual values */

dev-test/star-wars/types.avoidOptionals.ts

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ export type InputMaybe<T> = Maybe<T>;
33
export type Exact<T extends { [key: string]: unknown }> = { [K in keyof T]: T[K] };
44
export type MakeOptional<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]?: Maybe<T[SubKey]> };
55
export type MakeMaybe<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]: Maybe<T[SubKey]> };
6+
export type MakeEmpty<T extends { [key: string]: unknown }, K extends keyof T> = { [_ in K]?: never };
7+
export type Incremental<T> = T | { [P in keyof T]?: P extends ' $fragmentName' | '__typename' ? T[P] : never };
68
/** All built-in and custom scalars, mapped to their actual values */
79
export type Scalars = {
810
ID: string;

dev-test/star-wars/types.d.ts

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ export type InputMaybe<T> = Maybe<T>;
33
export type Exact<T extends { [key: string]: unknown }> = { [K in keyof T]: T[K] };
44
export type MakeOptional<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]?: Maybe<T[SubKey]> };
55
export type MakeMaybe<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]: Maybe<T[SubKey]> };
6+
export type MakeEmpty<T extends { [key: string]: unknown }, K extends keyof T> = { [_ in K]?: never };
7+
export type Incremental<T> = T | { [P in keyof T]?: P extends ' $fragmentName' | '__typename' ? T[P] : never };
68
/** All built-in and custom scalars, mapped to their actual values */
79
export type Scalars = {
810
ID: string;

dev-test/star-wars/types.globallyAvailable.d.ts

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ type InputMaybe<T> = Maybe<T>;
33
type Exact<T extends { [key: string]: unknown }> = { [K in keyof T]: T[K] };
44
type MakeOptional<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]?: Maybe<T[SubKey]> };
55
type MakeMaybe<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]: Maybe<T[SubKey]> };
6+
type MakeEmpty<T extends { [key: string]: unknown }, K extends keyof T> = { [_ in K]?: never };
7+
type Incremental<T> = T | { [P in keyof T]?: P extends ' $fragmentName' | '__typename' ? T[P] : never };
68
/** All built-in and custom scalars, mapped to their actual values */
79
type Scalars = {
810
ID: string;

dev-test/star-wars/types.immutableTypes.ts

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ export type InputMaybe<T> = Maybe<T>;
33
export type Exact<T extends { [key: string]: unknown }> = { [K in keyof T]: T[K] };
44
export type MakeOptional<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]?: Maybe<T[SubKey]> };
55
export type MakeMaybe<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]: Maybe<T[SubKey]> };
6+
export type MakeEmpty<T extends { [key: string]: unknown }, K extends keyof T> = { [_ in K]?: never };
7+
export type Incremental<T> = T | { [P in keyof T]?: P extends ' $fragmentName' | '__typename' ? T[P] : never };
68
/** All built-in and custom scalars, mapped to their actual values */
79
export type Scalars = {
810
ID: string;

dev-test/star-wars/types.preResolveTypes.onlyOperationTypes.ts

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ export type InputMaybe<T> = Maybe<T>;
33
export type Exact<T extends { [key: string]: unknown }> = { [K in keyof T]: T[K] };
44
export type MakeOptional<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]?: Maybe<T[SubKey]> };
55
export type MakeMaybe<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]: Maybe<T[SubKey]> };
6+
export type MakeEmpty<T extends { [key: string]: unknown }, K extends keyof T> = { [_ in K]?: never };
7+
export type Incremental<T> = T | { [P in keyof T]?: P extends ' $fragmentName' | '__typename' ? T[P] : never };
68
/** All built-in and custom scalars, mapped to their actual values */
79
export type Scalars = {
810
ID: string;

dev-test/star-wars/types.preResolveTypes.ts

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ export type InputMaybe<T> = Maybe<T>;
33
export type Exact<T extends { [key: string]: unknown }> = { [K in keyof T]: T[K] };
44
export type MakeOptional<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]?: Maybe<T[SubKey]> };
55
export type MakeMaybe<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]: Maybe<T[SubKey]> };
6+
export type MakeEmpty<T extends { [key: string]: unknown }, K extends keyof T> = { [_ in K]?: never };
7+
export type Incremental<T> = T | { [P in keyof T]?: P extends ' $fragmentName' | '__typename' ? T[P] : never };
68
/** All built-in and custom scalars, mapped to their actual values */
79
export type Scalars = {
810
ID: string;

0 commit comments

Comments
 (0)