houdini 1.0.0-next.17 → 1.0.0-next.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cmd-cjs/index.js +55 -39
- package/build/cmd-esm/index.js +55 -39
- package/build/codegen-cjs/index.js +52 -27
- package/build/codegen-esm/index.js +52 -27
- package/build/lib/config.d.ts +4 -6
- package/build/lib/types.d.ts +11 -10
- package/build/lib-cjs/index.js +35 -40
- package/build/lib-esm/index.js +35 -40
- package/build/runtime/cache/storage.d.ts +18 -15
- package/build/runtime/client/documentStore.d.ts +3 -3
- package/build/runtime/client/utils/documentPlugins.d.ts +2 -2
- package/build/runtime/lib/config.d.ts +2 -2
- package/build/runtime/lib/types.d.ts +40 -41
- package/build/runtime-cjs/cache/storage.d.ts +18 -15
- package/build/runtime-cjs/cache/storage.js +9 -11
- package/build/runtime-cjs/client/documentStore.d.ts +3 -3
- package/build/runtime-cjs/client/documentStore.js +0 -1
- package/build/runtime-cjs/client/index.js +0 -1
- package/build/runtime-cjs/client/plugins/cache.js +0 -1
- package/build/runtime-cjs/client/utils/documentPlugins.d.ts +2 -2
- package/build/runtime-cjs/lib/config.d.ts +2 -2
- package/build/runtime-cjs/lib/types.d.ts +40 -41
- package/build/runtime-cjs/lib/types.js +26 -30
- package/build/runtime-esm/cache/storage.d.ts +18 -15
- package/build/runtime-esm/cache/storage.js +9 -11
- package/build/runtime-esm/client/documentStore.d.ts +3 -3
- package/build/runtime-esm/client/documentStore.js +0 -1
- package/build/runtime-esm/client/index.js +0 -1
- package/build/runtime-esm/client/plugins/cache.js +0 -1
- package/build/runtime-esm/client/utils/documentPlugins.d.ts +2 -2
- package/build/runtime-esm/lib/config.d.ts +2 -2
- package/build/runtime-esm/lib/types.d.ts +40 -41
- package/build/runtime-esm/lib/types.js +26 -30
- package/build/test-cjs/index.js +55 -33
- package/build/test-esm/index.js +55 -33
- package/build/vite-cjs/index.js +53 -37
- package/build/vite-esm/index.js +53 -37
- package/package.json +1 -1
package/build/lib-esm/index.js
CHANGED
|
@@ -61567,36 +61567,32 @@ function getCurrentConfig() {
|
|
|
61567
61567
|
}
|
|
61568
61568
|
|
|
61569
61569
|
// src/runtime/lib/types.ts
|
|
61570
|
-
var CachePolicy =
|
|
61571
|
-
|
|
61572
|
-
|
|
61573
|
-
|
|
61574
|
-
|
|
61575
|
-
|
|
61576
|
-
|
|
61577
|
-
|
|
61578
|
-
|
|
61579
|
-
|
|
61580
|
-
|
|
61581
|
-
|
|
61582
|
-
|
|
61583
|
-
|
|
61584
|
-
var
|
|
61585
|
-
var
|
|
61586
|
-
var
|
|
61587
|
-
|
|
61588
|
-
|
|
61589
|
-
|
|
61590
|
-
|
|
61591
|
-
|
|
61592
|
-
|
|
61593
|
-
|
|
61594
|
-
|
|
61595
|
-
|
|
61596
|
-
DataSource2["Network"] = "network";
|
|
61597
|
-
DataSource2["Ssr"] = "ssr";
|
|
61598
|
-
return DataSource2;
|
|
61599
|
-
})(DataSource || {});
|
|
61570
|
+
var CachePolicy = {
|
|
61571
|
+
CacheOrNetwork: "CacheOrNetwork",
|
|
61572
|
+
CacheOnly: "CacheOnly",
|
|
61573
|
+
NetworkOnly: "NetworkOnly",
|
|
61574
|
+
CacheAndNetwork: "CacheAndNetwork"
|
|
61575
|
+
};
|
|
61576
|
+
var ArtifactKind = {
|
|
61577
|
+
Query: "HoudiniQuery",
|
|
61578
|
+
Subscription: "HoudiniSubscription",
|
|
61579
|
+
Mutation: "HoudiniMutation",
|
|
61580
|
+
Fragment: "HoudiniFragment"
|
|
61581
|
+
};
|
|
61582
|
+
var CompiledFragmentKind = ArtifactKind.Fragment;
|
|
61583
|
+
var CompiledMutationKind = ArtifactKind.Mutation;
|
|
61584
|
+
var CompiledQueryKind = ArtifactKind.Query;
|
|
61585
|
+
var CompiledSubscriptionKind = ArtifactKind.Subscription;
|
|
61586
|
+
var RefetchUpdateMode = {
|
|
61587
|
+
append: "append",
|
|
61588
|
+
prepend: "prepend",
|
|
61589
|
+
replace: "replace"
|
|
61590
|
+
};
|
|
61591
|
+
var DataSource = {
|
|
61592
|
+
Cache: "cache",
|
|
61593
|
+
Network: "network",
|
|
61594
|
+
Ssr: "ssr"
|
|
61595
|
+
};
|
|
61600
61596
|
|
|
61601
61597
|
// src/lib/constants.ts
|
|
61602
61598
|
var siteURL = "https://houdinigraphql.com";
|
|
@@ -63176,13 +63172,12 @@ function plugin(name, hooks) {
|
|
|
63176
63172
|
}
|
|
63177
63173
|
|
|
63178
63174
|
// src/lib/types.ts
|
|
63179
|
-
var LogLevel =
|
|
63180
|
-
|
|
63181
|
-
|
|
63182
|
-
|
|
63183
|
-
|
|
63184
|
-
|
|
63185
|
-
})(LogLevel || {});
|
|
63175
|
+
var LogLevel = {
|
|
63176
|
+
Full: "full",
|
|
63177
|
+
Summary: "summary",
|
|
63178
|
+
ShortSummary: "short-summary",
|
|
63179
|
+
Quiet: "quiet"
|
|
63180
|
+
};
|
|
63186
63181
|
|
|
63187
63182
|
// src/lib/config.ts
|
|
63188
63183
|
var currentDir = global.__dirname || dirname(fileURLToPath(import.meta.url));
|
|
@@ -63233,7 +63228,7 @@ var Config = class {
|
|
|
63233
63228
|
scalars,
|
|
63234
63229
|
cacheBufferSize,
|
|
63235
63230
|
definitionsPath,
|
|
63236
|
-
defaultCachePolicy =
|
|
63231
|
+
defaultCachePolicy = CachePolicy.CacheOrNetwork,
|
|
63237
63232
|
defaultPartial = false,
|
|
63238
63233
|
defaultListPosition = "append",
|
|
63239
63234
|
defaultListTarget = null,
|
|
@@ -63255,7 +63250,7 @@ var Config = class {
|
|
|
63255
63250
|
Object.values(LogLevel)
|
|
63256
63251
|
)}`
|
|
63257
63252
|
);
|
|
63258
|
-
logLevel =
|
|
63253
|
+
logLevel = LogLevel.Summary;
|
|
63259
63254
|
}
|
|
63260
63255
|
this.schemaPath = schemaPath;
|
|
63261
63256
|
this.filepath = filepath;
|
|
@@ -63271,7 +63266,7 @@ var Config = class {
|
|
|
63271
63266
|
this.internalListPosition = defaultListPosition === "append" ? "last" : "first";
|
|
63272
63267
|
this.defaultListTarget = defaultListTarget;
|
|
63273
63268
|
this.definitionsFolder = definitionsPath;
|
|
63274
|
-
this.logLevel = (logLevel ||
|
|
63269
|
+
this.logLevel = (logLevel || LogLevel.Summary).toLowerCase();
|
|
63275
63270
|
this.defaultFragmentMasking = defaultFragmentMasking;
|
|
63276
63271
|
this.routesDir = join2(this.projectRoot, "src", "routes");
|
|
63277
63272
|
this.schemaPollInterval = watchSchema?.interval ?? 2e3;
|
|
@@ -7,7 +7,7 @@ export declare class InMemoryStorage {
|
|
|
7
7
|
get layerCount(): number;
|
|
8
8
|
get nextRank(): number;
|
|
9
9
|
createLayer(optimistic?: boolean): Layer;
|
|
10
|
-
insert(id: string, field: string, location:
|
|
10
|
+
insert(id: string, field: string, location: OperationLocations, target: string): void;
|
|
11
11
|
remove(id: string, field: string, target: string): void;
|
|
12
12
|
delete(id: string): void;
|
|
13
13
|
deleteField(id: string, field: string): void;
|
|
@@ -47,7 +47,7 @@ export declare class Layer {
|
|
|
47
47
|
removeUndefinedFields(): void;
|
|
48
48
|
delete(id: string): void;
|
|
49
49
|
deleteField(id: string, field: string): void;
|
|
50
|
-
insert(id: string, field: string, where:
|
|
50
|
+
insert(id: string, field: string, where: OperationLocations, target: string): void;
|
|
51
51
|
remove(id: string, field: string, target: string): void;
|
|
52
52
|
writeLayer(layer: Layer): void;
|
|
53
53
|
private addFieldOperation;
|
|
@@ -71,28 +71,31 @@ type OperationMap = {
|
|
|
71
71
|
};
|
|
72
72
|
type NestedList<_Result = string> = (_Result | null | NestedList<_Result>)[];
|
|
73
73
|
type InsertOperation = {
|
|
74
|
-
kind:
|
|
75
|
-
location:
|
|
74
|
+
kind: 'insert';
|
|
75
|
+
location: OperationLocations;
|
|
76
76
|
id: string;
|
|
77
77
|
};
|
|
78
78
|
type RemoveOperation = {
|
|
79
|
-
kind:
|
|
79
|
+
kind: 'remove';
|
|
80
80
|
id: string;
|
|
81
81
|
};
|
|
82
82
|
type DeleteOperation = {
|
|
83
|
-
kind:
|
|
83
|
+
kind: 'delete';
|
|
84
84
|
target: string;
|
|
85
85
|
};
|
|
86
86
|
type ListOperation = InsertOperation | RemoveOperation;
|
|
87
87
|
type Operation = ListOperation | DeleteOperation;
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
88
|
+
type ValuesOf<Target> = Target[keyof Target];
|
|
89
|
+
export declare const OperationLocation: {
|
|
90
|
+
readonly start: "start";
|
|
91
|
+
readonly end: "end";
|
|
92
|
+
};
|
|
93
|
+
export type OperationLocations = ValuesOf<typeof OperationLocation>;
|
|
94
|
+
export declare const OperationKind: {
|
|
95
|
+
readonly delete: "delete";
|
|
96
|
+
readonly insert: "insert";
|
|
97
|
+
readonly remove: "remove";
|
|
98
|
+
};
|
|
99
|
+
export type OperationKinds = ValuesOf<typeof OperationKind>;
|
|
97
100
|
export type LayerID = number;
|
|
98
101
|
export {};
|
|
@@ -2,7 +2,7 @@ import type { HoudiniClient } from '.';
|
|
|
2
2
|
import type { Layer } from '../cache/storage';
|
|
3
3
|
import type { ConfigFile } from '../lib/config';
|
|
4
4
|
import { Writable } from '../lib/store';
|
|
5
|
-
import type {
|
|
5
|
+
import type { DocumentArtifact, QueryResult, GraphQLObject, SubscriptionSpec, CachePolicies } from '../lib/types';
|
|
6
6
|
export declare class DocumentStore<_Data extends GraphQLObject, _Input extends Record<string, any>> extends Writable<QueryResult<_Data, _Input>> {
|
|
7
7
|
#private;
|
|
8
8
|
constructor({ artifact, plugins, pipeline, client, cache, initialValue, fetching, }: {
|
|
@@ -33,7 +33,7 @@ export type ClientPluginContext = {
|
|
|
33
33
|
text: string;
|
|
34
34
|
hash: string;
|
|
35
35
|
artifact: DocumentArtifact;
|
|
36
|
-
policy?:
|
|
36
|
+
policy?: CachePolicies;
|
|
37
37
|
fetch?: Fetch;
|
|
38
38
|
variables?: Record<string, any>;
|
|
39
39
|
metadata?: App.Metadata | null;
|
|
@@ -81,7 +81,7 @@ export type SendParams = {
|
|
|
81
81
|
variables?: Record<string, any> | null;
|
|
82
82
|
metadata?: App.Metadata | null;
|
|
83
83
|
session?: App.Session | null;
|
|
84
|
-
policy?:
|
|
84
|
+
policy?: CachePolicies;
|
|
85
85
|
stuff?: Partial<App.Stuff>;
|
|
86
86
|
cacheParams?: ClientPluginContext['cacheParams'];
|
|
87
87
|
setup?: boolean;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ArtifactKinds } from '../../lib/types';
|
|
2
2
|
import type { ClientPlugin, ClientHooks } from '../documentStore';
|
|
3
|
-
export declare const documentPlugin: (kind:
|
|
3
|
+
export declare const documentPlugin: (kind: ArtifactKinds, source: () => ClientHooks) => ClientPlugin;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { GraphQLSchema } from 'graphql';
|
|
2
|
-
import type {
|
|
2
|
+
import type { CachePolicies } from './types';
|
|
3
3
|
export declare function getMockConfig(): ConfigFile | null;
|
|
4
4
|
export declare function setMockConfig(config: ConfigFile | null): void;
|
|
5
5
|
export declare function defaultConfigValues(file: ConfigFile): ConfigFile;
|
|
@@ -50,7 +50,7 @@ export type ConfigFile = {
|
|
|
50
50
|
/**
|
|
51
51
|
* The default cache policy to use for queries. For more information: https://www.houdinigraphql.com/guides/caching-data
|
|
52
52
|
*/
|
|
53
|
-
defaultCachePolicy?:
|
|
53
|
+
defaultCachePolicy?: CachePolicies;
|
|
54
54
|
/**
|
|
55
55
|
* Specifies whether or not the cache should always use partial data. For more information: https://www.houdinigraphql.com/guides/caching-data#partial-data
|
|
56
56
|
*/
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
export declare
|
|
2
|
-
CacheOrNetwork
|
|
3
|
-
CacheOnly
|
|
4
|
-
NetworkOnly
|
|
5
|
-
CacheAndNetwork
|
|
6
|
-
}
|
|
1
|
+
export declare const CachePolicy: {
|
|
2
|
+
readonly CacheOrNetwork: "CacheOrNetwork";
|
|
3
|
+
readonly CacheOnly: "CacheOnly";
|
|
4
|
+
readonly NetworkOnly: "NetworkOnly";
|
|
5
|
+
readonly CacheAndNetwork: "CacheAndNetwork";
|
|
6
|
+
};
|
|
7
|
+
type ValuesOf<Target> = Target[keyof Target];
|
|
8
|
+
export type CachePolicies = ValuesOf<typeof CachePolicy>;
|
|
7
9
|
declare global {
|
|
8
10
|
namespace App {
|
|
9
11
|
interface Session {
|
|
@@ -29,42 +31,38 @@ export type Operation<_Result, _Input> = {
|
|
|
29
31
|
};
|
|
30
32
|
export type Maybe<T> = T | null | undefined;
|
|
31
33
|
export type DocumentArtifact = FragmentArtifact | QueryArtifact | MutationArtifact | SubscriptionArtifact;
|
|
32
|
-
export declare
|
|
33
|
-
Query
|
|
34
|
-
Subscription
|
|
35
|
-
Mutation
|
|
36
|
-
Fragment
|
|
37
|
-
}
|
|
38
|
-
export
|
|
39
|
-
export declare const
|
|
40
|
-
export declare const
|
|
41
|
-
export declare const
|
|
42
|
-
export
|
|
43
|
-
export type
|
|
44
|
-
|
|
45
|
-
policy?:
|
|
34
|
+
export declare const ArtifactKind: {
|
|
35
|
+
readonly Query: "HoudiniQuery";
|
|
36
|
+
readonly Subscription: "HoudiniSubscription";
|
|
37
|
+
readonly Mutation: "HoudiniMutation";
|
|
38
|
+
readonly Fragment: "HoudiniFragment";
|
|
39
|
+
};
|
|
40
|
+
export type ArtifactKinds = ValuesOf<typeof ArtifactKind>;
|
|
41
|
+
export declare const CompiledFragmentKind: "HoudiniFragment";
|
|
42
|
+
export declare const CompiledMutationKind: "HoudiniMutation";
|
|
43
|
+
export declare const CompiledQueryKind: "HoudiniQuery";
|
|
44
|
+
export declare const CompiledSubscriptionKind: "HoudiniSubscription";
|
|
45
|
+
export type CompiledDocumentKind = ArtifactKinds;
|
|
46
|
+
export type QueryArtifact = BaseCompiledDocument<'HoudiniQuery'> & {
|
|
47
|
+
policy?: CachePolicies;
|
|
46
48
|
partial?: boolean;
|
|
47
49
|
};
|
|
48
|
-
export type MutationArtifact = BaseCompiledDocument
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
export
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
kind: ArtifactKind.Subscription;
|
|
50
|
+
export type MutationArtifact = BaseCompiledDocument<'HoudiniMutation'>;
|
|
51
|
+
export type FragmentArtifact = BaseCompiledDocument<'HoudiniFragment'>;
|
|
52
|
+
export type SubscriptionArtifact = BaseCompiledDocument<'HoudiniSubscription'>;
|
|
53
|
+
export declare const RefetchUpdateMode: {
|
|
54
|
+
readonly append: "append";
|
|
55
|
+
readonly prepend: "prepend";
|
|
56
|
+
readonly replace: "replace";
|
|
56
57
|
};
|
|
57
|
-
export
|
|
58
|
-
append = "append",
|
|
59
|
-
prepend = "prepend",
|
|
60
|
-
replace = "replace"
|
|
61
|
-
}
|
|
58
|
+
export type RefetchUpdateModes = ValuesOf<typeof RefetchUpdateMode>;
|
|
62
59
|
export type InputObject = {
|
|
63
60
|
fields: Record<string, string>;
|
|
64
61
|
types: Record<string, Record<string, string>>;
|
|
65
62
|
};
|
|
66
|
-
export type BaseCompiledDocument = {
|
|
63
|
+
export type BaseCompiledDocument<_Kind extends ArtifactKinds> = {
|
|
67
64
|
name: string;
|
|
65
|
+
kind: _Kind;
|
|
68
66
|
raw: string;
|
|
69
67
|
hash: string;
|
|
70
68
|
selection: SubscriptionSelection;
|
|
@@ -92,20 +90,21 @@ export type ListWhen = {
|
|
|
92
90
|
must?: Filter;
|
|
93
91
|
must_not?: Filter;
|
|
94
92
|
};
|
|
95
|
-
export declare
|
|
93
|
+
export declare const DataSource: {
|
|
96
94
|
/**
|
|
97
95
|
* from the browser cache
|
|
98
96
|
*/
|
|
99
|
-
Cache
|
|
97
|
+
readonly Cache: "cache";
|
|
100
98
|
/**
|
|
101
99
|
* from a browser side `fetch`
|
|
102
100
|
*/
|
|
103
|
-
Network
|
|
101
|
+
readonly Network: "network";
|
|
104
102
|
/**
|
|
105
103
|
* from a server side `fetch`
|
|
106
104
|
*/
|
|
107
|
-
Ssr
|
|
108
|
-
}
|
|
105
|
+
readonly Ssr: "ssr";
|
|
106
|
+
};
|
|
107
|
+
export type DataSources = ValuesOf<typeof DataSource>;
|
|
109
108
|
export type MutationOperation = {
|
|
110
109
|
action: 'insert' | 'remove' | 'delete' | 'toggle';
|
|
111
110
|
list?: string;
|
|
@@ -163,7 +162,7 @@ export type SubscriptionSpec = {
|
|
|
163
162
|
};
|
|
164
163
|
export type FetchQueryResult<_Data> = {
|
|
165
164
|
result: RequestPayload<_Data | null>;
|
|
166
|
-
source:
|
|
165
|
+
source: DataSources | null;
|
|
167
166
|
};
|
|
168
167
|
export type QueryResult<_Data = GraphQLObject, _Input = Record<string, any>> = {
|
|
169
168
|
data: _Data | null;
|
|
@@ -173,7 +172,7 @@ export type QueryResult<_Data = GraphQLObject, _Input = Record<string, any>> = {
|
|
|
173
172
|
fetching: boolean;
|
|
174
173
|
partial: boolean;
|
|
175
174
|
stale: boolean;
|
|
176
|
-
source:
|
|
175
|
+
source: DataSources | null;
|
|
177
176
|
variables: _Input | null;
|
|
178
177
|
};
|
|
179
178
|
export type RequestPayload<GraphQLObject = any> = {
|
|
@@ -7,7 +7,7 @@ export declare class InMemoryStorage {
|
|
|
7
7
|
get layerCount(): number;
|
|
8
8
|
get nextRank(): number;
|
|
9
9
|
createLayer(optimistic?: boolean): Layer;
|
|
10
|
-
insert(id: string, field: string, location:
|
|
10
|
+
insert(id: string, field: string, location: OperationLocations, target: string): void;
|
|
11
11
|
remove(id: string, field: string, target: string): void;
|
|
12
12
|
delete(id: string): void;
|
|
13
13
|
deleteField(id: string, field: string): void;
|
|
@@ -47,7 +47,7 @@ export declare class Layer {
|
|
|
47
47
|
removeUndefinedFields(): void;
|
|
48
48
|
delete(id: string): void;
|
|
49
49
|
deleteField(id: string, field: string): void;
|
|
50
|
-
insert(id: string, field: string, where:
|
|
50
|
+
insert(id: string, field: string, where: OperationLocations, target: string): void;
|
|
51
51
|
remove(id: string, field: string, target: string): void;
|
|
52
52
|
writeLayer(layer: Layer): void;
|
|
53
53
|
private addFieldOperation;
|
|
@@ -71,28 +71,31 @@ type OperationMap = {
|
|
|
71
71
|
};
|
|
72
72
|
type NestedList<_Result = string> = (_Result | null | NestedList<_Result>)[];
|
|
73
73
|
type InsertOperation = {
|
|
74
|
-
kind:
|
|
75
|
-
location:
|
|
74
|
+
kind: 'insert';
|
|
75
|
+
location: OperationLocations;
|
|
76
76
|
id: string;
|
|
77
77
|
};
|
|
78
78
|
type RemoveOperation = {
|
|
79
|
-
kind:
|
|
79
|
+
kind: 'remove';
|
|
80
80
|
id: string;
|
|
81
81
|
};
|
|
82
82
|
type DeleteOperation = {
|
|
83
|
-
kind:
|
|
83
|
+
kind: 'delete';
|
|
84
84
|
target: string;
|
|
85
85
|
};
|
|
86
86
|
type ListOperation = InsertOperation | RemoveOperation;
|
|
87
87
|
type Operation = ListOperation | DeleteOperation;
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
88
|
+
type ValuesOf<Target> = Target[keyof Target];
|
|
89
|
+
export declare const OperationLocation: {
|
|
90
|
+
readonly start: "start";
|
|
91
|
+
readonly end: "end";
|
|
92
|
+
};
|
|
93
|
+
export type OperationLocations = ValuesOf<typeof OperationLocation>;
|
|
94
|
+
export declare const OperationKind: {
|
|
95
|
+
readonly delete: "delete";
|
|
96
|
+
readonly insert: "insert";
|
|
97
|
+
readonly remove: "remove";
|
|
98
|
+
};
|
|
99
|
+
export type OperationKinds = ValuesOf<typeof OperationKind>;
|
|
97
100
|
export type LayerID = number;
|
|
98
101
|
export {};
|
|
@@ -376,17 +376,15 @@ function isInsertOperation(value) {
|
|
|
376
376
|
function isRemoveOperation(value) {
|
|
377
377
|
return !!value && value.kind === OperationKind.remove;
|
|
378
378
|
}
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
return OperationKind2;
|
|
389
|
-
})(OperationKind || {});
|
|
379
|
+
const OperationLocation = {
|
|
380
|
+
start: "start",
|
|
381
|
+
end: "end"
|
|
382
|
+
};
|
|
383
|
+
const OperationKind = {
|
|
384
|
+
delete: "delete",
|
|
385
|
+
insert: "insert",
|
|
386
|
+
remove: "remove"
|
|
387
|
+
};
|
|
390
388
|
// Annotate the CommonJS export names for ESM import in node:
|
|
391
389
|
0 && (module.exports = {
|
|
392
390
|
InMemoryStorage,
|
|
@@ -2,7 +2,7 @@ import type { HoudiniClient } from '.';
|
|
|
2
2
|
import type { Layer } from '../cache/storage';
|
|
3
3
|
import type { ConfigFile } from '../lib/config';
|
|
4
4
|
import { Writable } from '../lib/store';
|
|
5
|
-
import type {
|
|
5
|
+
import type { DocumentArtifact, QueryResult, GraphQLObject, SubscriptionSpec, CachePolicies } from '../lib/types';
|
|
6
6
|
export declare class DocumentStore<_Data extends GraphQLObject, _Input extends Record<string, any>> extends Writable<QueryResult<_Data, _Input>> {
|
|
7
7
|
#private;
|
|
8
8
|
constructor({ artifact, plugins, pipeline, client, cache, initialValue, fetching, }: {
|
|
@@ -33,7 +33,7 @@ export type ClientPluginContext = {
|
|
|
33
33
|
text: string;
|
|
34
34
|
hash: string;
|
|
35
35
|
artifact: DocumentArtifact;
|
|
36
|
-
policy?:
|
|
36
|
+
policy?: CachePolicies;
|
|
37
37
|
fetch?: Fetch;
|
|
38
38
|
variables?: Record<string, any>;
|
|
39
39
|
metadata?: App.Metadata | null;
|
|
@@ -81,7 +81,7 @@ export type SendParams = {
|
|
|
81
81
|
variables?: Record<string, any> | null;
|
|
82
82
|
metadata?: App.Metadata | null;
|
|
83
83
|
session?: App.Session | null;
|
|
84
|
-
policy?:
|
|
84
|
+
policy?: CachePolicies;
|
|
85
85
|
stuff?: Partial<App.Stuff>;
|
|
86
86
|
cacheParams?: ClientPluginContext['cacheParams'];
|
|
87
87
|
setup?: boolean;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ArtifactKinds } from '../../lib/types';
|
|
2
2
|
import type { ClientPlugin, ClientHooks } from '../documentStore';
|
|
3
|
-
export declare const documentPlugin: (kind:
|
|
3
|
+
export declare const documentPlugin: (kind: ArtifactKinds, source: () => ClientHooks) => ClientPlugin;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { GraphQLSchema } from 'graphql';
|
|
2
|
-
import type {
|
|
2
|
+
import type { CachePolicies } from './types';
|
|
3
3
|
export declare function getMockConfig(): ConfigFile | null;
|
|
4
4
|
export declare function setMockConfig(config: ConfigFile | null): void;
|
|
5
5
|
export declare function defaultConfigValues(file: ConfigFile): ConfigFile;
|
|
@@ -50,7 +50,7 @@ export type ConfigFile = {
|
|
|
50
50
|
/**
|
|
51
51
|
* The default cache policy to use for queries. For more information: https://www.houdinigraphql.com/guides/caching-data
|
|
52
52
|
*/
|
|
53
|
-
defaultCachePolicy?:
|
|
53
|
+
defaultCachePolicy?: CachePolicies;
|
|
54
54
|
/**
|
|
55
55
|
* Specifies whether or not the cache should always use partial data. For more information: https://www.houdinigraphql.com/guides/caching-data#partial-data
|
|
56
56
|
*/
|