Skip to content

Commit

Permalink
Tweak the name of the config used to enable @defer in the QP
Browse files Browse the repository at this point in the history
  • Loading branch information
Sylvain Lebresne committed Aug 25, 2022
1 parent d0091e0 commit ff3e395
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion query-planner-js/src/__tests__/buildPlan.defer.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { QueryPlanner } from '@apollo/query-planner';
import { composeAndCreatePlanner, composeAndCreatePlannerWithOptions } from "./buildPlan.test";

function composeAndCreatePlannerWithDefer(...services: ServiceDefinition[]): [Schema, QueryPlanner] {
return composeAndCreatePlannerWithOptions(services, { deferStreamSupport: { enableDefer : true }});
return composeAndCreatePlannerWithOptions(services, { incrementalDelivery: { enableDefer : true }});
}

describe('handles simple @defer', () => {
Expand Down
2 changes: 1 addition & 1 deletion query-planner-js/src/buildPlan.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1911,7 +1911,7 @@ export function computeQueryPlan({
let assignedDeferLabels: Set<string> | undefined = undefined;
let hasDefers: boolean = false;
let deferConditions: SetMultiMap<string, string> | undefined = undefined;
if (config.deferStreamSupport.enableDefer) {
if (config.incrementalDelivery.enableDefer) {
({ operation, hasDefers, assignedDeferLabels, deferConditions } = operation.withNormalizedDefer());
} else {
// If defer is not enabled, we remove all @defer from the query. This feels cleaner do this once here than
Expand Down
4 changes: 2 additions & 2 deletions query-planner-js/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export type QueryPlannerConfig = {
// new `passthroughSubgraphs` option that is the list of subgraph to which we can pass-through some @defer
// (and it would be empty by default). Similarly, once we support @stream, grouping the options here will
// make sense too.
deferStreamSupport?: {
incrementalDelivery?: {
/**
* Enables @defer support by the query planner.
*
Expand All @@ -41,7 +41,7 @@ export function enforceQueryPlannerConfigDefaults(
return {
exposeDocumentNodeInFetchNode: true,
reuseQueryFragments: true,
deferStreamSupport: {
incrementalDelivery: {
enableDefer: false,
},
...config,
Expand Down

0 comments on commit ff3e395

Please sign in to comment.