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

fix(typo): Replace "occured" with "occurred" #8831

Merged
merged 1 commit into from
Sep 25, 2023
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions docs/pages/docs/graphql/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -449,9 +449,9 @@ The following error codes can be returned from the Keystone GraphQL API.
- `KS_LIMITS_EXCEEDED`: The user has exceeded some query limits. E.g, a `take` input [that is too high](../config/lists#graphql).
- `KS_EXTENSION_ERROR`: An error was thrown while excuting a system extension function, such as a hook or an access control function.
- `KS_ACCESS_RETURN_ERROR`: An invalid value was returned from an access control function.
- `KS_RESOLVER_ERROR`: An error occured while resolving the input for a field.
- `KS_RELATIONSHIP_ERROR`: An error occured while resolving the input relationship field.
- `KS_PRISMA_ERROR`: An error occured while running a Prisma client operation.
- `KS_RESOLVER_ERROR`: An error occurred while resolving the input for a field.
- `KS_RELATIONSHIP_ERROR`: An error occurred while resolving the input relationship field.
- `KS_PRISMA_ERROR`: An error occurred while running a Prisma client operation.

> A note on `KS_ACCESS_DENIED`: Returning a "not found" error from a mutation like `updateUser({ where: { secretKey: 'abc' } })` but an "access denied" error from `updateUser({ where: { secretKey: 'def' } })` would reveal the existence of a user with the secret key "def". To prevent leaking private information in this way, Keystone will always say "access denied" when you try to perform a mutation on an item that can't be operated on, whether that is because there is no matching record in the database, or there was but the user performing the operation doesn't have access to it.

Expand Down
6 changes: 3 additions & 3 deletions packages/core/src/lib/core/graphql-errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export const validationFailureError = (messages: string[]) => {

export const extensionError = (extension: string, things: { error: Error; tag: string }[]) => {
const s = things.map(t => ` - ${t.tag}: ${t.error.message}`).join('\n');
return new GraphQLError(`An error occured while running "${extension}".\n${s}`, {
return new GraphQLError(`An error occurred while running "${extension}".\n${s}`, {
extensions: {
code: 'KS_EXTENSION_ERROR',
debug: things.map(t => ({ stacktrace: t.error.stack, message: t.error.message })),
Expand All @@ -44,7 +44,7 @@ export const extensionError = (extension: string, things: { error: Error; tag: s

export const resolverError = (things: { error: Error; tag: string }[]) => {
const s = things.map(t => ` - ${t.tag}: ${t.error.message}`).join('\n');
return new GraphQLError(`An error occured while resolving input fields.\n${s}`, {
return new GraphQLError(`An error occurred while resolving input fields.\n${s}`, {
extensions: {
code: 'KS_RESOLVER_ERROR',
debug: things.map(t => ({ stacktrace: t.error.stack, message: t.error.message })),
Expand All @@ -57,7 +57,7 @@ export const relationshipError = (things: { error: Error; tag: string }[]) => {
.map(t => ` - ${t.tag}: ${t.error.message}`)
.sort()
.join('\n');
return new GraphQLError(`An error occured while resolving relationship fields.\n${s}`, {
return new GraphQLError(`An error occurred while resolving relationship fields.\n${s}`, {
extensions: {
code: 'KS_RELATIONSHIP_ERROR',
debug: things.map(t => ({ stacktrace: t.error.stack, message: t.error.message })),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

exports[`Access control - Filter findMany - Bad function return value 1`] = `
[
[GraphQLError: An error occured while running "Access control".
[GraphQLError: An error occurred while running "Access control".
- BadAccess.access.filter.query: Variable "$where" got invalid value "blah" at "where.name"; Expected type "StringFilter" to be an object.],
]
`;
Loading