diff --git a/src/envelopePlugin.ts b/src/envelopePlugin.ts index 0e19ee9..1b8ef77 100644 --- a/src/envelopePlugin.ts +++ b/src/envelopePlugin.ts @@ -1,5 +1,5 @@ /* eslint-disable react-hooks/rules-of-hooks */ -import { useGenericAuth } from '@envelop/generic-auth' +import { useGenericAuth, UnauthenticatedError } from '@envelop/generic-auth' import { MeshPlugin } from '@graphql-mesh/types' type UserType = { @@ -18,7 +18,7 @@ const resolveUserFn = async (context: any) => { const validateUser = (params: any) => { if (!params.user) { - return new Error(`Unauthenticated!`) + return new UnauthenticatedError(`Unauthenticated!`) } }