useMutation
hook error not corresponding with the thrown error message on the server
The client error link logs is correct [GraphQL error]: Message: Authentication required., Location: undefined, Path: undefined
Server code:
if (!user)
throw new GraphQLError("Authentication required.", {
extensions: { code: "UNAUTHORIZED" },
});
Client code:
const [signIn, { loading, error, data, networkStatus }] = useLazyQuery(
PROFILE,
{ notifyOnNetworkStatusChange: true }
);
Logging the error gives me this:
Error: Response not successful: Received status code 400