Skip to content

Commit

Permalink
Merge branch 'main' into beta
Browse files Browse the repository at this point in the history
  • Loading branch information
schettn committed Jul 9, 2024
2 parents 9d40a90 + 72e1eed commit a42869e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packages/pylon/src/define-pylon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -269,9 +269,6 @@ const resolversToGraphQLResolvers = <Q, M>(
asyncContext.enterWith(configuredCtx)
}

// Get the path and field metadata for the current query.
const path = info.path

// get query or mutation field

const isQuery = info.operation.operation === 'query'
Expand All @@ -286,7 +283,7 @@ const resolversToGraphQLResolvers = <Q, M>(
? info.schema.getQueryType()
: info.schema.getMutationType()

const field = type?.getFields()[path.key]
const field = type?.getFields()[info.fieldName]

// Get the list of arguments expected by the current query field.
const fieldArguments = field?.args || []
Expand All @@ -312,7 +309,10 @@ const resolversToGraphQLResolvers = <Q, M>(

// Find the selection set for the current field.
for (const selection of info.operation.selectionSet.selections) {
if (selection.kind === 'Field' && selection.name.value === path.key) {
if (
selection.kind === 'Field' &&
selection.name.value === info.fieldName
) {
baseSelectionSet = selection.selectionSet?.selections || []
}
}
Expand Down

0 comments on commit a42869e

Please sign in to comment.