houdini 1.0.0-next.11 → 1.0.0-next.13
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 +9 -3
- package/build/cmd-esm/index.js +9 -3
- package/build/codegen/utils/flattenSelections.d.ts +1 -1
- package/build/codegen-cjs/index.js +7 -1
- package/build/codegen-esm/index.js +7 -1
- package/build/runtime/client/documentStore.d.ts +2 -1
- package/build/runtime-cjs/client/documentStore.d.ts +2 -1
- package/build/runtime-cjs/client/documentStore.js +6 -1
- package/build/runtime-cjs/client/plugins/cache.js +3 -3
- package/build/runtime-cjs/client/plugins/fetch.js +1 -1
- package/build/runtime-esm/client/documentStore.d.ts +2 -1
- package/build/runtime-esm/client/documentStore.js +6 -1
- package/build/runtime-esm/client/index.js +2 -2
- package/build/runtime-esm/client/plugins/cache.js +3 -3
- package/build/runtime-esm/client/plugins/fetch.js +1 -1
- package/build/test-cjs/index.js +7 -1
- package/build/test-esm/index.js +7 -1
- package/build/vite-cjs/index.js +7 -1
- package/build/vite-esm/index.js +7 -1
- package/package.json +1 -1
package/build/cmd-cjs/index.js
CHANGED
|
@@ -71201,7 +71201,13 @@ var FieldCollection = class {
|
|
|
71201
71201
|
if (fragment.selection.size === 0) {
|
|
71202
71202
|
return [];
|
|
71203
71203
|
}
|
|
71204
|
-
fragment.astNode
|
|
71204
|
+
fragment.astNode = {
|
|
71205
|
+
...fragment.astNode,
|
|
71206
|
+
selectionSet: {
|
|
71207
|
+
...fragment.astNode.selectionSet,
|
|
71208
|
+
selections: fragment.selection.toSelectionSet()
|
|
71209
|
+
}
|
|
71210
|
+
};
|
|
71205
71211
|
return [fragment.astNode];
|
|
71206
71212
|
}).concat(
|
|
71207
71213
|
Object.values(this.fields).map((field) => {
|
|
@@ -76507,8 +76513,8 @@ async function updatePackageJSON(targetPath) {
|
|
|
76507
76513
|
}
|
|
76508
76514
|
packageJSON.devDependencies = {
|
|
76509
76515
|
...packageJSON.devDependencies,
|
|
76510
|
-
houdini: "^1.0.0-next.
|
|
76511
|
-
"houdini-svelte": "^1.0.0-next.
|
|
76516
|
+
houdini: "^1.0.0-next.13",
|
|
76517
|
+
"houdini-svelte": "^1.0.0-next.13"
|
|
76512
76518
|
};
|
|
76513
76519
|
await fs_exports.writeFile(packagePath, JSON.stringify(packageJSON, null, 4));
|
|
76514
76520
|
}
|
package/build/cmd-esm/index.js
CHANGED
|
@@ -71206,7 +71206,13 @@ var FieldCollection = class {
|
|
|
71206
71206
|
if (fragment.selection.size === 0) {
|
|
71207
71207
|
return [];
|
|
71208
71208
|
}
|
|
71209
|
-
fragment.astNode
|
|
71209
|
+
fragment.astNode = {
|
|
71210
|
+
...fragment.astNode,
|
|
71211
|
+
selectionSet: {
|
|
71212
|
+
...fragment.astNode.selectionSet,
|
|
71213
|
+
selections: fragment.selection.toSelectionSet()
|
|
71214
|
+
}
|
|
71215
|
+
};
|
|
71210
71216
|
return [fragment.astNode];
|
|
71211
71217
|
}).concat(
|
|
71212
71218
|
Object.values(this.fields).map((field) => {
|
|
@@ -76512,8 +76518,8 @@ async function updatePackageJSON(targetPath) {
|
|
|
76512
76518
|
}
|
|
76513
76519
|
packageJSON.devDependencies = {
|
|
76514
76520
|
...packageJSON.devDependencies,
|
|
76515
|
-
houdini: "^1.0.0-next.
|
|
76516
|
-
"houdini-svelte": "^1.0.0-next.
|
|
76521
|
+
houdini: "^1.0.0-next.13",
|
|
76522
|
+
"houdini-svelte": "^1.0.0-next.13"
|
|
76517
76523
|
};
|
|
76518
76524
|
await fs_exports.writeFile(packagePath, JSON.stringify(packageJSON, null, 4));
|
|
76519
76525
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import type graphql from 'graphql';
|
|
2
2
|
import type { Config } from '../../lib';
|
|
3
3
|
export declare function flattenSelections({ config, filepath, selections, fragmentDefinitions, applyFragments, ignoreMaskDisable, }: {
|
|
4
4
|
config: Config;
|
|
@@ -54929,7 +54929,13 @@ var FieldCollection = class {
|
|
|
54929
54929
|
if (fragment.selection.size === 0) {
|
|
54930
54930
|
return [];
|
|
54931
54931
|
}
|
|
54932
|
-
fragment.astNode
|
|
54932
|
+
fragment.astNode = {
|
|
54933
|
+
...fragment.astNode,
|
|
54934
|
+
selectionSet: {
|
|
54935
|
+
...fragment.astNode.selectionSet,
|
|
54936
|
+
selections: fragment.selection.toSelectionSet()
|
|
54937
|
+
}
|
|
54938
|
+
};
|
|
54933
54939
|
return [fragment.astNode];
|
|
54934
54940
|
}).concat(
|
|
54935
54941
|
Object.values(this.fields).map((field) => {
|
|
@@ -54927,7 +54927,13 @@ var FieldCollection = class {
|
|
|
54927
54927
|
if (fragment.selection.size === 0) {
|
|
54928
54928
|
return [];
|
|
54929
54929
|
}
|
|
54930
|
-
fragment.astNode
|
|
54930
|
+
fragment.astNode = {
|
|
54931
|
+
...fragment.astNode,
|
|
54932
|
+
selectionSet: {
|
|
54933
|
+
...fragment.astNode.selectionSet,
|
|
54934
|
+
selections: fragment.selection.toSelectionSet()
|
|
54935
|
+
}
|
|
54936
|
+
};
|
|
54931
54937
|
return [fragment.astNode];
|
|
54932
54938
|
}).concat(
|
|
54933
54939
|
Object.values(this.fields).map((field) => {
|
|
@@ -14,7 +14,7 @@ export declare class DocumentStore<_Data extends GraphQLObject, _Input extends R
|
|
|
14
14
|
initialValue?: _Data | null;
|
|
15
15
|
fetching?: boolean;
|
|
16
16
|
});
|
|
17
|
-
send({ metadata, session, fetch, variables, policy, stuff, cacheParams, setup, }?: {
|
|
17
|
+
send({ metadata, session, fetch, variables, policy, stuff, cacheParams, setup, silenceEcho, }?: {
|
|
18
18
|
fetch?: Fetch;
|
|
19
19
|
variables?: Record<string, any> | null;
|
|
20
20
|
metadata?: App.Metadata | null;
|
|
@@ -23,6 +23,7 @@ export declare class DocumentStore<_Data extends GraphQLObject, _Input extends R
|
|
|
23
23
|
stuff?: Partial<App.Stuff>;
|
|
24
24
|
cacheParams?: ClientPluginContext['cacheParams'];
|
|
25
25
|
setup?: boolean;
|
|
26
|
+
silenceEcho?: boolean;
|
|
26
27
|
}): Promise<QueryResult<_Data, _Input>>;
|
|
27
28
|
}
|
|
28
29
|
declare function marshalVariables<_Data extends GraphQLObject, _Input extends {}>(ctx: ClientPluginContext): Record<string, any>;
|
|
@@ -14,7 +14,7 @@ export declare class DocumentStore<_Data extends GraphQLObject, _Input extends R
|
|
|
14
14
|
initialValue?: _Data | null;
|
|
15
15
|
fetching?: boolean;
|
|
16
16
|
});
|
|
17
|
-
send({ metadata, session, fetch, variables, policy, stuff, cacheParams, setup, }?: {
|
|
17
|
+
send({ metadata, session, fetch, variables, policy, stuff, cacheParams, setup, silenceEcho, }?: {
|
|
18
18
|
fetch?: Fetch;
|
|
19
19
|
variables?: Record<string, any> | null;
|
|
20
20
|
metadata?: App.Metadata | null;
|
|
@@ -23,6 +23,7 @@ export declare class DocumentStore<_Data extends GraphQLObject, _Input extends R
|
|
|
23
23
|
stuff?: Partial<App.Stuff>;
|
|
24
24
|
cacheParams?: ClientPluginContext['cacheParams'];
|
|
25
25
|
setup?: boolean;
|
|
26
|
+
silenceEcho?: boolean;
|
|
26
27
|
}): Promise<QueryResult<_Data, _Input>>;
|
|
27
28
|
}
|
|
28
29
|
declare function marshalVariables<_Data extends GraphQLObject, _Input extends {}>(ctx: ClientPluginContext): Record<string, any>;
|
|
@@ -87,7 +87,8 @@ class DocumentStore extends import_store.Writable {
|
|
|
87
87
|
policy,
|
|
88
88
|
stuff,
|
|
89
89
|
cacheParams,
|
|
90
|
-
setup = false
|
|
90
|
+
setup = false,
|
|
91
|
+
silenceEcho = false
|
|
91
92
|
} = {}) {
|
|
92
93
|
let context = new ClientPluginContextWrapper({
|
|
93
94
|
config: this.#configFile,
|
|
@@ -118,6 +119,7 @@ class DocumentStore extends import_store.Writable {
|
|
|
118
119
|
setup,
|
|
119
120
|
currentStep: 0,
|
|
120
121
|
index: 0,
|
|
122
|
+
silenceEcho,
|
|
121
123
|
promise: {
|
|
122
124
|
resolved: false,
|
|
123
125
|
resolve,
|
|
@@ -255,6 +257,9 @@ class DocumentStore extends import_store.Writable {
|
|
|
255
257
|
}
|
|
256
258
|
this.#lastContext = ctx.context.draft();
|
|
257
259
|
this.#lastVariables = this.#lastContext.stuff.inputs.marshaled;
|
|
260
|
+
if (ctx.silenceEcho && finalValue.data === this.state.data) {
|
|
261
|
+
return;
|
|
262
|
+
}
|
|
258
263
|
this.set(finalValue);
|
|
259
264
|
}
|
|
260
265
|
}
|
|
@@ -35,7 +35,7 @@ const cachePolicy = ({
|
|
|
35
35
|
cache: localCache = import_cache.default
|
|
36
36
|
}) => () => {
|
|
37
37
|
return {
|
|
38
|
-
network(ctx, { next, resolve, marshalVariables }) {
|
|
38
|
+
network(ctx, { initialValue, next, resolve, marshalVariables }) {
|
|
39
39
|
const { policy, artifact } = ctx;
|
|
40
40
|
let useCache = false;
|
|
41
41
|
if (enabled && artifact.kind === import_types.ArtifactKind.Query && !ctx.cacheParams?.disableRead) {
|
|
@@ -49,10 +49,10 @@ const cachePolicy = ({
|
|
|
49
49
|
return resolve(ctx, {
|
|
50
50
|
fetching: false,
|
|
51
51
|
variables: ctx.variables ?? null,
|
|
52
|
-
data: value.data,
|
|
52
|
+
data: allowed ? value.data : initialValue.data,
|
|
53
53
|
errors: null,
|
|
54
54
|
source: import_types.DataSource.Cache,
|
|
55
|
-
partial: value.partial,
|
|
55
|
+
partial: allowed ? value.partial : false,
|
|
56
56
|
stale: value.stale
|
|
57
57
|
});
|
|
58
58
|
}
|
|
@@ -67,7 +67,7 @@ const fetch = (target) => {
|
|
|
67
67
|
const defaultFetch = (url, params) => {
|
|
68
68
|
if (!url) {
|
|
69
69
|
throw new Error(
|
|
70
|
-
"Could not find configured client url. Please specify one in your
|
|
70
|
+
"Could not find configured client url. Please specify one in your HoudiniClient constructor."
|
|
71
71
|
);
|
|
72
72
|
}
|
|
73
73
|
return async ({ fetch: fetch2, text, variables }) => {
|
|
@@ -14,7 +14,7 @@ export declare class DocumentStore<_Data extends GraphQLObject, _Input extends R
|
|
|
14
14
|
initialValue?: _Data | null;
|
|
15
15
|
fetching?: boolean;
|
|
16
16
|
});
|
|
17
|
-
send({ metadata, session, fetch, variables, policy, stuff, cacheParams, setup, }?: {
|
|
17
|
+
send({ metadata, session, fetch, variables, policy, stuff, cacheParams, setup, silenceEcho, }?: {
|
|
18
18
|
fetch?: Fetch;
|
|
19
19
|
variables?: Record<string, any> | null;
|
|
20
20
|
metadata?: App.Metadata | null;
|
|
@@ -23,6 +23,7 @@ export declare class DocumentStore<_Data extends GraphQLObject, _Input extends R
|
|
|
23
23
|
stuff?: Partial<App.Stuff>;
|
|
24
24
|
cacheParams?: ClientPluginContext['cacheParams'];
|
|
25
25
|
setup?: boolean;
|
|
26
|
+
silenceEcho?: boolean;
|
|
26
27
|
}): Promise<QueryResult<_Data, _Input>>;
|
|
27
28
|
}
|
|
28
29
|
declare function marshalVariables<_Data extends GraphQLObject, _Input extends {}>(ctx: ClientPluginContext): Record<string, any>;
|
|
@@ -64,7 +64,8 @@ class DocumentStore extends Writable {
|
|
|
64
64
|
policy,
|
|
65
65
|
stuff,
|
|
66
66
|
cacheParams,
|
|
67
|
-
setup = false
|
|
67
|
+
setup = false,
|
|
68
|
+
silenceEcho = false
|
|
68
69
|
} = {}) {
|
|
69
70
|
let context = new ClientPluginContextWrapper({
|
|
70
71
|
config: this.#configFile,
|
|
@@ -95,6 +96,7 @@ class DocumentStore extends Writable {
|
|
|
95
96
|
setup,
|
|
96
97
|
currentStep: 0,
|
|
97
98
|
index: 0,
|
|
99
|
+
silenceEcho,
|
|
98
100
|
promise: {
|
|
99
101
|
resolved: false,
|
|
100
102
|
resolve,
|
|
@@ -232,6 +234,9 @@ class DocumentStore extends Writable {
|
|
|
232
234
|
}
|
|
233
235
|
this.#lastContext = ctx.context.draft();
|
|
234
236
|
this.#lastVariables = this.#lastContext.stuff.inputs.marshaled;
|
|
237
|
+
if (ctx.silenceEcho && finalValue.data === this.state.data) {
|
|
238
|
+
return;
|
|
239
|
+
}
|
|
235
240
|
this.set(finalValue);
|
|
236
241
|
}
|
|
237
242
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { flatten } from "../lib/flatten";
|
|
2
2
|
import { DocumentStore } from "./documentStore";
|
|
3
3
|
import {
|
|
4
|
-
fetchParams as fetchParamsPlugin,
|
|
5
4
|
fetch as fetchPlugin,
|
|
6
5
|
mutation as mutationPlugin,
|
|
7
6
|
query as queryPlugin,
|
|
8
|
-
throwOnError as throwOnErrorPlugin
|
|
7
|
+
throwOnError as throwOnErrorPlugin,
|
|
8
|
+
fetchParams as fetchParamsPlugin
|
|
9
9
|
} from "./plugins";
|
|
10
10
|
import pluginsFromPlugins from "./plugins/injectedPlugins";
|
|
11
11
|
import { DocumentStore as DocumentStore2 } from "./documentStore";
|
|
@@ -6,7 +6,7 @@ const cachePolicy = ({
|
|
|
6
6
|
cache: localCache = cache
|
|
7
7
|
}) => () => {
|
|
8
8
|
return {
|
|
9
|
-
network(ctx, { next, resolve, marshalVariables }) {
|
|
9
|
+
network(ctx, { initialValue, next, resolve, marshalVariables }) {
|
|
10
10
|
const { policy, artifact } = ctx;
|
|
11
11
|
let useCache = false;
|
|
12
12
|
if (enabled && artifact.kind === ArtifactKind.Query && !ctx.cacheParams?.disableRead) {
|
|
@@ -20,10 +20,10 @@ const cachePolicy = ({
|
|
|
20
20
|
return resolve(ctx, {
|
|
21
21
|
fetching: false,
|
|
22
22
|
variables: ctx.variables ?? null,
|
|
23
|
-
data: value.data,
|
|
23
|
+
data: allowed ? value.data : initialValue.data,
|
|
24
24
|
errors: null,
|
|
25
25
|
source: DataSource.Cache,
|
|
26
|
-
partial: value.partial,
|
|
26
|
+
partial: allowed ? value.partial : false,
|
|
27
27
|
stale: value.stale
|
|
28
28
|
});
|
|
29
29
|
}
|
|
@@ -42,7 +42,7 @@ const fetch = (target) => {
|
|
|
42
42
|
const defaultFetch = (url, params) => {
|
|
43
43
|
if (!url) {
|
|
44
44
|
throw new Error(
|
|
45
|
-
"Could not find configured client url. Please specify one in your
|
|
45
|
+
"Could not find configured client url. Please specify one in your HoudiniClient constructor."
|
|
46
46
|
);
|
|
47
47
|
}
|
|
48
48
|
return async ({ fetch: fetch2, text, variables }) => {
|
package/build/test-cjs/index.js
CHANGED
|
@@ -55276,7 +55276,13 @@ var FieldCollection = class {
|
|
|
55276
55276
|
if (fragment.selection.size === 0) {
|
|
55277
55277
|
return [];
|
|
55278
55278
|
}
|
|
55279
|
-
fragment.astNode
|
|
55279
|
+
fragment.astNode = {
|
|
55280
|
+
...fragment.astNode,
|
|
55281
|
+
selectionSet: {
|
|
55282
|
+
...fragment.astNode.selectionSet,
|
|
55283
|
+
selections: fragment.selection.toSelectionSet()
|
|
55284
|
+
}
|
|
55285
|
+
};
|
|
55280
55286
|
return [fragment.astNode];
|
|
55281
55287
|
}).concat(
|
|
55282
55288
|
Object.values(this.fields).map((field) => {
|
package/build/test-esm/index.js
CHANGED
|
@@ -55271,7 +55271,13 @@ var FieldCollection = class {
|
|
|
55271
55271
|
if (fragment.selection.size === 0) {
|
|
55272
55272
|
return [];
|
|
55273
55273
|
}
|
|
55274
|
-
fragment.astNode
|
|
55274
|
+
fragment.astNode = {
|
|
55275
|
+
...fragment.astNode,
|
|
55276
|
+
selectionSet: {
|
|
55277
|
+
...fragment.astNode.selectionSet,
|
|
55278
|
+
selections: fragment.selection.toSelectionSet()
|
|
55279
|
+
}
|
|
55280
|
+
};
|
|
55275
55281
|
return [fragment.astNode];
|
|
55276
55282
|
}).concat(
|
|
55277
55283
|
Object.values(this.fields).map((field) => {
|
package/build/vite-cjs/index.js
CHANGED
|
@@ -68059,7 +68059,13 @@ var FieldCollection = class {
|
|
|
68059
68059
|
if (fragment.selection.size === 0) {
|
|
68060
68060
|
return [];
|
|
68061
68061
|
}
|
|
68062
|
-
fragment.astNode
|
|
68062
|
+
fragment.astNode = {
|
|
68063
|
+
...fragment.astNode,
|
|
68064
|
+
selectionSet: {
|
|
68065
|
+
...fragment.astNode.selectionSet,
|
|
68066
|
+
selections: fragment.selection.toSelectionSet()
|
|
68067
|
+
}
|
|
68068
|
+
};
|
|
68063
68069
|
return [fragment.astNode];
|
|
68064
68070
|
}).concat(
|
|
68065
68071
|
Object.values(this.fields).map((field) => {
|
package/build/vite-esm/index.js
CHANGED
|
@@ -68053,7 +68053,13 @@ var FieldCollection = class {
|
|
|
68053
68053
|
if (fragment.selection.size === 0) {
|
|
68054
68054
|
return [];
|
|
68055
68055
|
}
|
|
68056
|
-
fragment.astNode
|
|
68056
|
+
fragment.astNode = {
|
|
68057
|
+
...fragment.astNode,
|
|
68058
|
+
selectionSet: {
|
|
68059
|
+
...fragment.astNode.selectionSet,
|
|
68060
|
+
selections: fragment.selection.toSelectionSet()
|
|
68061
|
+
}
|
|
68062
|
+
};
|
|
68057
68063
|
return [fragment.astNode];
|
|
68058
68064
|
}).concat(
|
|
68059
68065
|
Object.values(this.fields).map((field) => {
|