Skip to content

Commit

Permalink
Merge pull request #10 from RStankov/fix-double-resolve
Browse files Browse the repository at this point in the history
Don't resolve when invalid
  • Loading branch information
leebyron committed Jul 2, 2015
2 parents 432b356 + 239b634 commit ef84970
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/graphql.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,15 @@ export function graphql(
var validationResult = validateDocument(schema, ast);
if (!validationResult.isValid) {
resolve({ errors: validationResult.errors });
} else {
resolve(execute(
schema,
rootObject,
ast,
operationName,
variableValues
));
}
resolve(execute(
schema,
rootObject,
ast,
operationName,
variableValues
));
}).catch(error => {
return { errors: [ formatError(error) ] };
});
Expand Down

0 comments on commit ef84970

Please sign in to comment.