@kitql/client
Advanced tools
Comparing version 0.1.3 to 0.1.4
@@ -31,4 +31,5 @@ 'use strict'; | ||
this.cacheData = {}; | ||
const { url, defaultCache, credentials } = options !== null && options !== void 0 ? options : {}; | ||
const { url, defaultCache, credentials, headers } = options !== null && options !== void 0 ? options : {}; | ||
this.url = url; | ||
this.headers = headers !== null && headers !== void 0 ? headers : {}; | ||
this.cache = defaultCache !== null && defaultCache !== void 0 ? defaultCache : 1000 * 60 * 3; | ||
@@ -94,3 +95,3 @@ this.credentials = credentials; | ||
credentials: this.credentials, | ||
headers: { 'Content-Type': this.headersContentType }, | ||
headers: { ...this.headers, 'Content-Type': this.headersContentType }, | ||
body: JSON.stringify({ | ||
@@ -97,0 +98,0 @@ query: graphql.print(document), |
@@ -7,2 +7,8 @@ export declare type ClientSettings = { | ||
/** | ||
* @name headers | ||
* @description Headers of your requests to graphql endpoint | ||
* @default {} | ||
*/ | ||
headers?: Record<string, string>; | ||
/** | ||
* Default Cache in miliseconds (can be overwritten at Query level, so `cache:0` force a network call) | ||
@@ -66,2 +72,3 @@ */ | ||
private url; | ||
private headers; | ||
private cache; | ||
@@ -68,0 +75,0 @@ private credentials; |
{ | ||
"name": "@kitql/client", | ||
"version": "0.1.3", | ||
"version": "0.1.4", | ||
"dependencies": { | ||
@@ -5,0 +5,0 @@ "@kitql/helper": "0.1.3", |
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
16611
359