class CSRFMiddleware implements QueryMiddleware (View source)

Adds functionality that checks a request for a token before allowing a mutation to happen. Protects against CSRF attacks

Methods

ExecutionResult|array
process(Schema $schema, string $query, array $context, array $vars, callable $next)

No description

Details

ExecutionResult|array process(Schema $schema, string $query, array $context, array $vars, callable $next)

Parameters

Schema $schema
string $query
array $context
array $vars
callable $next

Return Value

ExecutionResult|array

Result either as an ExecutionResult object or raw array