Skip to content

Commit 16012b5

Browse files
committed
fix: removed getHeader
1 parent 5a46c89 commit 16012b5

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/runtime/composables/gql-query.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export async function gqlQuery<T = any>(method: string, options: IGraphQLOptions
1515
const _nuxtApp = useNuxtApp();
1616
const { accessTokenState } = useAuthState();
1717
const { checkTokenAndRenew } = useAuth();
18-
const { getHeaders } = useRequestOptions();
18+
const { headers } = useRequestOptions();
1919

2020
// Check parameters
2121
if (!method) {
@@ -124,13 +124,13 @@ export async function gqlQuery<T = any>(method: string, options: IGraphQLOptions
124124
await callWithNuxt(_nuxtApp, checkTokenAndRenew);
125125

126126
const requestHeaders: Record<string, string> = {
127-
...getHeaders(),
127+
...headers,
128128
...(options.headers || {}),
129129
authorization: `Bearer ${accessTokenState.value}`,
130130
};
131131

132132
if (config.log) {
133-
console.debug(requestHeaders);
133+
console.debug('gqlQuery::requestHeader ', requestHeaders);
134134
}
135135

136136
let data = null;

src/runtime/composables/use-request-options.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ export function useRequestOptions() {
99

1010
return {
1111
getHeaders,
12+
headers,
1213
setHeaders,
1314
};
1415
}

0 commit comments

Comments
 (0)