Skip to content

Commit

Permalink
Accept normal object as 'variableValues' arg of 'graphql' function (#…
Browse files Browse the repository at this point in the history
…1937)

Synchronise it with same argument of 'execute'
https://github.com/graphql/graphql-js/blob/master/src/execution/execute.js#L102
Plus in most cases result of `JSON.parse` is passed, which is normal
object.
  • Loading branch information
IvanGoncharov committed Jun 1, 2019
1 parent 1512eeb commit 8d403ca
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/graphql.js
Expand Up @@ -12,7 +12,6 @@ import { validateSchema } from './type/validate';
import { parse } from './language/parser';
import { validate } from './validation/validate';
import { type ExecutionResult, execute } from './execution/execute';
import { type ObjMap } from './jsutils/ObjMap';
import { type Source } from './language/source';
import {
type GraphQLFieldResolver,
Expand Down Expand Up @@ -65,7 +64,7 @@ export type GraphQLArgs = {|
source: string | Source,
rootValue?: mixed,
contextValue?: mixed,
variableValues?: ?ObjMap<mixed>,
variableValues?: ?{ [variable: string]: mixed },
operationName?: ?string,
fieldResolver?: ?GraphQLFieldResolver<any, any>,
typeResolver?: ?GraphQLTypeResolver<any, any>,
Expand All @@ -77,7 +76,7 @@ declare function graphql(
source: Source | string,
rootValue?: mixed,
contextValue?: mixed,
variableValues?: ?ObjMap<mixed>,
variableValues?: ?{ [variable: string]: mixed },
operationName?: ?string,
fieldResolver?: ?GraphQLFieldResolver<any, any>,
typeResolver?: ?GraphQLTypeResolver<any, any>,
Expand Down Expand Up @@ -135,7 +134,7 @@ declare function graphqlSync(
source: Source | string,
rootValue?: mixed,
contextValue?: mixed,
variableValues?: ?ObjMap<mixed>,
variableValues?: ?{ [variable: string]: mixed },
operationName?: ?string,
fieldResolver?: ?GraphQLFieldResolver<any, any>,
typeResolver?: ?GraphQLTypeResolver<any, any>,
Expand Down

0 comments on commit 8d403ca

Please sign in to comment.