Skip to content

Commit 8b5a9a2

Browse files
connectionDefinitions: remove superfluous destructuring (#334)
1 parent 0dca219 commit 8b5a9a2

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

src/connection/connection.js

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -103,25 +103,21 @@ export function connectionDefinitions(
103103
): GraphQLConnectionDefinitions {
104104
const { nodeType } = config;
105105
const name = config.name ?? getNamedType(nodeType).name;
106-
const edgeFields = config.edgeFields ?? {};
107-
const connectionFields = config.connectionFields ?? {};
108-
const resolveNode = config.resolveNode;
109-
const resolveCursor = config.resolveCursor;
110106
const edgeType = new GraphQLObjectType({
111107
name: name + 'Edge',
112108
description: 'An edge in a connection.',
113109
fields: () => ({
114110
node: {
115111
type: nodeType,
116-
resolve: resolveNode,
112+
resolve: config.resolveNode,
117113
description: 'The item at the end of the edge',
118114
},
119115
cursor: {
120116
type: new GraphQLNonNull(GraphQLString),
121-
resolve: resolveCursor,
117+
resolve: config.resolveCursor,
122118
description: 'A cursor for use in pagination',
123119
},
124-
...resolveMaybeThunk(edgeFields),
120+
...resolveMaybeThunk(config.edgeFields ?? {}),
125121
}),
126122
});
127123

@@ -137,7 +133,7 @@ export function connectionDefinitions(
137133
type: new GraphQLList(edgeType),
138134
description: 'A list of edges.',
139135
},
140-
...resolveMaybeThunk(connectionFields),
136+
...resolveMaybeThunk(config.connectionFields ?? {}),
141137
}),
142138
});
143139

0 commit comments

Comments
 (0)