|
9 | 9 | } from 'graphql';
|
10 | 10 |
|
11 | 11 | import type {
|
12 |
| - GraphQLNamedType, |
| 12 | + GraphQLOutputType, |
13 | 13 | GraphQLFieldConfigArgumentMap,
|
14 | 14 | GraphQLFieldConfigMap,
|
15 | 15 | GraphQLFieldResolver,
|
@@ -76,7 +76,7 @@ export interface ConnectionArguments {
|
76 | 76 |
|
77 | 77 | interface ConnectionConfig {
|
78 | 78 | name?: string;
|
79 |
| - nodeType: GraphQLNamedType | GraphQLNonNull<GraphQLNamedType>; |
| 79 | + nodeType: GraphQLOutputType | GraphQLNonNull<GraphQLOutputType>; |
80 | 80 | resolveNode?: GraphQLFieldResolver<any, any>;
|
81 | 81 | resolveCursor?: GraphQLFieldResolver<any, any>;
|
82 | 82 | edgeFields?: Thunk<GraphQLFieldConfigMap<any, any>>;
|
@@ -107,20 +107,21 @@ export function connectionDefinitions(
|
107 | 107 | const edgeType = new GraphQLObjectType({
|
108 | 108 | name: name + 'Edge',
|
109 | 109 | description: 'An edge in a connection.',
|
110 |
| - // @ts-expect-error TODO FIXME |
111 |
| - fields: () => ({ |
112 |
| - node: { |
113 |
| - type: nodeType, |
114 |
| - resolve: config.resolveNode, |
115 |
| - description: 'The item at the end of the edge', |
116 |
| - }, |
117 |
| - cursor: { |
118 |
| - type: new GraphQLNonNull(GraphQLString), |
119 |
| - resolve: config.resolveCursor, |
120 |
| - description: 'A cursor for use in pagination', |
121 |
| - }, |
122 |
| - ...resolveMaybeThunk(config.edgeFields ?? {}), |
123 |
| - }), |
| 110 | + fields(): GraphQLFieldConfigMap<unknown, unknown> { |
| 111 | + return { |
| 112 | + node: { |
| 113 | + type: nodeType, |
| 114 | + resolve: config.resolveNode, |
| 115 | + description: 'The item at the end of the edge', |
| 116 | + }, |
| 117 | + cursor: { |
| 118 | + type: new GraphQLNonNull(GraphQLString), |
| 119 | + resolve: config.resolveCursor, |
| 120 | + description: 'A cursor for use in pagination', |
| 121 | + }, |
| 122 | + ...resolveMaybeThunk(config.edgeFields ?? {}), |
| 123 | + }; |
| 124 | + }, |
124 | 125 | });
|
125 | 126 |
|
126 | 127 | const connectionType = new GraphQLObjectType({
|
|
0 commit comments