Attaches VariablesLoggingMiddleware ONLY to root Query, Mutation, and Subscription
fields on the compiled GraphQLSchema instead of registering it via TypeGraphQL globalMiddlewares.
Registering a global middleware in TypeGraphQL wraps every scalar and child field resolver across
all 300+ @ObjectType entities in an async middleware chain, allocating $O(\text{Rows} \times \text{Fields})$
Promises per query even when logVariables is false or info.path.prev !== undefined.
Wrapping only the root operation fields reduces middleware invocations from ~15,000 per 500-row
RunView response down to 1.
Attaches VariablesLoggingMiddleware ONLY to root
Query,Mutation, andSubscriptionfields on the compiled GraphQLSchema instead of registering it via TypeGraphQLglobalMiddlewares.Registering a global middleware in TypeGraphQL wraps every scalar and child field resolver across all 300+
@ObjectTypeentities in an async middleware chain, allocating $O(\text{Rows} \times \text{Fields})$ Promises per query even whenlogVariablesis false orinfo.path.prev !== undefined. Wrapping only the root operation fields reduces middleware invocations from ~15,000 per 500-rowRunViewresponse down to 1.