Skip to content

Commit

Permalink
Follow up to #883
Browse files Browse the repository at this point in the history
  • Loading branch information
leebyron committed May 26, 2017
1 parent 508aa3a commit fda2afd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 20 deletions.
4 changes: 2 additions & 2 deletions src/execution/__tests__/executor-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -637,7 +637,7 @@ describe('Execute: Handles basic execution tasks', () => {
});
});

it('throws if no op name is provided with multiple operations', async () => {
it('errors if no op name is provided with multiple operations', async () => {
const doc = 'query Example { a } query OtherExample { a }';
const data = { a: 'b' };
const ast = parse(doc);
Expand All @@ -663,7 +663,7 @@ describe('Execute: Handles basic execution tasks', () => {
});
});

it('throws if unknown operation name is provided', async () => {
it('errors if unknown operation name is provided', async () => {
const doc = 'query Example { a } query OtherExample { a }';
const ast = parse(doc);
const schema = new GraphQLSchema({
Expand Down
19 changes: 1 addition & 18 deletions src/execution/execute.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,7 @@ export function execute(
/* eslint-enable no-param-reassign, no-redeclare */
}

// If a valid context cannot be created due to incorrect arguments,
// this will throw an error.
// If arguments are missing or incorrect, throw an error.
assertValidExecutionArguments(
schema,
document,
Expand Down Expand Up @@ -259,22 +258,6 @@ export function buildExecutionContext(
operationName: ?string,
fieldResolver: ?GraphQLFieldResolver<any, any>
): ExecutionContext {
invariant(schema, 'Must provide schema');
invariant(document, 'Must provide document');
invariant(
schema instanceof GraphQLSchema,
'Schema must be an instance of GraphQLSchema. Also ensure that there are ' +
'not multiple versions of GraphQL installed in your node_modules directory.'
);

// Variables, if provided, must be an object.
invariant(
!rawVariableValues || typeof rawVariableValues === 'object',
'Variables must be provided as an Object where each property is a ' +
'variable value. Perhaps look to see if an unparsed JSON string ' +
'was provided.'
);

const errors: Array<GraphQLError> = [];
let operation: ?OperationDefinitionNode;
const fragments: {[name: string]: FragmentDefinitionNode} =
Expand Down

2 comments on commit fda2afd

@wincent
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@leebyron: Legit-looking Travis failures on this commit (eg. https://travis-ci.org/graphql/graphql-js/jobs/236253163).

@leebyron
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed. Thanks. I'll clean this up

Please sign in to comment.