@envelop/graphql-executor
A customizable GraphQL Spec compliant Executor.
GraphQL Executor provides:
- A way to fork the GraphQL.JS executor without introducing multiple versions of graphql-js into your project. graphql-executor is a smart fork of only the execution module of graphql-js. You can safely fork graphql-executor to customize your execution flow as needed.
- A code-only method of customizing the executor by subclassing the exported internal Executor class as above.
- Direct benefits from our own customizations! GraphQL Executor is spec-compliant, but aims to support experimental features (such as @defer/@stream support) and provide other improvements as possible. See (https://github.com/yaacovCR/graphql-executor/releases) to track any new features.
Getting Started
Start by installing the plugin:
yarn add @envelop/graphql-executor
Then, use the plugin with your validation rules:
import { useGraphQLExecutor } from '@envelop/extended-validation';
const getEnveloped = envelop({
plugins: [useGraphQLExecutor({})],
});
To create your custom executor, implement the Executor class from graphql-executor.
For example:
import { Executor } from 'graphql-executor';
import { useGraphQLExecutor } from '@envelop/extended-validation';
class MyCustomExecutor extends Executor {
}
const getEnveloped = envelop({
plugins: [useGraphQLExecutor({ customExecutor: new MyCustomExecutor() })],
});