Documentation ¶
Overview ¶
Package graphql is the GraphQL instrumentation API and contract for AppSec defining an abstract run-time representation of AppSec middleware. GraphQL integrations must use this package to enable AppSec features for GraphQL, which listens to this package's operation events.
Package graphql is the GraphQL instrumentation API and contract for AppSec defining an abstract run-time representation of AppSec middleware. GraphQL integrations must use this package to enable AppSec features for GraphQL, which listens to this package's operation events.
Index ¶
- func FromContext[T dyngo.Operation](ctx context.Context) T
- func StartExecutionOperation(ctx context.Context, parent *types.RequestOperation, span trace.TagSetter, ...) (context.Context, *types.ExecutionOperation)
- func StartRequestOperation(ctx context.Context, parent dyngo.Operation, span trace.TagSetter, ...) (context.Context, *types.RequestOperation)
- func StartResolveOperation(ctx context.Context, parent *types.ExecutionOperation, span trace.TagSetter, ...) (context.Context, *types.ResolveOperation)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FromContext ¶
FromContext returns the operation of the given type from the context. Returns the zero-value of T if no such operation is found.
func StartExecutionOperation ¶
func StartExecutionOperation(ctx context.Context, parent *types.RequestOperation, span trace.TagSetter, args types.ExecutionOperationArgs) (context.Context, *types.ExecutionOperation)
StartExecutionOperation starts a new GraphQL query operation, along with the given arguments, and emits a start event up in the operation stack. The operation is tracked on the returned context, and can be extracted later on using FromContext.
func StartRequestOperation ¶
func StartRequestOperation(ctx context.Context, parent dyngo.Operation, span trace.TagSetter, args types.RequestOperationArgs) (context.Context, *types.RequestOperation)
StartRequestOperation starts a new GraphQL request operation, along with the given arguments, and emits a start event up in the operation stack. The operation is usually linked to tge global root operation. The operation is tracked on the returned context, and can be extracted later on using FromContext.
func StartResolveOperation ¶
func StartResolveOperation(ctx context.Context, parent *types.ExecutionOperation, span trace.TagSetter, args types.ResolveOperationArgs) (context.Context, *types.ResolveOperation)
StartResolveOperation starts a new GraphQL Resolve operation, along with the given arguments, and emits a start event up in the operation stack. The operation is tracked on the returned context, and can be extracted later on using FromContext.
Types ¶
This section is empty.