1
1
import type * as Schema from '../../../tests/_/schemas/kitchen-sink/graffle/modules/SchemaBuildtime.js'
2
2
import type { Index } from '../../../tests/_/schemas/kitchen-sink/graffle/modules/SchemaIndex.js'
3
3
import type * as SelectionSets from '../../../tests/_/schemas/kitchen-sink/graffle/modules/SelectionSets.js'
4
- import { AssertEqual } from '../../lib/assert-equal.js'
4
+ import { assertEqual } from '../../lib/assert-equal.js'
5
5
import type { InferResult } from './__.js'
6
6
import type { PickSelectsPositiveIndicatorAndNotSelectAlias } from './Object.js'
7
7
@@ -10,118 +10,118 @@ type $<$SelectionSet extends SelectionSets.Query> = InferResult.Query<$Selection
10
10
// dprint-ignore
11
11
{
12
12
13
- AssertEqual < PickSelectsPositiveIndicatorAndNotSelectAlias < { a : true } > , 'a' > ( )
14
- AssertEqual < PickSelectsPositiveIndicatorAndNotSelectAlias < { a : [ 'b' , true ] ; b : true } > , 'b' > ( )
13
+ assertEqual < PickSelectsPositiveIndicatorAndNotSelectAlias < { a : true } > , 'a' > ( )
14
+ assertEqual < PickSelectsPositiveIndicatorAndNotSelectAlias < { a : [ 'b' , true ] ; b : true } > , 'b' > ( )
15
15
16
16
}
17
17
18
18
// dprint-ignore
19
19
{
20
20
21
- AssertEqual < $ < { __typename : true } > , { __typename : 'Query' } > ( )
21
+ assertEqual < $ < { __typename : true } > , { __typename : 'Query' } > ( )
22
22
23
23
// Scalar
24
- AssertEqual < $ < { id : true } > , { id : null | string } > ( )
24
+ assertEqual < $ < { id : true } > , { id : null | string } > ( )
25
25
// AssertEqual<RS<{ id: 1 }>, { id: null | string }>()
26
26
// non-nullable
27
- AssertEqual < $ < { idNonNull : true } > , { idNonNull : string } > ( )
27
+ assertEqual < $ < { idNonNull : true } > , { idNonNull : string } > ( )
28
28
// indicator negative
29
- AssertEqual < $ < { id : true ; string : false } > , { id : null | string } > ( )
29
+ assertEqual < $ < { id : true ; string : false } > , { id : null | string } > ( )
30
30
// AssertEqual<RS<{ id: true; string: 0 }>, { id: null | string }>()
31
- AssertEqual < $ < { id : true ; string : undefined } > , { id : null | string } > ( )
31
+ assertEqual < $ < { id : true ; string : undefined } > , { id : null | string } > ( )
32
32
33
33
// Custom Scalar
34
- AssertEqual < $ < { date : true } > , { date : null | Date } > ( )
34
+ assertEqual < $ < { date : true } > , { date : null | Date } > ( )
35
35
36
36
// List
37
- AssertEqual < $ < { listIntNonNull : true } > , { listIntNonNull : number [ ] } > ( )
38
- AssertEqual < $ < { listInt : true } > , { listInt : null | ( null | number ) [ ] } > ( )
39
- AssertEqual < $ < { listListIntNonNull : true } > , { listListIntNonNull : number [ ] [ ] } > ( )
40
- AssertEqual < $ < { listListInt : true } > , { listListInt : null | ( ( null | ( null | number ) [ ] ) [ ] ) } > ( )
37
+ assertEqual < $ < { listIntNonNull : true } > , { listIntNonNull : number [ ] } > ( )
38
+ assertEqual < $ < { listInt : true } > , { listInt : null | ( null | number ) [ ] } > ( )
39
+ assertEqual < $ < { listListIntNonNull : true } > , { listListIntNonNull : number [ ] [ ] } > ( )
40
+ assertEqual < $ < { listListInt : true } > , { listListInt : null | ( ( null | ( null | number ) [ ] ) [ ] ) } > ( )
41
41
42
42
// Enum
43
- AssertEqual < $ < { abcEnum : true } > , { abcEnum : null | 'A' | 'B' | 'C' } > ( )
43
+ assertEqual < $ < { abcEnum : true } > , { abcEnum : null | 'A' | 'B' | 'C' } > ( )
44
44
45
45
// Object
46
- AssertEqual < $ < { object : { id : true } } > , { object : null | { id : string | null } } > ( )
46
+ assertEqual < $ < { object : { id : true } } > , { object : null | { id : string | null } } > ( )
47
47
// non-nullable
48
- AssertEqual < $ < { objectNonNull : { id : true } } > , { objectNonNull : { id : string | null } } > ( )
48
+ assertEqual < $ < { objectNonNull : { id : true } } > , { objectNonNull : { id : string | null } } > ( )
49
49
// with args
50
- AssertEqual < $ < { objectWithArgs : { $ : { id : 'abc' } ; id : true } } > , { objectWithArgs : null | { id : string | null } } > ( )
50
+ assertEqual < $ < { objectWithArgs : { $ : { id : 'abc' } ; id : true } } > , { objectWithArgs : null | { id : string | null } } > ( )
51
51
52
52
// scalars-wildcard
53
- AssertEqual < $ < { objectNonNull : { $scalars : true } } > , { objectNonNull : { __typename : "Object1" ; string : null | string ; int : null | number ; float : null | number ; boolean : null | boolean ; id : null | string } } > ( )
53
+ assertEqual < $ < { objectNonNull : { $scalars : true } } > , { objectNonNull : { __typename : "Object1" ; string : null | string ; int : null | number ; float : null | number ; boolean : null | boolean ; id : null | string } } > ( )
54
54
// scalars-wildcard with nested object
55
- AssertEqual < $ < { objectNested : { $scalars : true } } > , { objectNested : null | { __typename : "ObjectNested" ; id : null | string } } > ( )
55
+ assertEqual < $ < { objectNested : { $scalars : true } } > , { objectNested : null | { __typename : "ObjectNested" ; id : null | string } } > ( )
56
56
// __typename
57
- AssertEqual < $ < { objectNonNull : { __typename : true } } > , { objectNonNull : { __typename : "Object1" } } > ( )
57
+ assertEqual < $ < { objectNonNull : { __typename : true } } > , { objectNonNull : { __typename : "Object1" } } > ( )
58
58
59
59
// Union
60
- AssertEqual < $ < { unionFooBar : { __typename : true } } > , { unionFooBar : null | { __typename : "Foo" } | { __typename : "Bar" } } > ( )
61
- AssertEqual < $ < { unionFooBar : { ___on_Foo : { __typename : true } } } > , { unionFooBar : null | { } | { __typename : "Foo" } } > ( )
62
- AssertEqual < $ < { unionFooBar : { ___on_Foo : { id : true } } } > , { unionFooBar : null | { } | { id : null | string } } > ( )
63
- AssertEqual < $ < { unionFooBar : { __typename : true ; ___on_Foo : { id : true } } } > , { unionFooBar : null | { __typename : "Bar" } | { __typename : "Foo" ; id : null | string } } > ( )
60
+ assertEqual < $ < { unionFooBar : { __typename : true } } > , { unionFooBar : null | { __typename : "Foo" } | { __typename : "Bar" } } > ( )
61
+ assertEqual < $ < { unionFooBar : { ___on_Foo : { __typename : true } } } > , { unionFooBar : null | { } | { __typename : "Foo" } } > ( )
62
+ assertEqual < $ < { unionFooBar : { ___on_Foo : { id : true } } } > , { unionFooBar : null | { } | { id : null | string } } > ( )
63
+ assertEqual < $ < { unionFooBar : { __typename : true ; ___on_Foo : { id : true } } } > , { unionFooBar : null | { __typename : "Bar" } | { __typename : "Foo" ; id : null | string } } > ( )
64
64
// with Args
65
- AssertEqual < $ < { unionFooBarWithArgs : { $ : { id : `abc` } , ___on_Foo : { id : true } } } > , { unionFooBarWithArgs : null | { } | { id : null | string } } > ( )
65
+ assertEqual < $ < { unionFooBarWithArgs : { $ : { id : `abc` } , ___on_Foo : { id : true } } } > , { unionFooBarWithArgs : null | { } | { id : null | string } } > ( )
66
66
67
67
68
68
// Union fragments Case
69
- AssertEqual < $ < { lowerCaseUnion : { __typename :true , ___on_lowerCaseObject : { id : true } , ___on_lowerCaseObject2 : { int : true } } } > , { lowerCaseUnion : null | { __typename : 'lowerCaseObject' ; id : null | string } | { __typename : 'lowerCaseObject2' ; int : null | number } } > ( )
69
+ assertEqual < $ < { lowerCaseUnion : { __typename :true , ___on_lowerCaseObject : { id : true } , ___on_lowerCaseObject2 : { int : true } } } > , { lowerCaseUnion : null | { __typename : 'lowerCaseObject' ; id : null | string } | { __typename : 'lowerCaseObject2' ; int : null | number } } > ( )
70
70
71
71
72
72
// Interface
73
- AssertEqual < $ < { interface : { ___on_Object1ImplementingInterface : { id : true } } } > , { interface : null | { id : null | string } | { } } > ( )
74
- AssertEqual < $ < { interface : { ___on_Object1ImplementingInterface : { int : true } } } > , { interface : null | { int : null | number } | { } } > ( )
75
- AssertEqual < $ < { interface : { id : true } } > , { interface : null | { id : null | string } } > ( )
76
- AssertEqual < $ < { interface : { id : true , ___on_Object1ImplementingInterface : { id : true } } } > , { interface : null | { id : null | string } } > ( )
77
- AssertEqual < $ < { interface : { id : true , ___on_Object1ImplementingInterface : { int : true } } } > , { interface : null | { id : null | string } | { id : null | string ; int : null | number } } > ( )
78
- AssertEqual < $ < { interface : { __typename :true } } > , { interface : null | { __typename : 'Object1ImplementingInterface' } | { __typename : 'Object2ImplementingInterface' } } > ( )
79
- AssertEqual < $ < { interface : { ___on_Object1ImplementingInterface : { __typename : true } } } > , { interface : null | { __typename : 'Object1ImplementingInterface' } | { } } > ( )
80
- AssertEqual < $ < { interface : { $scalars : true } } > , { interface : null | { __typename : 'Object1ImplementingInterface' , id : null | string , int : null | number } | { __typename : 'Object2ImplementingInterface' , id : null | string ; boolean :null | boolean } } > ( )
73
+ assertEqual < $ < { interface : { ___on_Object1ImplementingInterface : { id : true } } } > , { interface : null | { id : null | string } | { } } > ( )
74
+ assertEqual < $ < { interface : { ___on_Object1ImplementingInterface : { int : true } } } > , { interface : null | { int : null | number } | { } } > ( )
75
+ assertEqual < $ < { interface : { id : true } } > , { interface : null | { id : null | string } } > ( )
76
+ assertEqual < $ < { interface : { id : true , ___on_Object1ImplementingInterface : { id : true } } } > , { interface : null | { id : null | string } } > ( )
77
+ assertEqual < $ < { interface : { id : true , ___on_Object1ImplementingInterface : { int : true } } } > , { interface : null | { id : null | string } | { id : null | string ; int : null | number } } > ( )
78
+ assertEqual < $ < { interface : { __typename :true } } > , { interface : null | { __typename : 'Object1ImplementingInterface' } | { __typename : 'Object2ImplementingInterface' } } > ( )
79
+ assertEqual < $ < { interface : { ___on_Object1ImplementingInterface : { __typename : true } } } > , { interface : null | { __typename : 'Object1ImplementingInterface' } | { } } > ( )
80
+ assertEqual < $ < { interface : { $scalars : true } } > , { interface : null | { __typename : 'Object1ImplementingInterface' , id : null | string , int : null | number } | { __typename : 'Object2ImplementingInterface' , id : null | string ; boolean :null | boolean } } > ( )
81
81
// with args
82
- AssertEqual < $ < { interfaceWithArgs : { $ :{ id :'abc' } ; id : true } } > , { interfaceWithArgs : null | { id : null | string } } > ( )
82
+ assertEqual < $ < { interfaceWithArgs : { $ :{ id :'abc' } ; id : true } } > , { interfaceWithArgs : null | { id : null | string } } > ( )
83
83
84
84
// todo alias on interfaces, interface fragments
85
85
// Alias
86
86
// scalar
87
- AssertEqual < $ < { id : [ 'x' , true ] } > , { x : null | string } > ( )
88
- AssertEqual < $ < { idNonNull : [ 'x' , true ] } > , { x : string } > ( )
87
+ assertEqual < $ < { id : [ 'x' , true ] } > , { x : null | string } > ( )
88
+ assertEqual < $ < { idNonNull : [ 'x' , true ] } > , { x : string } > ( )
89
89
// object
90
- AssertEqual < $ < { object : [ 'x' , { id : true } ] } > , { x : { id : null | string } | null } > ( )
90
+ assertEqual < $ < { object : [ 'x' , { id : true } ] } > , { x : { id : null | string } | null } > ( )
91
91
// argument
92
- AssertEqual < $ < { objectWithArgs : [ 'x' , { $ : { id :'' } ; id :true } ] } > , { x : { id : null | string } | null } > ( )
92
+ assertEqual < $ < { objectWithArgs : [ 'x' , { $ : { id :'' } ; id :true } ] } > , { x : { id : null | string } | null } > ( )
93
93
// multi
94
- AssertEqual < $ < { id : [ [ 'id1' , true ] , [ 'id2' , true ] ] } > , { id1 : null | string ; id2 : null | string } > ( )
94
+ assertEqual < $ < { id : [ [ 'id1' , true ] , [ 'id2' , true ] ] } > , { id1 : null | string ; id2 : null | string } > ( )
95
95
// AssertEqual<RS<{ id_as: true }>, { id_as: InferResult.Errors.UnknownFieldName<'id_as', Schema.Root.Query> }>()
96
96
// AssertEqual<RS<{ id_as_$: true }>, { id_as_$: InferResult.Errors.UnknownFieldName<'id_as_$', Schema.Root.Query> }>()
97
97
// union fragment
98
- AssertEqual < $ < { unionFooBar : { ___on_Foo : { id : [ 'id2' , true ] } } } > , { unionFooBar : null | { } | { id2 : null | string } } > ( )
98
+ assertEqual < $ < { unionFooBar : { ___on_Foo : { id : [ 'id2' , true ] } } } > , { unionFooBar : null | { } | { id2 : null | string } } > ( )
99
99
100
100
// Directive @include
101
101
// On scalar non-nullable
102
- AssertEqual < $ < { idNonNull : { $include : boolean } } > , { idNonNull : null | string } > ( )
103
- AssertEqual < $ < { idNonNull : { $include : { if :boolean } } } > , { idNonNull : null | string } > ( )
104
- AssertEqual < $ < { idNonNull : { $include : true } } > , { idNonNull : string } > ( )
105
- AssertEqual < $ < { idNonNull : { $include : { if :true } } } > , { idNonNull : string } > ( )
106
- AssertEqual < $ < { idNonNull : { $include : false } } > , { idNonNull : null } > ( )
107
- AssertEqual < $ < { idNonNull : { $include : { if :false } } } > , { idNonNull : null } > ( )
102
+ assertEqual < $ < { idNonNull : { $include : boolean } } > , { idNonNull : null | string } > ( )
103
+ assertEqual < $ < { idNonNull : { $include : { if :boolean } } } > , { idNonNull : null | string } > ( )
104
+ assertEqual < $ < { idNonNull : { $include : true } } > , { idNonNull : string } > ( )
105
+ assertEqual < $ < { idNonNull : { $include : { if :true } } } > , { idNonNull : string } > ( )
106
+ assertEqual < $ < { idNonNull : { $include : false } } > , { idNonNull : null } > ( )
107
+ assertEqual < $ < { idNonNull : { $include : { if :false } } } > , { idNonNull : null } > ( )
108
108
// On scalar nullable
109
- AssertEqual < $ < { id : { $include : boolean } } > , { id : null | string } > ( )
110
- AssertEqual < $ < { id : { $include : false } } > , { id : null } > ( )
111
- AssertEqual < $ < { id : { $include : true } } > , { id : null | string } > ( )
109
+ assertEqual < $ < { id : { $include : boolean } } > , { id : null | string } > ( )
110
+ assertEqual < $ < { id : { $include : false } } > , { id : null } > ( )
111
+ assertEqual < $ < { id : { $include : true } } > , { id : null | string } > ( )
112
112
113
113
// Directive @skip
114
114
// On scalar non-nullable
115
- AssertEqual < $ < { idNonNull : { $skip : boolean } } > , { idNonNull : null | string } > ( )
116
- AssertEqual < $ < { idNonNull : { $skip : { if :boolean } } } > , { idNonNull : null | string } > ( )
117
- AssertEqual < $ < { idNonNull : { $skip : true } } > , { idNonNull : null } > ( )
118
- AssertEqual < $ < { idNonNull : { $skip : { if :true } } } > , { idNonNull : null } > ( )
119
- AssertEqual < $ < { idNonNull : { $skip : false } } > , { idNonNull : string } > ( )
120
- AssertEqual < $ < { idNonNull : { $skip : { if :false } } } > , { idNonNull : string } > ( )
115
+ assertEqual < $ < { idNonNull : { $skip : boolean } } > , { idNonNull : null | string } > ( )
116
+ assertEqual < $ < { idNonNull : { $skip : { if :boolean } } } > , { idNonNull : null | string } > ( )
117
+ assertEqual < $ < { idNonNull : { $skip : true } } > , { idNonNull : null } > ( )
118
+ assertEqual < $ < { idNonNull : { $skip : { if :true } } } > , { idNonNull : null } > ( )
119
+ assertEqual < $ < { idNonNull : { $skip : false } } > , { idNonNull : string } > ( )
120
+ assertEqual < $ < { idNonNull : { $skip : { if :false } } } > , { idNonNull : string } > ( )
121
121
// On scalar nullable
122
- AssertEqual < $ < { id : { $skip : boolean } } > , { id : null | string } > ( )
123
- AssertEqual < $ < { id : { $skip : false } } > , { id : null | string } > ( )
124
- AssertEqual < $ < { id : { $skip : true } } > , { id : null } > ( )
122
+ assertEqual < $ < { id : { $skip : boolean } } > , { id : null | string } > ( )
123
+ assertEqual < $ < { id : { $skip : false } } > , { id : null | string } > ( )
124
+ assertEqual < $ < { id : { $skip : true } } > , { id : null } > ( )
125
125
126
126
// Directive @defer
127
127
// todo
@@ -134,13 +134,13 @@ AssertEqual<$<{ id: { $skip: true } }>, { id: null }>()
134
134
135
135
// Arguments
136
136
// scalar
137
- AssertEqual < $ < { stringWithArgs : true } > , { stringWithArgs : null | string } > ( )
138
- AssertEqual < $ < { stringWithArgs : { $ : { string : '' } } } > , { stringWithArgs : null | string } > ( )
137
+ assertEqual < $ < { stringWithArgs : true } > , { stringWithArgs : null | string } > ( )
138
+ assertEqual < $ < { stringWithArgs : { $ : { string : '' } } } > , { stringWithArgs : null | string } > ( )
139
139
140
140
// Errors
141
141
// @ts -expect-error invalid query
142
142
type Result = $ < { id2 : true } >
143
143
// unknown field
144
- AssertEqual < Result , { id2 : InferResult . Errors . UnknownFieldName < 'id2' , Schema . Root . Query > } > ( )
144
+ assertEqual < Result , { id2 : InferResult . Errors . UnknownFieldName < 'id2' , Schema . Root . Query > } > ( )
145
145
146
146
}
0 commit comments