From c395f67c67a79c277e4819b7a87503887103b17e Mon Sep 17 00:00:00 2001 From: Phil Pluckthun Date: Wed, 10 Jan 2024 12:39:28 +0000 Subject: [PATCH] Rename types in src/fragments for consistency --- src/fragments.ts | 8 ++++---- src/selection.ts | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/fragments.ts b/src/fragments.ts index b1e685e3..2ccf182f 100644 --- a/src/fragments.ts +++ b/src/fragments.ts @@ -1,14 +1,14 @@ import type { Kind } from '@0no-co/graphql.web'; -type _FragmentMapContinue = Definitions extends readonly [ +type _getFragmentMapRec = Definitions extends readonly [ infer Definition, ...infer Rest, ] ? (Definition extends { kind: Kind.FRAGMENT_DEFINITION; name: any } ? { [Name in Definition['name']['value']]: Definition } : {}) & - _FragmentMapContinue + _getFragmentMapRec : {}; -export type FragmentMap = - _FragmentMapContinue; +export type getFragmentMap = + _getFragmentMapRec; diff --git a/src/selection.ts b/src/selection.ts index f418c0d9..4b5af444 100644 --- a/src/selection.ts +++ b/src/selection.ts @@ -8,7 +8,7 @@ import type { import type { tada } from './namespace'; import type { obj, objValues } from './utils'; -import type { FragmentMap } from './fragments'; +import type { getFragmentMap } from './fragments'; import type { IntrospectionField, @@ -223,7 +223,7 @@ type getDocumentType< > = getDefinitionSelectionRec< Document['definitions'], Introspection, - FragmentMap & Fragments + getFragmentMap & Fragments >; type getFragmentType< @@ -240,7 +240,7 @@ type getFragmentType< Document['definitions'][0]['selectionSet']['selections'], Introspection['types'][TypeName], Introspection, - FragmentMap & Fragments + getFragmentMap & Fragments > : never : never