houdini 1.0.0-next.15 → 1.0.0-next.17

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/README.md CHANGED
@@ -1,5 +1,8 @@
1
1
  <div align="center">
2
- <img alt="houdini" height="200" src="https://raw.githubusercontent.com/HoudiniGraphql/houdini/main/.github/assets/houdini-v5.png" />
2
+ <picture>
3
+ <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/HoudiniGraphql/houdini/main/.github/assetss/logo_l.svg">
4
+ <img height="140" alt="Houdini's logo (dark or light)" src="https://raw.githubusercontent.com/HoudiniGraphql/houdini/main/.github/assets/logo_d.svg">
5
+ </picture>
3
6
  <br />
4
7
  <br />
5
8
  <strong>
@@ -73317,7 +73317,7 @@ function artifactGenerator(stats) {
73317
73317
  {}
73318
73318
  );
73319
73319
  if (Object.keys(plugin_data).length > 0) {
73320
- artifact.plugin_data = plugin_data;
73320
+ artifact.pluginData = plugin_data;
73321
73321
  }
73322
73322
  if (inputs && inputs.length > 0) {
73323
73323
  artifact.input = inputObject(config2, inputs);
@@ -76513,8 +76513,8 @@ async function updatePackageJSON(targetPath) {
76513
76513
  }
76514
76514
  packageJSON.devDependencies = {
76515
76515
  ...packageJSON.devDependencies,
76516
- houdini: "^1.0.0-next.15",
76517
- "houdini-svelte": "^1.0.0-next.15"
76516
+ houdini: "^1.0.0-next.17",
76517
+ "houdini-svelte": "^1.0.0-next.17"
76518
76518
  };
76519
76519
  await fs_exports.writeFile(packagePath, JSON.stringify(packageJSON, null, 4));
76520
76520
  }
@@ -73322,7 +73322,7 @@ function artifactGenerator(stats) {
73322
73322
  {}
73323
73323
  );
73324
73324
  if (Object.keys(plugin_data).length > 0) {
73325
- artifact.plugin_data = plugin_data;
73325
+ artifact.pluginData = plugin_data;
73326
73326
  }
73327
73327
  if (inputs && inputs.length > 0) {
73328
73328
  artifact.input = inputObject(config2, inputs);
@@ -76518,8 +76518,8 @@ async function updatePackageJSON(targetPath) {
76518
76518
  }
76519
76519
  packageJSON.devDependencies = {
76520
76520
  ...packageJSON.devDependencies,
76521
- houdini: "^1.0.0-next.15",
76522
- "houdini-svelte": "^1.0.0-next.15"
76521
+ houdini: "^1.0.0-next.17",
76522
+ "houdini-svelte": "^1.0.0-next.17"
76523
76523
  };
76524
76524
  await fs_exports.writeFile(packagePath, JSON.stringify(packageJSON, null, 4));
76525
76525
  }
@@ -57045,7 +57045,7 @@ function artifactGenerator(stats) {
57045
57045
  {}
57046
57046
  );
57047
57047
  if (Object.keys(plugin_data).length > 0) {
57048
- artifact.plugin_data = plugin_data;
57048
+ artifact.pluginData = plugin_data;
57049
57049
  }
57050
57050
  if (inputs && inputs.length > 0) {
57051
57051
  artifact.input = inputObject(config2, inputs);
@@ -57043,7 +57043,7 @@ function artifactGenerator(stats) {
57043
57043
  {}
57044
57044
  );
57045
57045
  if (Object.keys(plugin_data).length > 0) {
57046
- artifact.plugin_data = plugin_data;
57046
+ artifact.pluginData = plugin_data;
57047
57047
  }
57048
57048
  if (inputs && inputs.length > 0) {
57049
57049
  artifact.input = inputObject(config2, inputs);
@@ -12,4 +12,4 @@ export declare function marshalInputs<T>({ artifact, input, config, rootType, }:
12
12
  }): {} | null | undefined;
13
13
  export declare function unmarshalSelection(config: ConfigFile, selection: SubscriptionSelection, data: any): {} | null | undefined;
14
14
  export declare function isScalar(config: ConfigFile, type: string): boolean;
15
- export declare function parseScalar(config: ConfigFile, type: string, value: string): string | number | boolean;
15
+ export declare function parseScalar(config: ConfigFile, type: string, value?: string): string | number | boolean | undefined;
@@ -80,7 +80,7 @@ export type BaseCompiledDocument = {
80
80
  paginated: boolean;
81
81
  direction: 'forward' | 'backward' | 'both';
82
82
  };
83
- plugin_data?: Record<string, any>;
83
+ pluginData?: Record<string, any>;
84
84
  };
