Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve grammar in execution error messages #3068

Merged
merged 1 commit into from May 10, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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