Skip to content

Commit

Permalink
attempt at temporary fix
Browse files Browse the repository at this point in the history
  • Loading branch information
AlecAivazis committed Apr 2, 2024
1 parent 308fdfb commit 4b5dea3
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import type {
} from '$houdini/runtime/lib/types'
import React from 'react'

import { useClient, useSession } from '../routing/Router'
import { useClient, useLocation, useSession } from '../routing/Router'

export function useDocumentHandle<
_Artifact extends QueryArtifact,
Expand All @@ -32,6 +32,7 @@ export function useDocumentHandle<
}): DocumentHandle<_Artifact, _Data, _Input> & { fetch: FetchFn<_Data, _Input> } {
const [forwardPending, setForwardPending] = React.useState(false)
const [backwardPending, setBackwardPending] = React.useState(false)
const location = useLocation()

// grab the current session value
const [session] = useSession()
Expand Down Expand Up @@ -65,6 +66,10 @@ export function useDocumentHandle<
const fetchQuery: FetchFn<_Data, _Input> = (args) =>
observer.send({
...args,
variables: {
...location.params,
...args?.variables,
},
session,
})

Expand Down

0 comments on commit 4b5dea3

Please sign in to comment.