85
85
  export type HoudiniFetchContext = {
86
86
  variables: () => {};
@@ -47,9 +47,7 @@ class DocumentStore extends import_store.Writable {
47
47
  initialValue,
48
48
  fetching
49
49
  }) {
50
- if (fetching === void 0) {
51
- fetching = artifact.kind === import_types.ArtifactKind.Query;
52
- }
50
+ fetching ??= artifact.kind === import_types.ArtifactKind.Query;
53
51
  const initialState = {
54
52
  data: initialValue ?? null,
55
53
  errors: null,
@@ -203,6 +201,7 @@ class DocumentStore extends import_store.Writable {
203
201
  }
204
202
  if (direction === "forward") {
205
203
  if (ctx.setup) {
204
+ console.log("going backwards - setup");
206
205
  return this.#step(
207
206
  "backwards",
208
207
  {
@@ -70,6 +70,7 @@ class HoudiniClient {
70
70
  initialValue,
71
71
  fetching = false
72
72
  }) {
73
+ console.log("observing", artifact.name, fetching);
73
74
  return new import_documentStore.DocumentStore({
74
75
  client: this,
75
76
  artifact,
@@ -78,6 +78,7 @@ const cachePolicy = ({
78
78
  localCache._internal_unstable.collectGarbage();
79
79
  }, 0);
80
80
  }
81
+ console.log("cache setting fetch");
81
82
  setFetching(!useCache);
82
83
  return next(ctx);
83
84
  },
@@ -12,4 +12,4 @@ export declare function marshalInputs<T>({ artifact, input, config, rootType, }:
12
12
  }): {} | null | undefined;
13
13
  export declare function unmarshalSelection(config: ConfigFile, selection: SubscriptionSelection, data: any): {} | null | undefined;
14
14
  export declare function isScalar(config: ConfigFile, type: string): boolean;
15
- export declare function parseScalar(config: ConfigFile, type: string, value: string): string | number | boolean;
15
+ export declare function parseScalar(config: ConfigFile, type: string, value?: string): string | number | boolean | undefined;
@@ -145,6 +145,9 @@ function isScalar(config, type) {
145
145
  return ["String", "Boolean", "Float", "ID", "Int"].concat(Object.keys(config.scalars || {})).includes(type);
146
146
  }
147
147
  function parseScalar(config, type, value) {
148
+ if (typeof value === "undefined") {
149
+ return void 0;
150
+ }
148
151
  if (type === "Boolean") {
149
152
  return value === "true";
150
153
  }
@@ -155,10 +158,18 @@ function parseScalar(config, type, value) {
155
158
  return value;
156
159
  }
157
160
  if (type === "Int") {
158
- return parseInt(value, 10);
161
+ const result = parseInt(value, 10);
162
+ if (Number.isNaN(result)) {
163
+ return void 0;
164
+ }
165
+ return result;
159
166
  }
160
167
  if (type === "Float") {
161
- return parseFloat(value);
168
+ const result = parseFloat(value);
169
+ if (Number.isNaN(result)) {
170
+ return void 0;
171
+ }
172
+ return result;
162
173
  }
163
174
  if (config.scalars?.[type]?.marshal) {
164
175
  return config.scalars[type]?.marshal(value);
@@ -80,7 +80,7 @@ export type BaseCompiledDocument = {
80
80
  paginated: boolean;
81
81
  direction: 'forward' | 'backward' | 'both';
82
82
  };
83
- plugin_data?: Record<string, any>;
83
+ pluginData?: Record<string, any>;
84
84
  };
85
85
  export type HoudiniFetchContext = {
86
86
  variables: () => {};
@@ -24,9 +24,7 @@ class DocumentStore extends Writable {
24
24
  initialValue,
25
25
  fetching
26
26
  }) {
27
- if (fetching === void 0) {
28
- fetching = artifact.kind === ArtifactKind.Query;
29
- }
27
+ fetching ??= artifact.kind === ArtifactKind.Query;
30
28
  const initialState = {
31
29
  data: initialValue ?? null,
32
30
  errors: null,
@@ -180,6 +178,7 @@ class DocumentStore extends Writable {
180
178
  }
181
179
  if (direction === "forward") {
182
180
  if (ctx.setup) {
181
+ console.log("going backwards - setup");
183
182
  return this.#step(
184
183
  "backwards",
185
184
  {
@@ -41,6 +41,7 @@ class HoudiniClient {
41
41
  initialValue,
42
42
  fetching = false
43
43
  }) {
44
+ console.log("observing", artifact.name, fetching);
44
45
  return new DocumentStore({
45
46
  client: this,
46
47
  artifact,
@@ -49,6 +49,7 @@ const cachePolicy = ({
49
49
  localCache._internal_unstable.collectGarbage();
50
50
  }, 0);
51
51
  }
52
+ console.log("cache setting fetch");
52
53
  setFetching(!useCache);
53
54
  return next(ctx);
54
55
  },
@@ -12,4 +12,4 @@ export declare function marshalInputs<T>({ artifact, input, config, rootType, }:
12
12
  }): {} | null | undefined;
13
13
  export declare function unmarshalSelection(config: ConfigFile, selection: SubscriptionSelection, data: any): {} | null | undefined;
14
14
  export declare function isScalar(config: ConfigFile, type: string): boolean;
15
- export declare function parseScalar(config: ConfigFile, type: string, value: string): string | number | boolean;
15
+ export declare function parseScalar(config: ConfigFile, type: string, value?: string): string | number | boolean | undefined;
@@ -118,6 +118,9 @@ function isScalar(config, type) {
118
118
  return ["String", "Boolean", "Float", "ID", "Int"].concat(Object.keys(config.scalars || {})).includes(type);
119
119
  }
120
120
  function parseScalar(config, type, value) {
121
+ if (typeof value === "undefined") {
122
+ return void 0;
123
+ }
121
124
  if (type === "Boolean") {
122
125
  return value === "true";
123
126
  }
@@ -128,10 +131,18 @@ function parseScalar(config, type, value) {
128
131
  return value;
129
132
  }
130
133
  if (type === "Int") {
131
- return parseInt(value, 10);
134
+ const result = parseInt(value, 10);
135
+ if (Number.isNaN(result)) {
136
+ return void 0;
137
+ }
138
+ return result;
132
139
  }
133
140
  if (type === "Float") {
134
- return parseFloat(value);
141
+ const result = parseFloat(value);
142
+ if (Number.isNaN(result)) {
143
+ return void 0;
144
+ }
145
+ return result;
135
146
  }
136
147
  if (config.scalars?.[type]?.marshal) {
137
148
  return config.scalars[type]?.marshal(value);
@@ -80,7 +80,7 @@ export type BaseCompiledDocument = {
80
80
  paginated: boolean;
81
81
  direction: 'forward' | 'backward' | 'both';
82
82
  };
83
- plugin_data?: Record<string, any>;
83
+ pluginData?: Record<string, any>;
84
84
  };
85
85
  export type HoudiniFetchContext = {
86
86
  variables: () => {};
@@ -57392,7 +57392,7 @@ function artifactGenerator(stats) {
57392
57392
  {}
57393
57393
  );
57394
57394
  if (Object.keys(plugin_data).length > 0) {
57395
- artifact.plugin_data = plugin_data;
57395
+ artifact.pluginData = plugin_data;
57396
57396
  }
57397
57397
  if (inputs && inputs.length > 0) {
57398
57398
  artifact.input = inputObject(config2, inputs);
@@ -57387,7 +57387,7 @@ function artifactGenerator(stats) {
57387
57387
  {}
57388
57388
  );
57389
57389
  if (Object.keys(plugin_data).length > 0) {
57390
- artifact.plugin_data = plugin_data;
57390
+ artifact.pluginData = plugin_data;
57391
57391
  }
57392
57392
  if (inputs && inputs.length > 0) {
57393
57393
  artifact.input = inputObject(config2, inputs);
@@ -70181,7 +70181,7 @@ function artifactGenerator(stats) {
70181
70181
  {}
70182
70182
  );
70183
70183
  if (Object.keys(plugin_data).length > 0) {
70184
- artifact.plugin_data = plugin_data;
70184
+ artifact.pluginData = plugin_data;
70185
70185
  }
70186
70186
  if (inputs && inputs.length > 0) {
70187
70187
  artifact.input = inputObject(config4, inputs);
@@ -70175,7 +70175,7 @@ function artifactGenerator(stats) {
70175
70175
  {}
70176
70176
  );
70177
70177
  if (Object.keys(plugin_data).length > 0) {
70178
- artifact.plugin_data = plugin_data;
70178
+ artifact.pluginData = plugin_data;
70179
70179
  }
70180
70180
  if (inputs && inputs.length > 0) {
70181
70181
  artifact.input = inputObject(config4, inputs);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "houdini",
3
- "version": "1.0.0-next.15",
3
+ "version": "1.0.0-next.17",
4
4
  "description": "The disappearing GraphQL clients",
5
5
  "keywords": [
6
6
  "typescript",