@coralproject/graphql-anywhere-optimized
Advanced tools
Comparing version 0.1.3 to 0.1.4
import { DocumentNode } from 'graphql'; | ||
import { DirectiveInfo } from './directives'; | ||
export declare type Resolver = (fieldName: string, rootValue: any, args: any, context: any, info: ExecInfo) => any; | ||
import { TransformDocumentOptions } from 'graphql-ast-tools'; | ||
export declare type VariableMap = { | ||
@@ -27,2 +28,2 @@ [name: string]: any; | ||
}; | ||
export declare function graphql(resolver: Resolver, document: DocumentNode, rootValue?: any, contextValue?: any, variableValues?: VariableMap, execOptions?: ExecOptions): any; | ||
export declare function graphql(resolver: Resolver, document: DocumentNode, rootValue?: any, contextValue?: any, variableValues?: VariableMap, execOptions?: ExecOptions, transformOptions?: TransformDocumentOptions): any; |
@@ -15,4 +15,5 @@ "use strict"; | ||
var graphql_ast_tools_1 = require("graphql-ast-tools"); | ||
function graphql(resolver, document, rootValue, contextValue, variableValues, execOptions) { | ||
function graphql(resolver, document, rootValue, contextValue, variableValues, execOptions, transformOptions) { | ||
if (execOptions === void 0) { execOptions = {}; } | ||
if (transformOptions === void 0) { transformOptions = {}; } | ||
var resultMapper = execOptions.resultMapper; | ||
@@ -27,5 +28,3 @@ var fragmentMatcher = execOptions.fragmentMatcher || (function () { return true; }); | ||
}; | ||
var resolved = graphql_ast_tools_1.transformDocument(document, { | ||
variables: variableValues || {}, | ||
}); | ||
var resolved = graphql_ast_tools_1.transformDocument(document, __assign({}, transformOptions, { variables: variableValues || {} })); | ||
var mainDefinition = getFromAST_1.getMainDefinition(resolved); | ||
@@ -32,0 +31,0 @@ return executeSelectionSet(mainDefinition.selectionSet, rootValue, execContext); |
{ | ||
"name": "@coralproject/graphql-anywhere-optimized", | ||
"version": "0.1.3", | ||
"version": "0.1.4", | ||
"description": "Fork of graphql-anywhere with custom optimizations", | ||
@@ -62,4 +62,4 @@ "main": "./lib/src/index.js", | ||
"dependencies": { | ||
"graphql-ast-tools": "^0.1.6" | ||
"graphql-ast-tools": "^0.2.1" | ||
} | ||
} |
@@ -38,2 +38,3 @@ import { | ||
import { | ||
TransformDocumentOptions, | ||
transformDocument, | ||
@@ -83,2 +84,3 @@ mergeSelectionSets, | ||
execOptions: ExecOptions = {}, | ||
transformOptions: TransformDocumentOptions = {}, | ||
) { | ||
@@ -100,2 +102,3 @@ const resultMapper = execOptions.resultMapper; | ||
const resolved = transformDocument(document, { | ||
...transformOptions, | ||
variables: variableValues || {}, | ||
@@ -102,0 +105,0 @@ }); |
Sorry, the diff of this file is not supported yet
71355
1034
+ Addedgraphql-ast-tools@0.2.3(transitive)
- Removedgraphql-ast-tools@0.1.6(transitive)
Updatedgraphql-ast-tools@^0.2.1