@@ -10,68 +10,48 @@ import {
10
10
11
11
import type {
12
12
GraphQLNamedType ,
13
- GraphQLScalarType ,
14
- GraphQLFieldConfigArgumentMap ,
15
13
GraphQLFieldConfigMap ,
16
14
GraphQLFieldResolver ,
17
15
Thunk ,
18
16
} from 'graphql' ;
19
17
20
- interface ForwardConnectionArgs {
21
- after : { type : GraphQLScalarType } ;
22
- first : { type : GraphQLScalarType } ;
23
- }
24
-
25
18
/**
26
19
* Returns a GraphQLFieldConfigArgumentMap appropriate to include on a field
27
20
* whose return type is a connection type with forward pagination.
28
21
*/
29
- export const forwardConnectionArgs : ForwardConnectionArgs &
30
- GraphQLFieldConfigArgumentMap = {
22
+ export const forwardConnectionArgs = {
31
23
after : {
32
24
type : GraphQLString ,
33
- // @ts -expect-error FIXME
34
25
description :
35
26
'Returns the items in the list that come after the specified cursor.' ,
36
27
} ,
37
28
first : {
38
29
type : GraphQLInt ,
39
- // @ts -expect-error FIXME
40
30
description : 'Returns the first n items from the list.' ,
41
31
} ,
42
- } ;
43
-
44
- interface BackwardConnectionArgs {
45
- before : { type : GraphQLScalarType } ;
46
- last : { type : GraphQLScalarType } ;
47
- }
32
+ } as const ;
48
33
49
34
/**
50
35
* Returns a GraphQLFieldConfigArgumentMap appropriate to include on a field
51
36
* whose return type is a connection type with backward pagination.
52
37
*/
53
- export const backwardConnectionArgs : BackwardConnectionArgs &
54
- GraphQLFieldConfigArgumentMap = {
38
+ export const backwardConnectionArgs = {
55
39
before : {
56
40
type : GraphQLString ,
57
- // @ts -expect-error FIXME
58
41
description :
59
42
'Returns the items in the list that come before the specified cursor.' ,
60
43
} ,
61
44
last : {
62
45
type : GraphQLInt ,
63
- // @ts -expect-error FIXME
64
46
description : 'Returns the last n items from the list.' ,
65
47
} ,
66
- } ;
48
+ } as const ;
67
49
68
50
/**
69
51
* Returns a GraphQLFieldConfigArgumentMap appropriate to include on a field
70
52
* whose return type is a connection type with bidirectional pagination.
71
53
*/
72
- export const connectionArgs : BackwardConnectionArgs &
73
- ForwardConnectionArgs &
74
- GraphQLFieldConfigArgumentMap = {
54
+ export const connectionArgs = {
75
55
...forwardConnectionArgs ,
76
56
...backwardConnectionArgs ,
77
57
} ;
@@ -170,7 +150,7 @@ export interface Connection<T> {
170
150
/**
171
151
* A type designed to be exposed as a `Edge` over GraphQL.
172
152
*/
173
- interface Edge < T > {
153
+ export interface Edge < T > {
174
154
node : T ;
175
155
cursor : ConnectionCursor ;
176
156
}
@@ -204,7 +184,7 @@ const pageInfoType = new GraphQLObjectType({
204
184
/**
205
185
* A type designed to be exposed as `PageInfo` over GraphQL.
206
186
*/
207
- interface PageInfo {
187
+ export interface PageInfo {
208
188
startCursor : ConnectionCursor | null ;
209
189
endCursor : ConnectionCursor | null ;
210
190
hasPreviousPage : boolean ;
0 commit comments