Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mark user-provided 'variableValues' as read-only #2002

Merged
merged 1 commit into from Jun 28, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/execution/execute.js
Expand Up @@ -116,7 +116,7 @@ export type ExecutionArgs = {|
document: DocumentNode,
rootValue?: mixed,
contextValue?: mixed,
variableValues?: ?{ [variable: string]: mixed, ... },
variableValues?: ?{ +[variable: string]: mixed, ... },
operationName?: ?string,
fieldResolver?: ?GraphQLFieldResolver<any, any>,
typeResolver?: ?GraphQLTypeResolver<any, any>,
Expand Down Expand Up @@ -144,7 +144,7 @@ declare function execute(
document: DocumentNode,
rootValue?: mixed,
contextValue?: mixed,
variableValues?: ?{ [variable: string]: mixed, ... },
variableValues?: ?{ +[variable: string]: mixed, ... },
operationName?: ?string,
fieldResolver?: ?GraphQLFieldResolver<any, any>,
typeResolver?: ?GraphQLTypeResolver<any, any>,
Expand Down Expand Up @@ -266,7 +266,7 @@ export function addPath(prev: ResponsePath | void, key: string | number) {
export function assertValidExecutionArguments(
schema: GraphQLSchema,
document: DocumentNode,
rawVariableValues: ?ObjMap<mixed>,
rawVariableValues: ?{ +[variable: string]: mixed, ... },
): void {
invariant(document, 'Must provide document');

Expand All @@ -291,7 +291,7 @@ export function buildExecutionContext(
document: DocumentNode,
rootValue: mixed,
contextValue: mixed,
rawVariableValues: ?ObjMap<mixed>,
rawVariableValues: ?{ +[variable: string]: mixed, ... },
operationName: ?string,
fieldResolver: ?GraphQLFieldResolver<any, any>,
typeResolver?: ?GraphQLTypeResolver<any, any>,
Expand Down
2 changes: 1 addition & 1 deletion src/execution/values.js
Expand Up @@ -41,7 +41,7 @@ type CoercedVariableValues = {|
export function getVariableValues(
schema: GraphQLSchema,
varDefNodes: $ReadOnlyArray<VariableDefinitionNode>,
inputs: ObjMap<mixed>,
inputs: { +[variable: string]: mixed, ... },
): CoercedVariableValues {
const errors = [];
const coercedValues = {};
Expand Down
6 changes: 3 additions & 3 deletions src/graphql.js
Expand Up @@ -57,7 +57,7 @@ export type GraphQLArgs = {|
source: string | Source,
rootValue?: mixed,
contextValue?: mixed,
variableValues?: ?{ [variable: string]: mixed, ... },
variableValues?: ?{ +[variable: string]: mixed, ... },
operationName?: ?string,
fieldResolver?: ?GraphQLFieldResolver<any, any>,
typeResolver?: ?GraphQLTypeResolver<any, any>,
Expand All @@ -69,7 +69,7 @@ declare function graphql(
source: Source | string,
rootValue?: mixed,
contextValue?: mixed,
variableValues?: ?{ [variable: string]: mixed, ... },
variableValues?: ?{ +[variable: string]: mixed, ... },
operationName?: ?string,
fieldResolver?: ?GraphQLFieldResolver<any, any>,
typeResolver?: ?GraphQLTypeResolver<any, any>,
Expand Down Expand Up @@ -118,7 +118,7 @@ declare function graphqlSync(
source: Source | string,
rootValue?: mixed,
contextValue?: mixed,
variableValues?: ?{ [variable: string]: mixed, ... },
variableValues?: ?{ +[variable: string]: mixed, ... },
operationName?: ?string,
fieldResolver?: ?GraphQLFieldResolver<any, any>,
typeResolver?: ?GraphQLTypeResolver<any, any>,
Expand Down
6 changes: 3 additions & 3 deletions src/subscription/subscribe.js
Expand Up @@ -28,7 +28,7 @@ export type SubscriptionArgs = {|
document: DocumentNode,
rootValue?: mixed,
contextValue?: mixed,
variableValues?: ?{ [variable: string]: mixed, ... },
variableValues?: ?{ +[variable: string]: mixed, ... },
operationName?: ?string,
fieldResolver?: ?GraphQLFieldResolver<any, any>,
subscribeFieldResolver?: ?GraphQLFieldResolver<any, any>,
Expand Down Expand Up @@ -64,7 +64,7 @@ declare function subscribe(
document: DocumentNode,
rootValue?: mixed,
contextValue?: mixed,
variableValues?: ?{ [variable: string]: mixed, ... },
variableValues?: ?{ +[variable: string]: mixed, ... },
operationName?: ?string,
fieldResolver?: ?GraphQLFieldResolver<any, any>,
subscribeFieldResolver?: ?GraphQLFieldResolver<any, any>,
Expand Down Expand Up @@ -187,7 +187,7 @@ export function createSourceEventStream(
document: DocumentNode,
rootValue?: mixed,
contextValue?: mixed,
variableValues?: ?{ [variable: string]: mixed, ... },
variableValues?: ?{ +[variable: string]: mixed, ... },
operationName?: ?string,
fieldResolver?: ?GraphQLFieldResolver<any, any>,
): Promise<AsyncIterable<mixed> | ExecutionResult> {
Expand Down