Skip to content

Commit

Permalink
rename to legacyExperimentalSubscribeIncrementally
Browse files Browse the repository at this point in the history
and actually export
  • Loading branch information
yaacovCR committed Dec 19, 2024
1 parent c755cad commit 8e7c261
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/execution/__tests__/subscribe-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -154,7 +154,7 @@ function createSubscription(
};

const subscribeFn = useExperimentalSubscribeIncrementally
? experimentalSubscribeIncrementally
? legacyExperimentalSubscribeIncrementally
: subscribe;

return subscribeFn({
Expand Down Expand Up @@ -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<Email>();
const subscription = await createSubscription(
pubsub,
Expand Down Expand Up @@ -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<Email>();
const subscription = await createSubscription(
pubsub,
Expand Down
4 changes: 2 additions & 2 deletions src/execution/execute.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2113,7 +2113,7 @@ export function subscribe(
): PromiseOrValue<
AsyncGenerator<ExecutionResult, void, void> | ExecutionResult
> {
const resultOrStream = experimentalSubscribeIncrementally(args, false);
const resultOrStream = legacyExperimentalSubscribeIncrementally(args, false);

if (isPromise(resultOrStream)) {
return resultOrStream.then(handleMaybeResponseStream);
Expand Down Expand Up @@ -2144,7 +2144,7 @@ function handleMaybeResponseStream(
});
}

export function experimentalSubscribeIncrementally(
export function legacyExperimentalSubscribeIncrementally(
args: ExecutionArgs,
allowIncrementalSubscriptions = true,
): PromiseOrValue<
Expand Down
1 change: 1 addition & 0 deletions src/execution/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export {
defaultFieldResolver,
defaultTypeResolver,
subscribe,
legacyExperimentalSubscribeIncrementally,
} from './execute.js';

export type { ExecutionArgs, ValidatedExecutionArgs } from './execute.js';
Expand Down
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,7 @@ export {
getVariableValues,
getDirectiveValues,
subscribe,
legacyExperimentalSubscribeIncrementally,
createSourceEventStream,
} from './execution/index.js';

Expand Down

0 comments on commit 8e7c261

Please sign in to comment.