diff --git a/src/gql/mutation/marketing.ts b/src/gql/mutation/marketing.ts index 6d507f17..d8a90ea1 100644 --- a/src/gql/mutation/marketing.ts +++ b/src/gql/mutation/marketing.ts @@ -37,12 +37,7 @@ export const marketingMutationString = ( export const marketingMutation = async ( args: Partial, endpt: string, - authorizationHeader: HeadersInit, + headers: HeadersInit, fields?: Partial ): Promise => - doGqlQuery( - marketingMutationString(args, true, fields), - endpt, - authorizationHeader, - true - ) + doGqlQuery(marketingMutationString(args, true, fields), endpt, headers) diff --git a/src/gql/utils/consts.ts b/src/gql/utils/consts.ts index 7d699953..23c4ab26 100644 --- a/src/gql/utils/consts.ts +++ b/src/gql/utils/consts.ts @@ -131,15 +131,12 @@ export const gqlQuery = ( export const doGqlQuery = async ( gqlQuery: string, gqlEndpt: string, - headers?: HeadersInit, - isMutation?: boolean + headers?: HeadersInit ) => { const rawResp = await fetch(gqlEndpt, { method: "POST", headers: { "Content-Type": "application/json", ...headers }, - body: JSON.stringify( - isMutation ? { mutation: gqlQuery } : { query: gqlQuery } - ), + body: JSON.stringify({ query: gqlQuery }), }) return cleanResponse(rawResp) as T }