diff --git a/src/execution/__tests__/subscribe-test.ts b/src/execution/__tests__/subscribe-test.ts index 649646f208..0360267faa 100644 --- a/src/execution/__tests__/subscribe-test.ts +++ b/src/execution/__tests__/subscribe-test.ts @@ -24,7 +24,7 @@ import type { ExecutionArgs } from '../execute.js'; import { createSourceEventStream, executeSubscriptionEvent, - experimentalSubscribeIncrementally, + legacyExperimentalSubscribeIncrementally, subscribe, } from '../execute.js'; import type { ExecutionResult } from '../types.js'; @@ -154,7 +154,7 @@ function createSubscription( }; const subscribeFn = useExperimentalSubscribeIncrementally - ? experimentalSubscribeIncrementally + ? legacyExperimentalSubscribeIncrementally : subscribe; return subscribeFn({ @@ -816,7 +816,7 @@ describe('Subscription Publish Phase', () => { }); }); - it('experimentalSubscribeIncrementally function works with @defer', async () => { + it('legacyExperimentalSubscribeIncrementally function works with @defer', async () => { const pubsub = new SimplePubSub(); const subscription = await createSubscription( pubsub, @@ -1002,7 +1002,7 @@ describe('Subscription Publish Phase', () => { }); }); - it('experimentalSubscribeIncrementally function works with @stream', async () => { + it('legacyExperimentalSubscribeIncrementally function works with @stream', async () => { const pubsub = new SimplePubSub(); const subscription = await createSubscription( pubsub, diff --git a/src/execution/execute.ts b/src/execution/execute.ts index 8c30d5587b..03012756f2 100644 --- a/src/execution/execute.ts +++ b/src/execution/execute.ts @@ -2113,7 +2113,7 @@ export function subscribe( ): PromiseOrValue< AsyncGenerator | ExecutionResult > { - const resultOrStream = experimentalSubscribeIncrementally(args, false); + const resultOrStream = legacyExperimentalSubscribeIncrementally(args, false); if (isPromise(resultOrStream)) { return resultOrStream.then(handleMaybeResponseStream); @@ -2144,7 +2144,7 @@ function handleMaybeResponseStream( }); } -export function experimentalSubscribeIncrementally( +export function legacyExperimentalSubscribeIncrementally( args: ExecutionArgs, allowIncrementalSubscriptions = true, ): PromiseOrValue< diff --git a/src/execution/index.ts b/src/execution/index.ts index fe9764c64f..c07c330b47 100644 --- a/src/execution/index.ts +++ b/src/execution/index.ts @@ -11,6 +11,7 @@ export { defaultFieldResolver, defaultTypeResolver, subscribe, + legacyExperimentalSubscribeIncrementally, } from './execute.js'; export type { ExecutionArgs, ValidatedExecutionArgs } from './execute.js'; diff --git a/src/index.ts b/src/index.ts index 10f6d02ca7..784506fbf6 100644 --- a/src/index.ts +++ b/src/index.ts @@ -344,6 +344,7 @@ export { getVariableValues, getDirectiveValues, subscribe, + legacyExperimentalSubscribeIncrementally, createSourceEventStream, } from './execution/index.js';