Skip to content

Commit

Permalink
feat: pass graphql variables in request check
Browse files Browse the repository at this point in the history
  • Loading branch information
georgeciubotaru committed Sep 17, 2024
1 parent bd477e0 commit 4a2f11a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion graphql/graphql-server/src/check.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {Model} from '@subsquid/openreader/lib/model'
import {assertNotNull} from '@subsquid/util-internal'
import {PluginDefinition} from 'apollo-server-core'
import {PluginDefinition, VariableValues} from 'apollo-server-core'
import {GraphQLSchema, OperationDefinitionNode} from 'graphql'


Expand All @@ -23,6 +23,7 @@ export interface RequestCheckContext {
http: HttpRequest
operation: OperationDefinitionNode
operationName: string | null
variables?: VariableValues
schema: GraphQLSchema
context: Record<string, any>
model: Model
Expand All @@ -43,6 +44,7 @@ export function createCheckPlugin(requestCheck: RequestCheckFunction, model: Mod
http: assertNotNull(ctx.request.http),
operation: ctx.operation,
operationName: ctx.operationName,
variables: ctx.request.variables,
schema: ctx.schema,
context: ctx.context,
model
Expand Down

0 comments on commit 4a2f11a

Please sign in to comment.