Skip to content

Commit

Permalink
fix: trying again
Browse files Browse the repository at this point in the history
  • Loading branch information
cgilbe27 committed Feb 5, 2024
1 parent f623432 commit 83db669
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
9 changes: 2 additions & 7 deletions src/gql/mutation/marketing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,7 @@ export const marketingMutationString = (
export const marketingMutation = async (
args: Partial<MutationMarketingArgs>,
endpt: string,
authorizationHeader: HeadersInit,
headers: HeadersInit,
fields?: Partial<GQLTwitterUser>
): Promise<GqlOutMarketingMutation> =>
doGqlQuery(
marketingMutationString(args, true, fields),
endpt,
authorizationHeader,
true
)
doGqlQuery(marketingMutationString(args, true, fields), endpt, headers)
7 changes: 2 additions & 5 deletions src/gql/utils/consts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,15 +131,12 @@ export const gqlQuery = <T>(
export const doGqlQuery = async <T>(
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
}

0 comments on commit 83db669

Please sign in to comment.