Skip to content

Commit ef84970

Browse files
committed
Merge pull request #10 from RStankov/fix-double-resolve
Don't resolve when invalid
2 parents 432b356 + 239b634 commit ef84970

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

src/graphql.js

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,15 @@ export function graphql(
3939
var validationResult = validateDocument(schema, ast);
4040
if (!validationResult.isValid) {
4141
resolve({ errors: validationResult.errors });
42+
} else {
43+
resolve(execute(
44+
schema,
45+
rootObject,
46+
ast,
47+
operationName,
48+
variableValues
49+
));
4250
}
43-
resolve(execute(
44-
schema,
45-
rootObject,
46-
ast,
47-
operationName,
48-
variableValues
49-
));
5051
}).catch(error => {
5152
return { errors: [ formatError(error) ] };
5253
});

0 commit comments

Comments
 (0)