houdini 0.18.0 → 0.18.2
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 +1940 -1399
- package/build/cmd-esm/index.js +1940 -1399
- package/build/codegen/generators/artifacts/operations.d.ts +1 -1
- package/build/codegen/generators/artifacts/utils.d.ts +1 -1
- package/build/codegen/generators/typescript/addReferencedInputTypes.d.ts +1 -1
- package/build/codegen/generators/typescript/inlineType.d.ts +1 -1
- package/build/codegen/generators/typescript/typeReference.d.ts +1 -1
- package/build/codegen/generators/typescript/types.d.ts +1 -1
- package/build/codegen/index.d.ts +1 -1
- package/build/codegen/transforms/composeQueries.d.ts +1 -1
- package/build/codegen/transforms/fragmentVariables.d.ts +2 -2
- package/build/codegen/utils/moduleExport.d.ts +1 -1
- package/build/codegen-cjs/index.js +1834 -1300
- package/build/codegen-esm/index.js +1834 -1300
- package/build/lib/config.d.ts +6 -6
- package/build/lib/fs.d.ts +3 -3
- package/build/lib/graphql.d.ts +1 -1
- package/build/lib/imports.d.ts +1 -1
- package/build/lib/parse.d.ts +1 -1
- package/build/lib/pipeline.d.ts +1 -1
- package/build/lib/types.d.ts +5 -5
- package/build/lib/walk.d.ts +2 -2
- package/build/lib-cjs/index.js +1920 -1378
- package/build/lib-esm/index.js +1920 -1378
- package/build/runtime/cache/cache.d.ts +1 -1
- package/build/runtime/cache/storage.d.ts +12 -12
- package/build/runtime/lib/config.d.ts +4 -4
- package/build/runtime/lib/network.d.ts +5 -5
- package/build/runtime/lib/networkUtils.d.ts +1 -1
- package/build/runtime/lib/types.d.ts +23 -23
- package/build/runtime-cjs/cache/cache.d.ts +1 -1
- package/build/runtime-cjs/cache/cache.js +4 -2
- package/build/runtime-cjs/cache/storage.d.ts +12 -12
- package/build/runtime-cjs/lib/config.d.ts +4 -4
- package/build/runtime-cjs/lib/network.d.ts +5 -5
- package/build/runtime-cjs/lib/networkUtils.d.ts +1 -1
- package/build/runtime-cjs/lib/types.d.ts +23 -23
- package/build/runtime-esm/cache/cache.d.ts +1 -1
- package/build/runtime-esm/cache/cache.js +4 -2
- package/build/runtime-esm/cache/storage.d.ts +12 -12
- package/build/runtime-esm/lib/config.d.ts +4 -4
- package/build/runtime-esm/lib/network.d.ts +5 -5
- package/build/runtime-esm/lib/networkUtils.d.ts +1 -1
- package/build/runtime-esm/lib/types.d.ts +23 -23
- package/build/test/index.d.ts +1 -1
- package/build/test-cjs/index.js +1834 -1300
- package/build/test-esm/index.js +1834 -1300
- package/build/vite/ast.d.ts +5 -5
- package/build/vite/imports.d.ts +1 -1
- package/build/vite-cjs/index.js +3533 -2237
- package/build/vite-esm/index.js +3533 -2237
- package/package.json +6 -6
|
@@ -103,5 +103,5 @@ declare class CacheInternal {
|
|
|
103
103
|
collectGarbage(): void;
|
|
104
104
|
}
|
|
105
105
|
export declare const rootID = "_ROOT_";
|
|
106
|
-
export
|
|
106
|
+
export type LinkedList<_Result = string> = (_Result | null | LinkedList<_Result>)[];
|
|
107
107
|
export {};
|
|
@@ -52,15 +52,15 @@ export declare class Layer {
|
|
|
52
52
|
writeLayer(layer: Layer): void;
|
|
53
53
|
private addFieldOperation;
|
|
54
54
|
}
|
|
55
|
-
|
|
56
|
-
|
|
55
|
+
type GraphQLField = GraphQLValue | LinkedList;
|
|
56
|
+
type EntityMap<_Value> = {
|
|
57
57
|
[id: string]: {
|
|
58
58
|
[field: string]: _Value;
|
|
59
59
|
};
|
|
60
60
|
};
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
61
|
+
type EntityFieldMap = EntityMap<GraphQLField>;
|
|
62
|
+
type LinkMap = EntityMap<string | null | LinkedList>;
|
|
63
|
+
type OperationMap = {
|
|
64
64
|
[id: string]: {
|
|
65
65
|
deleted?: boolean;
|
|
66
66
|
undoDeletesInList?: string[];
|
|
@@ -69,22 +69,22 @@ declare type OperationMap = {
|
|
|
69
69
|
};
|
|
70
70
|
};
|
|
71
71
|
};
|
|
72
|
-
|
|
73
|
-
|
|
72
|
+
type LinkedList<_Result = string> = (_Result | null | LinkedList<_Result>)[];
|
|
73
|
+
type InsertOperation = {
|
|
74
74
|
kind: OperationKind.insert;
|
|
75
75
|
location: OperationLocation;
|
|
76
76
|
id: string;
|
|
77
77
|
};
|
|
78
|
-
|
|
78
|
+
type RemoveOperation = {
|
|
79
79
|
kind: OperationKind.remove;
|
|
80
80
|
id: string;
|
|
81
81
|
};
|
|
82
|
-
|
|
82
|
+
type DeleteOperation = {
|
|
83
83
|
kind: OperationKind.delete;
|
|
84
84
|
target: string;
|
|
85
85
|
};
|
|
86
|
-
|
|
87
|
-
|
|
86
|
+
type ListOperation = InsertOperation | RemoveOperation;
|
|
87
|
+
type Operation = ListOperation | DeleteOperation;
|
|
88
88
|
export declare enum OperationLocation {
|
|
89
89
|
start = "start",
|
|
90
90
|
end = "end"
|
|
@@ -94,5 +94,5 @@ export declare enum OperationKind {
|
|
|
94
94
|
insert = "insert",
|
|
95
95
|
remove = "remove"
|
|
96
96
|
}
|
|
97
|
-
export
|
|
97
|
+
export type LayerID = number;
|
|
98
98
|
export {};
|
|
@@ -7,7 +7,7 @@ export declare function defaultConfigValues(file: ConfigFile): ConfigFile;
|
|
|
7
7
|
export declare function keyFieldsForType(configFile: ConfigFile, type: string): string[];
|
|
8
8
|
export declare function computeID(configFile: ConfigFile, type: string, data: any): string;
|
|
9
9
|
export declare function getCurrentConfig(): Promise<ConfigFile>;
|
|
10
|
-
export
|
|
10
|
+
export type ConfigFile = {
|
|
11
11
|
/**
|
|
12
12
|
* A glob pointing to all files that houdini should consider. Note, this must include .js files
|
|
13
13
|
* for inline queries to work
|
|
@@ -115,10 +115,10 @@ export declare type ConfigFile = {
|
|
|
115
115
|
*/
|
|
116
116
|
projectDir?: string;
|
|
117
117
|
};
|
|
118
|
-
|
|
118
|
+
type ScalarMap = {
|
|
119
119
|
[typeName: string]: ScalarSpec;
|
|
120
120
|
};
|
|
121
|
-
export
|
|
121
|
+
export type TypeConfig = {
|
|
122
122
|
[typeName: string]: {
|
|
123
123
|
keys?: string[];
|
|
124
124
|
resolve: {
|
|
@@ -129,7 +129,7 @@ export declare type TypeConfig = {
|
|
|
129
129
|
};
|
|
130
130
|
};
|
|
131
131
|
};
|
|
132
|
-
export
|
|
132
|
+
export type ScalarSpec = {
|
|
133
133
|
type: string;
|
|
134
134
|
marshal?: (val: any) => any;
|
|
135
135
|
unmarshal?: (val: any) => any;
|
|
@@ -11,7 +11,7 @@ export declare class HoudiniClient {
|
|
|
11
11
|
export declare class Environment extends HoudiniClient {
|
|
12
12
|
constructor(...args: ConstructorParameters<typeof HoudiniClient>);
|
|
13
13
|
}
|
|
14
|
-
export
|
|
14
|
+
export type SubscriptionHandler = {
|
|
15
15
|
subscribe: (payload: {
|
|
16
16
|
query: string;
|
|
17
17
|
variables?: {};
|
|
@@ -26,14 +26,14 @@ export declare type SubscriptionHandler = {
|
|
|
26
26
|
complete: () => void;
|
|
27
27
|
}) => () => void;
|
|
28
28
|
};
|
|
29
|
-
export
|
|
29
|
+
export type FetchParams = {
|
|
30
30
|
text: string;
|
|
31
31
|
hash: string;
|
|
32
32
|
variables: {
|
|
33
33
|
[key: string]: any;
|
|
34
34
|
};
|
|
35
35
|
};
|
|
36
|
-
export
|
|
36
|
+
export type FetchContext = {
|
|
37
37
|
fetch: typeof window.fetch;
|
|
38
38
|
metadata?: App.Metadata | null;
|
|
39
39
|
session: App.Session | null;
|
|
@@ -50,10 +50,10 @@ export declare type FetchContext = {
|
|
|
50
50
|
* ```
|
|
51
51
|
*
|
|
52
52
|
*/
|
|
53
|
-
export
|
|
53
|
+
export type RequestHandlerArgs = FetchContext & FetchParams & {
|
|
54
54
|
session?: App.Session;
|
|
55
55
|
};
|
|
56
|
-
export
|
|
56
|
+
export type RequestHandler<_Data> = (args: RequestHandlerArgs) => Promise<RequestPayload<_Data>>;
|
|
57
57
|
export declare function executeQuery<_Data extends GraphQLObject, _Input extends {}>({ client, artifact, variables, session, setFetching, cached, fetch, metadata, }: {
|
|
58
58
|
client: HoudiniClient;
|
|
59
59
|
artifact: QueryArtifact | MutationArtifact;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare function isExtractableFile(value: any): value is ExtractableFile;
|
|
2
|
-
|
|
2
|
+
type ExtractableFile = File | Blob;
|
|
3
3
|
/** @typedef {import("./isExtractableFile.mjs").default} isExtractableFile */
|
|
4
4
|
export declare function extractFiles(value: any): {
|
|
5
5
|
clone: any;
|
|
@@ -4,15 +4,15 @@ export declare enum CachePolicy {
|
|
|
4
4
|
NetworkOnly = "NetworkOnly",
|
|
5
5
|
CacheAndNetwork = "CacheAndNetwork"
|
|
6
6
|
}
|
|
7
|
-
export
|
|
7
|
+
export type Fragment<_Result> = {
|
|
8
8
|
readonly shape?: _Result;
|
|
9
9
|
};
|
|
10
|
-
export
|
|
10
|
+
export type Operation<_Result, _Input> = {
|
|
11
11
|
readonly result: _Result;
|
|
12
12
|
readonly input: _Input;
|
|
13
13
|
};
|
|
14
|
-
export
|
|
15
|
-
export
|
|
14
|
+
export type Maybe<T> = T | null | undefined;
|
|
15
|
+
export type DocumentArtifact = FragmentArtifact | QueryArtifact | MutationArtifact | SubscriptionArtifact;
|
|
16
16
|
export declare enum ArtifactKind {
|
|
17
17
|
Query = "HoudiniQuery",
|
|
18
18
|
Subscription = "HoudiniSubscription",
|
|
@@ -23,19 +23,19 @@ export declare const CompiledFragmentKind = ArtifactKind.Fragment;
|
|
|
23
23
|
export declare const CompiledMutationKind = ArtifactKind.Mutation;
|
|
24
24
|
export declare const CompiledQueryKind = ArtifactKind.Query;
|
|
25
25
|
export declare const CompiledSubscriptionKind = ArtifactKind.Subscription;
|
|
26
|
-
export
|
|
27
|
-
export
|
|
26
|
+
export type CompiledDocumentKind = ArtifactKind;
|
|
27
|
+
export type QueryArtifact = BaseCompiledDocument & {
|
|
28
28
|
kind: ArtifactKind.Query;
|
|
29
29
|
policy?: CachePolicy;
|
|
30
30
|
partial?: boolean;
|
|
31
31
|
};
|
|
32
|
-
export
|
|
32
|
+
export type MutationArtifact = BaseCompiledDocument & {
|
|
33
33
|
kind: ArtifactKind.Mutation;
|
|
34
34
|
};
|
|
35
|
-
export
|
|
35
|
+
export type FragmentArtifact = BaseCompiledDocument & {
|
|
36
36
|
kind: ArtifactKind.Fragment;
|
|
37
37
|
};
|
|
38
|
-
export
|
|
38
|
+
export type SubscriptionArtifact = BaseCompiledDocument & {
|
|
39
39
|
kind: ArtifactKind.Subscription;
|
|
40
40
|
};
|
|
41
41
|
export declare enum RefetchUpdateMode {
|
|
@@ -43,11 +43,11 @@ export declare enum RefetchUpdateMode {
|
|
|
43
43
|
prepend = "prepend",
|
|
44
44
|
replace = "replace"
|
|
45
45
|
}
|
|
46
|
-
export
|
|
46
|
+
export type InputObject = {
|
|
47
47
|
fields: Record<string, string>;
|
|
48
48
|
types: Record<string, Record<string, string>>;
|
|
49
49
|
};
|
|
50
|
-
export
|
|
50
|
+
export type BaseCompiledDocument = {
|
|
51
51
|
name: string;
|
|
52
52
|
raw: string;
|
|
53
53
|
hash: string;
|
|
@@ -66,13 +66,13 @@ export declare type BaseCompiledDocument = {
|
|
|
66
66
|
direction?: 'forward' | 'backwards';
|
|
67
67
|
};
|
|
68
68
|
};
|
|
69
|
-
export
|
|
69
|
+
export type HoudiniFetchContext = {
|
|
70
70
|
variables: () => {};
|
|
71
71
|
};
|
|
72
|
-
|
|
72
|
+
type Filter = {
|
|
73
73
|
[key: string]: string | boolean | number;
|
|
74
74
|
};
|
|
75
|
-
export
|
|
75
|
+
export type ListWhen = {
|
|
76
76
|
must?: Filter;
|
|
77
77
|
must_not?: Filter;
|
|
78
78
|
};
|
|
@@ -90,7 +90,7 @@ export declare enum DataSource {
|
|
|
90
90
|
*/
|
|
91
91
|
Ssr = "ssr"
|
|
92
92
|
}
|
|
93
|
-
export
|
|
93
|
+
export type MutationOperation = {
|
|
94
94
|
action: 'insert' | 'remove' | 'delete' | 'toggle';
|
|
95
95
|
list?: string;
|
|
96
96
|
type?: string;
|
|
@@ -102,11 +102,11 @@ export declare type MutationOperation = {
|
|
|
102
102
|
target?: 'all';
|
|
103
103
|
when?: ListWhen;
|
|
104
104
|
};
|
|
105
|
-
export
|
|
105
|
+
export type GraphQLObject = {
|
|
106
106
|
[key: string]: GraphQLValue;
|
|
107
107
|
};
|
|
108
|
-
export
|
|
109
|
-
export
|
|
108
|
+
export type GraphQLValue = number | string | boolean | null | GraphQLObject | GraphQLValue[] | undefined;
|
|
109
|
+
export type SubscriptionSelection = {
|
|
110
110
|
fields?: {
|
|
111
111
|
[fieldName: string]: {
|
|
112
112
|
type: string;
|
|
@@ -138,19 +138,19 @@ export declare type SubscriptionSelection = {
|
|
|
138
138
|
};
|
|
139
139
|
};
|
|
140
140
|
};
|
|
141
|
-
export
|
|
141
|
+
export type SubscriptionSpec = {
|
|
142
142
|
rootType: string;
|
|
143
143
|
selection: SubscriptionSelection;
|
|
144
144
|
set: (data: any) => void;
|
|
145
145
|
parentID?: string;
|
|
146
146
|
variables?: () => any;
|
|
147
147
|
};
|
|
148
|
-
export
|
|
148
|
+
export type FetchQueryResult<_Data> = {
|
|
149
149
|
result: RequestPayload<_Data | null>;
|
|
150
150
|
source: DataSource | null;
|
|
151
151
|
partial: boolean;
|
|
152
152
|
};
|
|
153
|
-
export
|
|
153
|
+
export type QueryResult<_Data, _Input, _Extra = {}> = {
|
|
154
154
|
data: _Data | null;
|
|
155
155
|
errors: {
|
|
156
156
|
message: string;
|
|
@@ -160,13 +160,13 @@ export declare type QueryResult<_Data, _Input, _Extra = {}> = {
|
|
|
160
160
|
source: DataSource | null;
|
|
161
161
|
variables: _Input;
|
|
162
162
|
} & _Extra;
|
|
163
|
-
export
|
|
163
|
+
export type RequestPayload<_Data = any> = {
|
|
164
164
|
data: _Data;
|
|
165
165
|
errors: {
|
|
166
166
|
message: string;
|
|
167
167
|
}[];
|
|
168
168
|
};
|
|
169
|
-
export
|
|
169
|
+
export type RequestPayloadMagic<_Data = any> = {
|
|
170
170
|
ssr: boolean;
|
|
171
171
|
body: RequestPayload<_Data>;
|
|
172
172
|
};
|
|
@@ -103,5 +103,5 @@ declare class CacheInternal {
|
|
|
103
103
|
collectGarbage(): void;
|
|
104
104
|
}
|
|
105
105
|
export declare const rootID = "_ROOT_";
|
|
106
|
-
export
|
|
106
|
+
export type LinkedList<_Result = string> = (_Result | null | LinkedList<_Result>)[];
|
|
107
107
|
export {};
|
|
@@ -136,10 +136,12 @@ class CacheInternal {
|
|
|
136
136
|
this.lists = lists;
|
|
137
137
|
this.cache = cache;
|
|
138
138
|
this.lifetimes = lifetimes;
|
|
139
|
+
this._disabled = typeof globalThis.window === "undefined";
|
|
139
140
|
try {
|
|
140
|
-
|
|
141
|
+
if (process.env.HOUDINI_TEST === "true") {
|
|
142
|
+
this._disabled = false;
|
|
143
|
+
}
|
|
141
144
|
} catch {
|
|
142
|
-
this._disabled = typeof globalThis.window === "undefined";
|
|
143
145
|
}
|
|
144
146
|
}
|
|
145
147
|
setConfig(config) {
|
|
@@ -52,15 +52,15 @@ export declare class Layer {
|
|
|
52
52
|
writeLayer(layer: Layer): void;
|
|
53
53
|
private addFieldOperation;
|
|
54
54
|
}
|
|
55
|
-
|
|
56
|
-
|
|
55
|
+
type GraphQLField = GraphQLValue | LinkedList;
|
|
56
|
+
type EntityMap<_Value> = {
|
|
57
57
|
[id: string]: {
|
|
58
58
|
[field: string]: _Value;
|
|
59
59
|
};
|
|
60
60
|
};
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
61
|
+
type EntityFieldMap = EntityMap<GraphQLField>;
|
|
62
|
+
type LinkMap = EntityMap<string | null | LinkedList>;
|
|
63
|
+
type OperationMap = {
|
|
64
64
|
[id: string]: {
|
|
65
65
|
deleted?: boolean;
|
|
66
66
|
undoDeletesInList?: string[];
|
|
@@ -69,22 +69,22 @@ declare type OperationMap = {
|
|
|
69
69
|
};
|
|
70
70
|
};
|
|
71
71
|
};
|
|
72
|
-
|
|
73
|
-
|
|
72
|
+
type LinkedList<_Result = string> = (_Result | null | LinkedList<_Result>)[];
|
|
73
|
+
type InsertOperation = {
|
|
74
74
|
kind: OperationKind.insert;
|
|
75
75
|
location: OperationLocation;
|
|
76
76
|
id: string;
|
|
77
77
|
};
|
|
78
|
-
|
|
78
|
+
type RemoveOperation = {
|
|
79
79
|
kind: OperationKind.remove;
|
|
80
80
|
id: string;
|
|
81
81
|
};
|
|
82
|
-
|
|
82
|
+
type DeleteOperation = {
|
|
83
83
|
kind: OperationKind.delete;
|
|
84
84
|
target: string;
|
|
85
85
|
};
|
|
86
|
-
|
|
87
|
-
|
|
86
|
+
type ListOperation = InsertOperation | RemoveOperation;
|
|
87
|
+
type Operation = ListOperation | DeleteOperation;
|
|
88
88
|
export declare enum OperationLocation {
|
|
89
89
|
start = "start",
|
|
90
90
|
end = "end"
|
|
@@ -94,5 +94,5 @@ export declare enum OperationKind {
|
|
|
94
94
|
insert = "insert",
|
|
95
95
|
remove = "remove"
|
|
96
96
|
}
|
|
97
|
-
export
|
|
97
|
+
export type LayerID = number;
|
|
98
98
|
export {};
|
|
@@ -7,7 +7,7 @@ export declare function defaultConfigValues(file: ConfigFile): ConfigFile;
|
|
|
7
7
|
export declare function keyFieldsForType(configFile: ConfigFile, type: string): string[];
|
|
8
8
|
export declare function computeID(configFile: ConfigFile, type: string, data: any): string;
|
|
9
9
|
export declare function getCurrentConfig(): Promise<ConfigFile>;
|
|
10
|
-
export
|
|
10
|
+
export type ConfigFile = {
|
|
11
11
|
/**
|
|
12
12
|
* A glob pointing to all files that houdini should consider. Note, this must include .js files
|
|
13
13
|
* for inline queries to work
|
|
@@ -115,10 +115,10 @@ export declare type ConfigFile = {
|
|
|
115
115
|
*/
|
|
116
116
|
projectDir?: string;
|
|
117
117
|
};
|
|
118
|
-
|
|
118
|
+
type ScalarMap = {
|
|
119
119
|
[typeName: string]: ScalarSpec;
|
|
120
120
|
};
|
|
121
|
-
export
|
|
121
|
+
export type TypeConfig = {
|
|
122
122
|
[typeName: string]: {
|
|
123
123
|
keys?: string[];
|
|
124
124
|
resolve: {
|
|
@@ -129,7 +129,7 @@ export declare type TypeConfig = {
|
|
|
129
129
|
};
|
|
130
130
|
};
|
|
131
131
|
};
|
|
132
|
-
export
|
|
132
|
+
export type ScalarSpec = {
|
|
133
133
|
type: string;
|
|
134
134
|
marshal?: (val: any) => any;
|
|
135
135
|
unmarshal?: (val: any) => any;
|
|
@@ -11,7 +11,7 @@ export declare class HoudiniClient {
|
|
|
11
11
|
export declare class Environment extends HoudiniClient {
|
|
12
12
|
constructor(...args: ConstructorParameters<typeof HoudiniClient>);
|
|
13
13
|
}
|
|
14
|
-
export
|
|
14
|
+
export type SubscriptionHandler = {
|
|
15
15
|
subscribe: (payload: {
|
|
16
16
|
query: string;
|
|
17
17
|
variables?: {};
|
|
@@ -26,14 +26,14 @@ export declare type SubscriptionHandler = {
|
|
|
26
26
|
complete: () => void;
|
|
27
27
|
}) => () => void;
|
|
28
28
|
};
|
|
29
|
-
export
|
|
29
|
+
export type FetchParams = {
|
|
30
30
|
text: string;
|
|
31
31
|
hash: string;
|
|
32
32
|
variables: {
|
|
33
33
|
[key: string]: any;
|
|
34
34
|
};
|
|
35
35
|
};
|
|
36
|
-
export
|
|
36
|
+
export type FetchContext = {
|
|
37
37
|
fetch: typeof window.fetch;
|
|
38
38
|
metadata?: App.Metadata | null;
|
|
39
39
|
session: App.Session | null;
|
|
@@ -50,10 +50,10 @@ export declare type FetchContext = {
|
|
|
50
50
|
* ```
|
|
51
51
|
*
|
|
52
52
|
*/
|
|
53
|
-
export
|
|
53
|
+
export type RequestHandlerArgs = FetchContext & FetchParams & {
|
|
54
54
|
session?: App.Session;
|
|
55
55
|
};
|
|
56
|
-
export
|
|
56
|
+
export type RequestHandler<_Data> = (args: RequestHandlerArgs) => Promise<RequestPayload<_Data>>;
|
|
57
57
|
export declare function executeQuery<_Data extends GraphQLObject, _Input extends {}>({ client, artifact, variables, session, setFetching, cached, fetch, metadata, }: {
|
|
58
58
|
client: HoudiniClient;
|
|
59
59
|
artifact: QueryArtifact | MutationArtifact;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare function isExtractableFile(value: any): value is ExtractableFile;
|
|
2
|
-
|
|
2
|
+
type ExtractableFile = File | Blob;
|
|
3
3
|
/** @typedef {import("./isExtractableFile.mjs").default} isExtractableFile */
|
|
4
4
|
export declare function extractFiles(value: any): {
|
|
5
5
|
clone: any;
|
|
@@ -4,15 +4,15 @@ export declare enum CachePolicy {
|
|
|
4
4
|
NetworkOnly = "NetworkOnly",
|
|
5
5
|
CacheAndNetwork = "CacheAndNetwork"
|
|
6
6
|
}
|
|
7
|
-
export
|
|
7
|
+
export type Fragment<_Result> = {
|
|
8
8
|
readonly shape?: _Result;
|
|
9
9
|
};
|
|
10
|
-
export
|
|
10
|
+
export type Operation<_Result, _Input> = {
|
|
11
11
|
readonly result: _Result;
|
|
12
12
|
readonly input: _Input;
|
|
13
13
|
};
|
|
14
|
-
export
|
|
15
|
-
export
|
|
14
|
+
export type Maybe<T> = T | null | undefined;
|
|
15
|
+
export type DocumentArtifact = FragmentArtifact | QueryArtifact | MutationArtifact | SubscriptionArtifact;
|
|
16
16
|
export declare enum ArtifactKind {
|
|
17
17
|
Query = "HoudiniQuery",
|
|
18
18
|
Subscription = "HoudiniSubscription",
|
|
@@ -23,19 +23,19 @@ export declare const CompiledFragmentKind = ArtifactKind.Fragment;
|
|
|
23
23
|
export declare const CompiledMutationKind = ArtifactKind.Mutation;
|
|
24
24
|
export declare const CompiledQueryKind = ArtifactKind.Query;
|
|
25
25
|
export declare const CompiledSubscriptionKind = ArtifactKind.Subscription;
|
|
26
|
-
export
|
|
27
|
-
export
|
|
26
|
+
export type CompiledDocumentKind = ArtifactKind;
|
|
27
|
+
export type QueryArtifact = BaseCompiledDocument & {
|
|
28
28
|
kind: ArtifactKind.Query;
|
|
29
29
|
policy?: CachePolicy;
|
|
30
30
|
partial?: boolean;
|
|
31
31
|
};
|
|
32
|
-
export
|
|
32
|
+
export type MutationArtifact = BaseCompiledDocument & {
|
|
33
33
|
kind: ArtifactKind.Mutation;
|
|
34
34
|
};
|
|
35
|
-
export
|
|
35
|
+
export type FragmentArtifact = BaseCompiledDocument & {
|
|
36
36
|
kind: ArtifactKind.Fragment;
|
|
37
37
|
};
|
|
38
|
-
export
|
|
38
|
+
export type SubscriptionArtifact = BaseCompiledDocument & {
|
|
39
39
|
kind: ArtifactKind.Subscription;
|
|
40
40
|
};
|
|
41
41
|
export declare enum RefetchUpdateMode {
|
|
@@ -43,11 +43,11 @@ export declare enum RefetchUpdateMode {
|
|
|
43
43
|
prepend = "prepend",
|
|
44
44
|
replace = "replace"
|
|
45
45
|
}
|
|
46
|
-
export
|
|
46
|
+
export type InputObject = {
|
|
47
47
|
fields: Record<string, string>;
|
|
48
48
|
types: Record<string, Record<string, string>>;
|
|
49
49
|
};
|
|
50
|
-
export
|
|
50
|
+
export type BaseCompiledDocument = {
|
|
51
51
|
name: string;
|
|
52
52
|
raw: string;
|
|
53
53
|
hash: string;
|
|
@@ -66,13 +66,13 @@ export declare type BaseCompiledDocument = {
|
|
|
66
66
|
direction?: 'forward' | 'backwards';
|
|
67
67
|
};
|
|
68
68
|
};
|
|
69
|
-
export
|
|
69
|
+
export type HoudiniFetchContext = {
|
|
70
70
|
variables: () => {};
|
|
71
71
|
};
|
|
72
|
-
|
|
72
|
+
type Filter = {
|
|
73
73
|
[key: string]: string | boolean | number;
|
|
74
74
|
};
|
|
75
|
-
export
|
|
75
|
+
export type ListWhen = {
|
|
76
76
|
must?: Filter;
|
|
77
77
|
must_not?: Filter;
|
|
78
78
|
};
|
|
@@ -90,7 +90,7 @@ export declare enum DataSource {
|
|
|
90
90
|
*/
|
|
91
91
|
Ssr = "ssr"
|
|
92
92
|
}
|
|
93
|
-
export
|
|
93
|
+
export type MutationOperation = {
|
|
94
94
|
action: 'insert' | 'remove' | 'delete' | 'toggle';
|
|
95
95
|
list?: string;
|
|
96
96
|
type?: string;
|
|
@@ -102,11 +102,11 @@ export declare type MutationOperation = {
|
|
|
102
102
|
target?: 'all';
|
|
103
103
|
when?: ListWhen;
|
|
104
104
|
};
|
|
105
|
-
export
|
|
105
|
+
export type GraphQLObject = {
|
|
106
106
|
[key: string]: GraphQLValue;
|
|
107
107
|
};
|
|
108
|
-
export
|
|
109
|
-
export
|
|
108
|
+
export type GraphQLValue = number | string | boolean | null | GraphQLObject | GraphQLValue[] | undefined;
|
|
109
|
+
export type SubscriptionSelection = {
|
|
110
110
|
fields?: {
|
|
111
111
|
[fieldName: string]: {
|
|
112
112
|
type: string;
|
|
@@ -138,19 +138,19 @@ export declare type SubscriptionSelection = {
|
|
|
138
138
|
};
|
|
139
139
|
};
|
|
140
140
|
};
|
|
141
|
-
export
|
|
141
|
+
export type SubscriptionSpec = {
|
|
142
142
|
rootType: string;
|
|
143
143
|
selection: SubscriptionSelection;
|
|
144
144
|
set: (data: any) => void;
|
|
145
145
|
parentID?: string;
|
|
146
146
|
variables?: () => any;
|
|
147
147
|
};
|
|
148
|
-
export
|
|
148
|
+
export type FetchQueryResult<_Data> = {
|
|
149
149
|
result: RequestPayload<_Data | null>;
|
|
150
150
|
source: DataSource | null;
|
|
151
151
|
partial: boolean;
|
|
152
152
|
};
|
|
153
|
-
export
|
|
153
|
+
export type QueryResult<_Data, _Input, _Extra = {}> = {
|
|
154
154
|
data: _Data | null;
|
|
155
155
|
errors: {
|
|
156
156
|
message: string;
|
|
@@ -160,13 +160,13 @@ export declare type QueryResult<_Data, _Input, _Extra = {}> = {
|
|
|
160
160
|
source: DataSource | null;
|
|
161
161
|
variables: _Input;
|
|
162
162
|
} & _Extra;
|
|
163
|
-
export
|
|
163
|
+
export type RequestPayload<_Data = any> = {
|
|
164
164
|
data: _Data;
|
|
165
165
|
errors: {
|
|
166
166
|
message: string;
|
|
167
167
|
}[];
|
|
168
168
|
};
|
|
169
|
-
export
|
|
169
|
+
export type RequestPayloadMagic<_Data = any> = {
|
|
170
170
|
ssr: boolean;
|
|
171
171
|
body: RequestPayload<_Data>;
|
|
172
172
|
};
|
|
@@ -103,5 +103,5 @@ declare class CacheInternal {
|
|
|
103
103
|
collectGarbage(): void;
|
|
104
104
|
}
|
|
105
105
|
export declare const rootID = "_ROOT_";
|
|
106
|
-
export
|
|
106
|
+
export type LinkedList<_Result = string> = (_Result | null | LinkedList<_Result>)[];
|
|
107
107
|
export {};
|
|
@@ -112,10 +112,12 @@ class CacheInternal {
|
|
|
112
112
|
this.lists = lists;
|
|
113
113
|
this.cache = cache;
|
|
114
114
|
this.lifetimes = lifetimes;
|
|
115
|
+
this._disabled = typeof globalThis.window === "undefined";
|
|
115
116
|
try {
|
|
116
|
-
|
|
117
|
+
if (process.env.HOUDINI_TEST === "true") {
|
|
118
|
+
this._disabled = false;
|
|
119
|
+
}
|
|
117
120
|
} catch {
|
|
118
|
-
this._disabled = typeof globalThis.window === "undefined";
|
|
119
121
|
}
|
|
120
122
|
}
|
|
121
123
|
setConfig(config) {
|
|
@@ -52,15 +52,15 @@ export declare class Layer {
|
|
|
52
52
|
writeLayer(layer: Layer): void;
|
|
53
53
|
private addFieldOperation;
|
|
54
54
|
}
|
|
55
|
-
|
|
56
|
-
|
|
55
|
+
type GraphQLField = GraphQLValue | LinkedList;
|
|
56
|
+
type EntityMap<_Value> = {
|
|
57
57
|
[id: string]: {
|
|
58
58
|
[field: string]: _Value;
|
|
59
59
|
};
|
|
60
60
|
};
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
61
|
+
type EntityFieldMap = EntityMap<GraphQLField>;
|
|
62
|
+
type LinkMap = EntityMap<string | null | LinkedList>;
|
|
63
|
+
type OperationMap = {
|
|
64
64
|
[id: string]: {
|
|
65
65
|
deleted?: boolean;
|
|
66
66
|
undoDeletesInList?: string[];
|
|
@@ -69,22 +69,22 @@ declare type OperationMap = {
|
|
|
69
69
|
};
|
|
70
70
|
};
|
|
71
71
|
};
|
|
72
|
-
|
|
73
|
-
|
|
72
|
+
type LinkedList<_Result = string> = (_Result | null | LinkedList<_Result>)[];
|
|
73
|
+
type InsertOperation = {
|
|
74
74
|
kind: OperationKind.insert;
|
|
75
75
|
location: OperationLocation;
|
|
76
76
|
id: string;
|
|
77
77
|
};
|
|
78
|
-
|
|
78
|
+
type RemoveOperation = {
|
|
79
79
|
kind: OperationKind.remove;
|
|
80
80
|
id: string;
|
|
81
81
|
};
|
|
82
|
-
|
|
82
|
+
type DeleteOperation = {
|
|
83
83
|
kind: OperationKind.delete;
|
|
84
84
|
target: string;
|
|
85
85
|
};
|
|
86
|
-
|
|
87
|
-
|
|
86
|
+
type ListOperation = InsertOperation | RemoveOperation;
|
|
87
|
+
type Operation = ListOperation | DeleteOperation;
|
|
88
88
|
export declare enum OperationLocation {
|
|
89
89
|
start = "start",
|
|
90
90
|
end = "end"
|
|
@@ -94,5 +94,5 @@ export declare enum OperationKind {
|
|
|
94
94
|
insert = "insert",
|
|
95
95
|
remove = "remove"
|
|
96
96
|
}
|
|
97
|
-
export
|
|
97
|
+
export type LayerID = number;
|
|
98
98
|
export {};
|