fix: improper parsed error checks
This commit is contained in:
parent
fa4b130b18
commit
c9a24a0d28
1 changed files with 3 additions and 1 deletions
|
|
@ -201,7 +201,7 @@ export const useGQLQuery = <DocType, DocVarType, DocErrorType extends string>(
|
|||
(gqlErr) =>
|
||||
<GQLError<DocErrorType>>{
|
||||
type: "gql_error",
|
||||
error: gqlErr as DocErrorType,
|
||||
error: parseGQLErrorString(gqlErr ?? "") as DocErrorType,
|
||||
},
|
||||
// The right case (it was a GraphQL Error)
|
||||
(networkErr) =>
|
||||
|
|
@ -244,6 +244,8 @@ export const useGQLQuery = <DocType, DocVarType, DocErrorType extends string>(
|
|||
return response
|
||||
}
|
||||
|
||||
const parseGQLErrorString = (s: string) => s.startsWith("[GraphQL] ") ? s.split("[GraphQL] ")[1] : s
|
||||
|
||||
export const runMutation = <
|
||||
DocType,
|
||||
DocVariables extends object | undefined,
|
||||
|
|
|
|||
Loading…
Reference in a new issue