@kitql/client
Advanced tools
Comparing version 0.0.15 to 0.0.16
@@ -33,3 +33,4 @@ 'use strict'; | ||
this.credentials = credentials; | ||
this.queryMode = options.queryMode || 'string'; | ||
this.queryMode = options.queryMode || 'ast'; | ||
this.headersContentType = options.headersContentType || 'application/graphql+json'; | ||
} | ||
@@ -59,3 +60,3 @@ async request({ skFetch, document, variables, cacheKey, cacheMs }) { | ||
credentials: this.credentials, | ||
headers: { 'Content-Type': 'application/json' }, | ||
headers: { 'Content-Type': this.headersContentType }, | ||
body: JSON.stringify({ | ||
@@ -62,0 +63,0 @@ query: this.queryMode === 'string' ? graphql.print(document) : document, |
@@ -6,5 +6,9 @@ export declare type ClientSettings = { | ||
/** | ||
* Default to `string`. But if you have a great server, put this to `ast`! ;) | ||
* Default to `ast`. But if your server is a bit legacy, you can go back to `string` | ||
*/ | ||
queryMode?: 'string' | 'ast'; | ||
/** | ||
* Default to `/graphql+json`. But if your server is a bit legacy, you can go back to `/json` | ||
*/ | ||
headersContentType: 'application/graphql+json' | 'application/json'; | ||
}; | ||
@@ -52,2 +56,3 @@ export declare type RequestSettings = { | ||
private queryMode; | ||
private headersContentType; | ||
private cache; | ||
@@ -54,0 +59,0 @@ constructor(options: ClientSettings); |
{ | ||
"name": "@kitql/client", | ||
"version": "0.0.15", | ||
"version": "0.0.16", | ||
"dependencies": { | ||
@@ -5,0 +5,0 @@ "graphql": "16.2.0" |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
11678
339