Skip to content

Commit 8784d8c

Browse files
committed
Corrects argument order in validationError.
1 parent be5244f commit 8784d8c

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/error/syntaxError.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,9 @@ export function syntaxError(
5858
* returns an error containing the message, without context.
5959
*/
6060
export function validationError(
61-
message: string,
61+
source: ?Source,
6262
node: ASTNode,
63-
source: ?Source
63+
message: string,
6464
): GraphQLError {
6565
const position = node.loc ? node.loc.start : null;
6666
if (position == null || source == null) {

src/utilities/buildASTSchema.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -305,28 +305,28 @@ export function buildASTSchema(
305305
function produceInputType(typeNode: TypeNode): GraphQLInputType {
306306
const type = produceType(typeNode);
307307
invariant(isInputType(type),
308-
validationError('Expected Input type', typeNode, source));
308+
validationError(source, typeNode, 'Expected Input type'));
309309
return (type: any);
310310
}
311311

312312
function produceOutputType(typeNode: TypeNode): GraphQLOutputType {
313313
const type = produceType(typeNode);
314314
invariant(isOutputType(type),
315-
validationError('Expected Output type', typeNode, source));
315+
validationError(source, typeNode, 'Expected Output type'));
316316
return (type: any);
317317
}
318318

319319
function produceObjectType(typeNode: TypeNode): GraphQLObjectType {
320320
const type = produceType(typeNode);
321321
invariant(type instanceof GraphQLObjectType,
322-
validationError('Expected Object type', typeNode, source));
322+
validationError(source, typeNode, 'Expected Object type'));
323323
return type;
324324
}
325325

326326
function produceInterfaceType(typeNode: TypeNode): GraphQLInterfaceType {
327327
const type = produceType(typeNode);
328328
invariant(type instanceof GraphQLInterfaceType,
329-
validationError('Expected Interface type', typeNode, source));
329+
validationError(source, typeNode, 'Expected Interface type'));
330330
return type;
331331
}
332332

0 commit comments

Comments
 (0)