4
4
type FieldTypeFunc ,
5
5
fieldType ,
6
6
} from '@keystone-6/core/types'
7
- import { graphql } from '@keystone-6/core'
7
+ import { g } from '@keystone-6/core'
8
8
9
9
type PairFieldConfig < ListTypeInfo extends BaseListTypeInfo > = CommonFieldConfig < ListTypeInfo >
10
10
@@ -14,26 +14,26 @@ type PairInput = {
14
14
}
15
15
type PairOutput = PairInput
16
16
17
- const PairInput = graphql . inputObject ( {
17
+ const PairInput = g . inputObject ( {
18
18
name : 'PairNestedInput' ,
19
19
fields : {
20
- left : graphql . arg ( { type : graphql . String } ) ,
21
- right : graphql . arg ( { type : graphql . String } ) ,
20
+ left : g . arg ( { type : g . String } ) ,
21
+ right : g . arg ( { type : g . String } ) ,
22
22
} ,
23
23
} )
24
24
25
- const PairOutput = graphql . object < PairOutput > ( ) ( {
25
+ const PairOutput = g . object < PairOutput > ( ) ( {
26
26
name : 'PairNestedOutput' ,
27
27
fields : {
28
- left : graphql . field ( { type : graphql . String } ) ,
29
- right : graphql . field ( { type : graphql . String } ) ,
28
+ left : g . field ( { type : g . String } ) ,
29
+ right : g . field ( { type : g . String } ) ,
30
30
} ,
31
31
} )
32
32
33
- const PairFilter = graphql . inputObject ( {
33
+ const PairFilter = g . inputObject ( {
34
34
name : 'PairNestedFilter' ,
35
35
fields : {
36
- equals : graphql . arg ( {
36
+ equals : g . arg ( {
37
37
type : PairInput ,
38
38
} ) ,
39
39
} ,
@@ -81,25 +81,25 @@ export function pair<ListTypeInfo extends BaseListTypeInfo> (
81
81
...config ,
82
82
input : {
83
83
where : {
84
- arg : graphql . arg ( { type : PairFilter } ) ,
84
+ arg : g . arg ( { type : PairFilter } ) ,
85
85
resolve ( value , context ) {
86
86
return resolveWhere ( value )
87
87
} ,
88
88
} ,
89
89
create : {
90
- arg : graphql . arg ( { type : PairInput } ) ,
90
+ arg : g . arg ( { type : PairInput } ) ,
91
91
resolve ( value , context ) {
92
92
return resolveInput ( value )
93
93
} ,
94
94
} ,
95
95
update : {
96
- arg : graphql . arg ( { type : PairInput } ) ,
96
+ arg : g . arg ( { type : PairInput } ) ,
97
97
resolve ( value , context ) {
98
98
return resolveInput ( value )
99
99
} ,
100
100
} ,
101
101
} ,
102
- output : graphql . field ( {
102
+ output : g . field ( {
103
103
type : PairOutput ,
104
104
resolve ( { value, item } , args , context , info ) {
105
105
return resolveOutput ( value )
0 commit comments