aboutsummaryrefslogtreecommitdiffstats
path: root/src/utils/helpers
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils/helpers')
-rw-r--r--src/utils/helpers/graphql.ts3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/utils/helpers/graphql.ts b/src/utils/helpers/graphql.ts
index e07b151..2d78e00 100644
--- a/src/utils/helpers/graphql.ts
+++ b/src/utils/helpers/graphql.ts
@@ -20,6 +20,7 @@ type GraphQLResponse<T extends GraphQLData<unknown>> = {
};
export type FetchGraphQLConfig = {
+ headers?: HeadersInit;
query: string;
url: string;
variables?: Record<string, unknown>;
@@ -35,6 +36,7 @@ export type FetchGraphQLConfig = {
export const fetchGraphQL = async <
T extends GraphQLData<unknown> = GraphQLData<unknown>,
>({
+ headers,
query,
url,
variables,
@@ -42,6 +44,7 @@ export const fetchGraphQL = async <
const response = await fetch(url, {
method: 'POST',
headers: {
+ ...headers,
'content-type': 'application/json;charset=UTF-8',
},
body: JSON.stringify({