From 83db66903f5edd8c61e0c9322d66ab67d44af43c Mon Sep 17 00:00:00 2001 From: Cameron Gilbert Date: Mon, 5 Feb 2024 16:44:23 -0500 Subject: [PATCH] fix: trying again --- src/gql/mutation/marketing.ts | 9 ++------- src/gql/utils/consts.ts | 7 ++----- 2 files changed, 4 insertions(+), 12 deletions(-) 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 }