Skip to content

Commit 7fb2755

Browse files
doseoftedbenjamincanac
authored andcommitted
fix(useStrapiGraphQL): add missing header preventing successful graphql requests (#248)
1 parent 7a8b6be commit 7fb2755

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/runtime/composables/useStrapiGraphQL.ts

+8-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,13 @@ export const useStrapiGraphQL = () => {
66
const config = useRuntimeConfig().public
77

88
return <T> (query: string): Promise<T> => {
9-
return client('/graphql', { method: 'POST', body: { query }, baseURL: config.strapi.url })
9+
return client('/graphql', {
10+
method: 'POST',
11+
body: { query },
12+
headers: {
13+
accept: 'application/json'
14+
},
15+
baseURL: config.strapi.url
16+
})
1017
}
1118
}

0 commit comments

Comments
 (0)