houdini-react 0.0.0-20240402042643 → 0.0.0-20240402042937

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.
@@ -57,14 +57,22 @@ function useDocumentHandle({
57
57
  return result;
58
58
  };
59
59
  };
60
- const fetchQuery = (args) => observer.send({
61
- ...args,
62
- variables: {
63
- ...location.params,
64
- ...args?.variables
65
- },
66
- session
67
- });
60
+ const fetchQuery = (args) => {
61
+ const usedVariables = Object.fromEntries(
62
+ Object.keys(observer.artifact.input?.fields ?? {}).map((fieldName) => [
63
+ fieldName,
64
+ location.params[fieldName]
65
+ ])
66
+ );
67
+ return observer.send({
68
+ ...args,
69
+ variables: {
70
+ ...usedVariables,
71
+ ...args?.variables
72
+ },
73
+ session
74
+ });
75
+ };
68
76
  if (artifact.kind !== import_types.ArtifactKind.Query || !artifact.refetch?.paginated) {
69
77
  return {
70
78
  artifact,
@@ -28,14 +28,22 @@ function useDocumentHandle({
28
28
  return result;
29
29
  };
30
30
  };
31
- const fetchQuery = (args) => observer.send({
32
- ...args,
33
- variables: {
34
- ...location.params,
35
- ...args?.variables
36
- },
37
- session
38
- });
31
+ const fetchQuery = (args) => {
32
+ const usedVariables = Object.fromEntries(
33
+ Object.keys(observer.artifact.input?.fields ?? {}).map((fieldName) => [
34
+ fieldName,
35
+ location.params[fieldName]
36
+ ])
37
+ );
38
+ return observer.send({
39
+ ...args,
40
+ variables: {
41
+ ...usedVariables,
42
+ ...args?.variables
43
+ },
44
+ session
45
+ });
46
+ };
39
47
  if (artifact.kind !== ArtifactKind.Query || !artifact.refetch?.paginated) {
40
48
  return {
41
49
  artifact,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "houdini-react",
3
- "version": "0.0.0-20240402042643",
3
+ "version": "0.0.0-20240402042937",
4
4
  "description": "The React plugin for houdini",
5
5
  "keywords": [
6
6
  "typescript",
@@ -43,7 +43,7 @@
43
43
  "recast": "^0.23.1",
44
44
  "rollup": "^3.7.4",
45
45
  "use-deep-compare-effect": "^1.8.1",
46
- "houdini": "^0.0.0-20240402042643"
46
+ "houdini": "^0.0.0-20240402042937"
47
47
  },
48
48
  "files": [
49
49
  "build"