@apollo/query-planner
Advanced tools
Comparing version 2.0.0-alpha.5 to 2.0.0-alpha.6
@@ -470,3 +470,4 @@ "use strict"; | ||
variableUsages: this.selection.usedVariables().map(v => v.name), | ||
operation: (0, graphql_1.stripIgnoredCharacters)((0, graphql_1.print)(operation)), | ||
operation: (0, graphql_1.stripIgnoredCharacters)((0, graphql_1.print)((0, federation_internals_1.operationToDocument)(operation))), | ||
operationKind: schemaRootKindToOperationKind(operation.rootKind), | ||
}; | ||
@@ -487,2 +488,9 @@ return this.isTopLevel | ||
} | ||
function schemaRootKindToOperationKind(operation) { | ||
switch (operation) { | ||
case "query": return graphql_1.OperationTypeNode.QUERY; | ||
case "mutation": return graphql_1.OperationTypeNode.MUTATION; | ||
case "subscription": return graphql_1.OperationTypeNode.SUBSCRIPTION; | ||
} | ||
} | ||
function removeInPlace(value, array) { | ||
@@ -1082,3 +1090,3 @@ const idx = array.indexOf(value); | ||
entitiesCall.add(new federation_internals_1.FieldSelection(new federation_internals_1.Field(entities, { 'representations': representationsVariable }, variableDefinitions), selectionSet)); | ||
return (0, federation_internals_1.operationToDocument)(new federation_internals_1.Operation('query', entitiesCall, variableDefinitions).optimize(fragments)); | ||
return new federation_internals_1.Operation('query', entitiesCall, variableDefinitions).optimize(fragments); | ||
} | ||
@@ -1096,5 +1104,4 @@ function flatWrap(kind, nodes) { | ||
function operationForQueryFetch(rootKind, selectionSet, allVariableDefinitions, fragments) { | ||
const operation = new federation_internals_1.Operation(rootKind, selectionSet, allVariableDefinitions.filter(selectionSet.usedVariables())).optimize(fragments); | ||
return (0, federation_internals_1.operationToDocument)(operation); | ||
return new federation_internals_1.Operation(rootKind, selectionSet, allVariableDefinitions.filter(selectionSet.usedVariables())).optimize(fragments); | ||
} | ||
//# sourceMappingURL=buildPlan.js.map |
@@ -1,2 +0,2 @@ | ||
import { SelectionNode as GraphQLJSSelectionNode } from 'graphql'; | ||
import { SelectionNode as GraphQLJSSelectionNode, OperationTypeNode } from 'graphql'; | ||
export declare type ResponsePath = (string | number)[]; | ||
@@ -22,2 +22,3 @@ export interface QueryPlan { | ||
operation: string; | ||
operationKind: OperationTypeNode; | ||
} | ||
@@ -24,0 +25,0 @@ export interface FlattenNode { |
{ | ||
"name": "@apollo/query-planner", | ||
"version": "2.0.0-alpha.5", | ||
"version": "2.0.0-alpha.6", | ||
"description": "Apollo Query Planner", | ||
@@ -28,4 +28,4 @@ "author": "Apollo <packages@apollographql.com>", | ||
"dependencies": { | ||
"@apollo/federation-internals": "^2.0.0-alpha.5", | ||
"@apollo/query-graphs": "^2.0.0-alpha.5", | ||
"@apollo/federation-internals": "^2.0.0-alpha.6", | ||
"@apollo/query-graphs": "^2.0.0-alpha.6", | ||
"chalk": "^4.1.0", | ||
@@ -38,3 +38,3 @@ "deep-equal": "^2.0.5", | ||
}, | ||
"gitHead": "efb50aa3d3742d2fed8c841569651b2b7b729f2f" | ||
"gitHead": "ee84b3fd9df161c3a94ae3d70e82a14dba5794ba" | ||
} |
import { | ||
Kind, | ||
SelectionNode as GraphQLJSSelectionNode, | ||
OperationTypeNode, | ||
} from 'graphql'; | ||
@@ -33,2 +34,3 @@ import prettyFormat from 'pretty-format'; | ||
operation: string; | ||
operationKind: OperationTypeNode; | ||
} | ||
@@ -35,0 +37,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
412117
5081