11import type { Schema } from './_.js'
2- import * as Nodes from './nodes/__.js'
3- import type { List } from './nodes/List.js'
4- import type { Nullable } from './nodes/Nullable.js'
5- import * as Standard from './standard/scalars/scalars.js'
2+ import { Nodes } from './nodes/_.js'
3+ import { Standard } from './standard/_.js'
64
75/**
86 * Unwrap a type to get its named type, ditching inline types like List and Nullable.
97 */
108// todo extends any because of infinite depth issue in generated schema types
119// dprint-ignore
1210export type GetNamedType < $Type > =
13- $Type extends List < infer $innerType > ? GetNamedType < $innerType > :
14- $Type extends Nullable < infer $innerType > ? GetNamedType < $innerType > :
11+ $Type extends Nodes . List < infer $innerType > ? GetNamedType < $innerType > :
12+ $Type extends Nodes . Nullable < infer $innerType > ? GetNamedType < $innerType > :
1513 $Type extends Nodes . __typename ? $Type :
1614 $Type
1715
@@ -33,11 +31,11 @@ export type Define<$Type extends Partial<Schema>> = $Type & Schema
3331// dprint-ignore
3432export type LookupCustomScalarOrFallbackToUnknown < $Name extends string , $Scalars extends Nodes . Scalar . Registry > =
3533 $Name extends keyof $Scalars [ 'map' ] ? $Scalars [ 'map' ] [ $Name ]
36- : $Name extends 'String' ? typeof Standard . String
37- : $Name extends 'Int' ? typeof Standard . Int
38- : $Name extends 'Float' ? typeof Standard . Float
39- : $Name extends 'Boolean' ? typeof Standard . Boolean
40- : $Name extends 'ID' ? typeof Standard . ID
34+ : $Name extends 'String' ? typeof Standard . Scalars . String
35+ : $Name extends 'Int' ? typeof Standard . Scalars . Int
36+ : $Name extends 'Float' ? typeof Standard . Scalars . Float
37+ : $Name extends 'Boolean' ? typeof Standard . Scalars . Boolean
38+ : $Name extends 'ID' ? typeof Standard . Scalars . ID
4139 : typeof Nodes . Scalar . UnknownScalar
4240
4341/**
@@ -61,15 +59,15 @@ export const lookupCustomScalarOrFallbackToUnknown = (scalars: Nodes.Scalar.Scal
6159 // Handle standard GraphQL scalars
6260 switch ( name ) {
6361 case 'String' :
64- return Standard . String
62+ return Standard . Scalars . String
6563 case 'Int' :
66- return Standard . Int
64+ return Standard . Scalars . Int
6765 case 'Float' :
68- return Standard . Float
66+ return Standard . Scalars . Float
6967 case 'Boolean' :
70- return Standard . Boolean
68+ return Standard . Scalars . Boolean
7169 case 'ID' :
72- return Standard . ID
70+ return Standard . Scalars . ID
7371 default :
7472 return Nodes . Scalar . UnknownScalar
7573 }
0 commit comments