mirror of
https://github.com/jorgev259/soc_site-astro.git
synced 2025-06-29 07:57:41 +00:00
Implement SignIn/SignOut
This commit is contained in:
parent
bce35d73ca
commit
adeb3fd3bf
16 changed files with 987 additions and 77 deletions
13
src/utils/graphQLErrors.ts
Normal file
13
src/utils/graphQLErrors.ts
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
import { GraphQLError } from 'graphql'
|
||||
import { ApolloServerErrorCode } from '@apollo/server/errors'
|
||||
|
||||
export const AuthenticationError = (message: string = '') =>
|
||||
new GraphQLError(message, { extensions: { code: 'UNAUTHENTICATED' } })
|
||||
|
||||
export const ForbiddenError = (message: string = '') =>
|
||||
new GraphQLError(message, { extensions: { code: 'FORBIDDEN' } })
|
||||
|
||||
export const UserInputError = (message: string = '') =>
|
||||
new GraphQLError(message, {
|
||||
extensions: { code: ApolloServerErrorCode.BAD_USER_INPUT }
|
||||
})
|
||||
Loading…
Add table
Add a link
Reference in a new issue