Skip to content

Commit

Permalink
set http headers and bind fetch client
Browse files Browse the repository at this point in the history
  • Loading branch information
tocsoft committed Mar 8, 2021
1 parent 0905da1 commit 7d01172
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{{!# ClientClassDecorators }}

{{!# FetchCient }}
fetch
window.fetch.bind(window)

{{!# ApiUrl }}
{{error 'TemplateSettings.ApiUrl or TemplateSettings.UrlConfig muse be specified for loading the api base url' }}
Expand Down Expand Up @@ -105,6 +105,7 @@ export class {{pascalCase Name}} {
export function {{camelCase OperationName}}({{> ArgumentList Arguments}}) : Promise<{{> TypeReference ResultType}}>{
return client.fetch(url, {
method : 'POST',
headers: {'Content-Type': 'application/json'},
body : JSON.stringify({
query : `{{replace Query '`' '\`'}}`,
variables : {
Expand Down

0 comments on commit 7d01172

Please sign in to comment.