Skip to content

Commit

Permalink
Improve grammar in execution error messages (#3068)
Browse files Browse the repository at this point in the history
  • Loading branch information
Cito committed May 10, 2021
1 parent bd5583c commit 3cfb2be
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/execution/__tests__/abstract-test.js
Expand Up @@ -557,11 +557,11 @@ describe('Execute: Handles execution of abstract types', () => {
);

expectError({ forTypeName: 'Human' }).toEqual(
'Abstract type "Pet" was resolve to a type "Human" that does not exist inside schema.',
'Abstract type "Pet" was resolved to a type "Human" that does not exist inside the schema.',
);

expectError({ forTypeName: 'String' }).toEqual(
'Abstract type "Pet" was resolve to a non-object type "String".',
'Abstract type "Pet" was resolved to a non-object type "String".',
);

expectError({ forTypeName: '__Schema' }).toEqual(
Expand Down
4 changes: 2 additions & 2 deletions src/execution/execute.js
Expand Up @@ -984,14 +984,14 @@ function ensureValidRuntimeType(
const runtimeType = exeContext.schema.getType(runtimeTypeName);
if (runtimeType == null) {
throw new GraphQLError(
`Abstract type "${returnType.name}" was resolve to a type "${runtimeTypeName}" that does not exist inside schema.`,
`Abstract type "${returnType.name}" was resolved to a type "${runtimeTypeName}" that does not exist inside the schema.`,
fieldNodes,
);
}

if (!isObjectType(runtimeType)) {
throw new GraphQLError(
`Abstract type "${returnType.name}" was resolve to a non-object type "${runtimeTypeName}".`,
`Abstract type "${returnType.name}" was resolved to a non-object type "${runtimeTypeName}".`,
fieldNodes,
);
}
Expand Down

0 comments on commit 3cfb2be

Please sign in to comment.