We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0905da1 commit 7d01172Copy full SHA for 7d01172
Tocsoft.GraphQLCodeGen.Cli/Templates/ts/Function/typescript.template
@@ -3,7 +3,7 @@
3
{{!# ClientClassDecorators }}
4
5
{{!# FetchCient }}
6
-fetch
+window.fetch.bind(window)
7
8
{{!# ApiUrl }}
9
{{error 'TemplateSettings.ApiUrl or TemplateSettings.UrlConfig muse be specified for loading the api base url' }}
@@ -105,6 +105,7 @@ export class {{pascalCase Name}} {
105
export function {{camelCase OperationName}}({{> ArgumentList Arguments}}) : Promise<{{> TypeReference ResultType}}>{
106
return client.fetch(url, {
107
method : 'POST',
108
+ headers: {'Content-Type': 'application/json'},
109
body : JSON.stringify({
110
query : `{{replace Query '`' '\`'}}`,
111
variables : {
0 commit comments