Skip to content

Commit 49746d6

Browse files
committed
remove unused types
1 parent 254b1d5 commit 49746d6

File tree

1 file changed

+7
-27
lines changed

1 file changed

+7
-27
lines changed

src/connection/connection.ts

Lines changed: 7 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -10,68 +10,48 @@ import {
1010

1111
import type {
1212
GraphQLNamedType,
13-
GraphQLScalarType,
14-
GraphQLFieldConfigArgumentMap,
1513
GraphQLFieldConfigMap,
1614
GraphQLFieldResolver,
1715
Thunk,
1816
} from 'graphql';
1917

20-
interface ForwardConnectionArgs {
21-
after: { type: GraphQLScalarType };
22-
first: { type: GraphQLScalarType };
23-
}
24-
2518
/**
2619
* Returns a GraphQLFieldConfigArgumentMap appropriate to include on a field
2720
* whose return type is a connection type with forward pagination.
2821
*/
29-
export const forwardConnectionArgs: ForwardConnectionArgs &
30-
GraphQLFieldConfigArgumentMap = {
22+
export const forwardConnectionArgs = {
3123
after: {
3224
type: GraphQLString,
33-
// @ts-expect-error FIXME
3425
description:
3526
'Returns the items in the list that come after the specified cursor.',
3627
},
3728
first: {
3829
type: GraphQLInt,
39-
// @ts-expect-error FIXME
4030
description: 'Returns the first n items from the list.',
4131
},
42-
};
43-
44-
interface BackwardConnectionArgs {
45-
before: { type: GraphQLScalarType };
46-
last: { type: GraphQLScalarType };
47-
}
32+
} as const;
4833

4934
/**
5035
* Returns a GraphQLFieldConfigArgumentMap appropriate to include on a field
5136
* whose return type is a connection type with backward pagination.
5237
*/
53-
export const backwardConnectionArgs: BackwardConnectionArgs &
54-
GraphQLFieldConfigArgumentMap = {
38+
export const backwardConnectionArgs = {
5539
before: {
5640
type: GraphQLString,
57-
// @ts-expect-error FIXME
5841
description:
5942
'Returns the items in the list that come before the specified cursor.',
6043
},
6144
last: {
6245
type: GraphQLInt,
63-
// @ts-expect-error FIXME
6446
description: 'Returns the last n items from the list.',
6547
},
66-
};
48+
} as const;
6749

6850
/**
6951
* Returns a GraphQLFieldConfigArgumentMap appropriate to include on a field
7052
* whose return type is a connection type with bidirectional pagination.
7153
*/
72-
export const connectionArgs: BackwardConnectionArgs &
73-
ForwardConnectionArgs &
74-
GraphQLFieldConfigArgumentMap = {
54+
export const connectionArgs = {
7555
...forwardConnectionArgs,
7656
...backwardConnectionArgs,
7757
};
@@ -170,7 +150,7 @@ export interface Connection<T> {
170150
/**
171151
* A type designed to be exposed as a `Edge` over GraphQL.
172152
*/
173-
interface Edge<T> {
153+
export interface Edge<T> {
174154
node: T;
175155
cursor: ConnectionCursor;
176156
}
@@ -204,7 +184,7 @@ const pageInfoType = new GraphQLObjectType({
204184
/**
205185
* A type designed to be exposed as `PageInfo` over GraphQL.
206186
*/
207-
interface PageInfo {
187+
export interface PageInfo {
208188
startCursor: ConnectionCursor | null;
209189
endCursor: ConnectionCursor | null;
210190
hasPreviousPage: boolean;

0 commit comments

Comments
 (0)