Skip to content

Commit 6ca3878

Browse files
committed
refactor: executor methods into Executor class
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.
1 parent e1eaea5 commit 6ca3878

File tree

5 files changed

+936
-860
lines changed

5 files changed

+936
-860
lines changed

src/execution/__tests__/subscribe-test.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import { GraphQLInt, GraphQLString, GraphQLBoolean } from '../../type/scalars';
1414

1515
import { GraphQLAggregateError } from '../../error/GraphQLAggregateError';
1616

17-
import { buildExecutionContext, createSourceEventStream } from '../execute';
17+
import { Executor } from '../execute';
1818
import { subscribe } from '../subscribe';
1919

2020
import { SimplePubSub } from './simplePubSub';
@@ -410,8 +410,11 @@ describe('Subscription Initialization Phase', () => {
410410
const document = parse('subscription { foo }');
411411
const result = await subscribe({ schema, document });
412412

413-
const exeContext = buildExecutionContext({ schema, document });
414-
expect(await createSourceEventStream(exeContext)).to.deep.equal(result);
413+
const executor = new Executor();
414+
const exeContext = executor.buildExecutionContext({ schema, document });
415+
expect(await executor.createSourceEventStream(exeContext)).to.deep.equal(
416+
result,
417+
);
415418
return result;
416419
}
417420

0 commit comments

Comments
 (0)