Skip to content

Commit 292091a

Browse files
author
Jay Herron
committed
Removes unnecessary function
1 parent 471791d commit 292091a

File tree

2 files changed

+16
-32
lines changed

2 files changed

+16
-32
lines changed

Sources/GraphQL/Execution/Execute.swift

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1229,26 +1229,3 @@ func getFieldDef(
12291229
// we know this field exists because we passed validation before execution
12301230
return parentType.fields[fieldName]!
12311231
}
1232-
1233-
func buildResolveInfo(
1234-
context: ExecutionContext,
1235-
fieldDef: GraphQLFieldDefinition,
1236-
fieldASTs: [Field],
1237-
parentType: GraphQLObjectType,
1238-
path: IndexPath
1239-
) -> GraphQLResolveInfo {
1240-
// The resolve function's optional fourth argument is a collection of
1241-
// information about the current execution state.
1242-
return GraphQLResolveInfo.init(
1243-
fieldName: fieldDef.name,
1244-
fieldASTs: fieldASTs,
1245-
returnType: fieldDef.type,
1246-
parentType: parentType,
1247-
path: path,
1248-
schema: context.schema,
1249-
fragments: context.fragments,
1250-
rootValue: context.rootValue,
1251-
operation: context.operation,
1252-
variableValues: context.variableValues
1253-
)
1254-
}

Sources/GraphQL/Subscription/Subscribe.swift

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -193,15 +193,6 @@ func executeSubscription(
193193
)
194194
}
195195

196-
let path = IndexPath.init().appending(fieldNode.name.value)
197-
let info = buildResolveInfo(
198-
context: context,
199-
fieldDef: fieldDef,
200-
fieldASTs: fieldNodes,
201-
parentType: type,
202-
path: path
203-
)
204-
205196
// Implements the "ResolveFieldEventStream" algorithm from GraphQL specification.
206197
// It differs from "ResolveFieldValue" due to providing a different `resolveFn`.
207198

@@ -213,6 +204,22 @@ func executeSubscription(
213204
// is provided to every resolve function within an execution. It is commonly
214205
// used to represent an authenticated user, or request-specific caches.
215206
let contextValue = context.context
207+
208+
// The resolve function's optional fourth argument is a collection of
209+
// information about the current execution state.
210+
let path = IndexPath.init().appending(fieldNode.name.value)
211+
let info = GraphQLResolveInfo.init(
212+
fieldName: fieldDef.name,
213+
fieldASTs: fieldNodes,
214+
returnType: fieldDef.type,
215+
parentType: type,
216+
path: path,
217+
schema: context.schema,
218+
fragments: context.fragments,
219+
rootValue: context.rootValue,
220+
operation: context.operation,
221+
variableValues: context.variableValues
222+
)
216223

217224
// Call the `subscribe()` resolver or the default resolver to produce an
218225
// Observable yielding raw payloads.

0 commit comments

Comments
 (0)