Skip to content

Commit 8a34a6b

Browse files
author
timeshift
committed
1.2.10 release
1 parent dfd11ce commit 8a34a6b

File tree

6 files changed

+65
-596
lines changed

6 files changed

+65
-596
lines changed

index.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,3 +145,20 @@ export interface WSOptions {
145145
*/
146146
inactivityTimeout?: number;
147147
}
148+
149+
export interface queryType {
150+
query: string;
151+
variables?: object;
152+
cache?: boolean;
153+
key?: (key: any) => any;
154+
};
155+
156+
export interface graphqlOptions {
157+
url: string;
158+
wsUrl?: string;
159+
wsOptions?: WSOptions;
160+
graphqlOptions?: {
161+
cache?: Record<GraphQLCacheKey, GraphQLCacheValue>
162+
cacheWrapper?: Function
163+
}
164+
}

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "graphql-svelte",
3-
"version": "1.2.8",
3+
"version": "1.2.10",
44
"description": "graphql fetcher alternate apollo client",
55
"main": "dist",
66
"scripts": {
@@ -56,7 +56,8 @@
5656
],
5757
"coveragePathIgnorePatterns": [
5858
"/node_modules/",
59-
"/test/"
59+
"/test/",
60+
"/src/reportCacheErrors.ts"
6061
],
6162
"coverageThreshold": {
6263
"global": {

src/interfaces.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,2 @@
1-
export interface queryType {
2-
query: string;
3-
variables?: object;
4-
cache?: boolean;
5-
key?: (key: any) => any;
6-
};
1+
import { GraphQLCacheKey, GraphQLCacheValue, WSOptions } from "..";
2+

src/svqlConfig.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
import { GraphQLFetchOptions, WSOptions } from '..'
1+
import { GraphQLFetchOptions, queryType, graphqlOptions } from '..'
22
import { GraphQL } from './GraphQL'
33
import { graphqlFetchOptions } from './graphqlFetchOptions'
44
import { hashObject } from './hashObject'
5-
import { queryType } from './interfaces'
65
import { SubscribeQL } from './SubscribeQL'
76
//@ts-ignore
87
export let client: {
@@ -46,8 +45,8 @@ export function headers() {
4645
* inactivityTimeout:number
4746
* }} options
4847
*/
49-
export function getClient(url: string, wsUrl?: string, wsOptions: WSOptions = {}) {
50-
const graphql = new GraphQL()
48+
export function getClient({ url, wsUrl, wsOptions = {}, graphqlOptions = {} }: graphqlOptions) {
49+
const graphql = new GraphQL(graphqlOptions)
5150

5251
const fetchOptionsOverride = (_options: GraphQLFetchOptions) => {
5352
; (_options.url = url), (_options.headers = headers())

0 commit comments

Comments
 (0)