houdini-react 0.0.0-20240402041558 → 0.0.0-20240402042643

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.
@@ -39,6 +39,7 @@ function useDocumentHandle({
39
39
  }) {
40
40
  const [forwardPending, setForwardPending] = import_react.default.useState(false);
41
41
  const [backwardPending, setBackwardPending] = import_react.default.useState(false);
42
+ const location = (0, import_Router.useLocation)();
42
43
  const [session] = (0, import_Router.useSession)();
43
44
  const client = (0, import_Router.useClient)();
44
45
  const paginationObserver = import_react.default.useMemo(() => {
@@ -58,6 +59,10 @@ function useDocumentHandle({
58
59
  };
59
60
  const fetchQuery = (args) => observer.send({
60
61
  ...args,
62
+ variables: {
63
+ ...location.params,
64
+ ...args?.variables
65
+ },
61
66
  session
62
67
  });
63
68
  if (artifact.kind !== import_types.ArtifactKind.Query || !artifact.refetch?.paginated) {
@@ -99,13 +99,13 @@ function Router({
99
99
  preload(url, which) {
100
100
  const [page2, variables2] = (0, import_match.find_match)(import_config.default, manifest, url);
101
101
  if (!page2) {
102
- console.log(url);
103
102
  return;
104
103
  }
105
104
  if (["page", "component"].includes(which)) {
106
105
  loadComponent(page2);
107
106
  }
108
107
  if (["page", "data"].includes(which)) {
108
+ console.log("loading data", page2, variables2);
109
109
  loadData(page2, variables2);
110
110
  }
111
111
  }
@@ -2,7 +2,7 @@ import { extractPageInfo } from "$houdini/runtime/lib/pageInfo";
2
2
  import { cursorHandlers, offsetHandlers } from "$houdini/runtime/lib/pagination";
3
3
  import { ArtifactKind } from "$houdini/runtime/lib/types";
4
4
  import React from "react";
5
- import { useClient, useSession } from "../routing/Router";
5
+ import { useClient, useLocation, useSession } from "../routing/Router";
6
6
  function useDocumentHandle({
7
7
  artifact,
8
8
  observer,
@@ -10,6 +10,7 @@ function useDocumentHandle({
10
10
  }) {
11
11
  const [forwardPending, setForwardPending] = React.useState(false);
12
12
  const [backwardPending, setBackwardPending] = React.useState(false);
13
+ const location = useLocation();
13
14
  const [session] = useSession();
14
15
  const client = useClient();
15
16
  const paginationObserver = React.useMemo(() => {
@@ -29,6 +30,10 @@ function useDocumentHandle({
29
30
  };
30
31
  const fetchQuery = (args) => observer.send({
31
32
  ...args,
33
+ variables: {
34
+ ...location.params,
35
+ ...args?.variables
36
+ },
32
37
  session
33
38
  });
34
39
  if (artifact.kind !== ArtifactKind.Query || !artifact.refetch?.paginated) {
@@ -58,13 +58,13 @@ function Router({
58
58
  preload(url, which) {
59
59
  const [page2, variables2] = find_match(configFile, manifest, url);
60
60
  if (!page2) {
61
- console.log(url);
62
61
  return;
63
62
  }
64
63
  if (["page", "component"].includes(which)) {
65
64
  loadComponent(page2);
66
65
  }
67
66
  if (["page", "data"].includes(which)) {
67
+ console.log("loading data", page2, variables2);
68
68
  loadData(page2, variables2);
69
69
  }
70
70
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "houdini-react",
3
- "version": "0.0.0-20240402041558",
3
+ "version": "0.0.0-20240402042643",
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-20240402041558"
46
+ "houdini": "^0.0.0-20240402042643"
47
47
  },
48
48
  "files": [
49
49
  "build"