Skip to Content
GraphQL Tools
DocumentationAPI@graphql-tools/executorsrcfunctionscollectSubfieldsFromContext

Function: collectSubfieldsFromContext()

collectSubfieldsFromContext(exeContext, returnType, fieldNodes): FieldsAndPatches

Defined in: packages/executor/src/execution/execute.ts:197 

Internal

A memoized collection of relevant subfields with regard to the return type. Memoizing ensures the subfields are not repeatedly calculated, which saves overhead when resolving lists of values.

When the document has no variable-conditional @skip / @include / @defer, results are shared across executions for the same document AST.

Parameters

exeContext

ExecutionContext

returnType

GraphQLObjectType

fieldNodes

FieldNode[]

Returns

FieldsAndPatches