From 017cf38bc14760fdf8c74f7697386362261a237d Mon Sep 17 00:00:00 2001 From: Yaacov Rydzinski Date: Fri, 8 Oct 2021 00:07:48 +0300 Subject: [PATCH] Export internal Executor class for experimentation This class, similar to the Parser class, is exported only to assist people in implementing their own executors without duplicating too much code and should be used only as last resort for cases such as experimental syntax or if certain features could not be contributed upstream. It is still part of the internal API and is versioned, so any changes to it are never considered breaking changes. If you still need to support multiple versions of the library, please use the `versionInfo` variable for version detection. --- src/execution/executor.ts | 10 ++++++++++ src/execution/index.ts | 2 ++ src/index.ts | 1 + 3 files changed, 13 insertions(+) diff --git a/src/execution/executor.ts b/src/execution/executor.ts index 423ea99a4c..d5b24ac2aa 100644 --- a/src/execution/executor.ts +++ b/src/execution/executor.ts @@ -138,6 +138,16 @@ export interface ExecutionArgs { } /** + * Executor class responsible for implementing the Execution section of the GraphQL spec. + * + * This class is exported only to assist people in implementing their own executors + * without duplicating too much code and should be used only as last resort for cases + * such as experimental syntax or if certain features could not be contributed upstream. + * + * It is still part of the internal API and is versioned, so any changes to it are never + * considered breaking changes. If you still need to support multiple versions of the + * library, please use the `versionInfo` variable for version detection. + * * @internal */ export class Executor { diff --git a/src/execution/index.ts b/src/execution/index.ts index f2e4f044a8..2eafad451b 100644 --- a/src/execution/index.ts +++ b/src/execution/index.ts @@ -8,6 +8,8 @@ export type { FormattedExecutionResult, } from './executor'; +export { Executor } from './executor'; + export { execute, executeSync } from './execute'; export { subscribe, createSourceEventStream } from './subscribe'; diff --git a/src/index.ts b/src/index.ts index 87e8fe295b..7f825c2096 100644 --- a/src/index.ts +++ b/src/index.ts @@ -306,6 +306,7 @@ export type { /** Execute GraphQL queries. */ export { + Executor, execute, executeSync, defaultFieldResolver,