Skip to content

Commit

Permalink
Update react types
Browse files Browse the repository at this point in the history
  • Loading branch information
ewen-lbh committed Nov 11, 2024
1 parent c9d3466 commit b846ed9
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 6 deletions.
1 change: 1 addition & 0 deletions .changeset/sour-starfishes-push.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
'houdini': minor
'houdini-svelte': patch
'houdini-react': patch
---

Add new types GraphQLLoadedValue and GraphQLLoadedObject, and include LoadingType in GraphQLValue
4 changes: 2 additions & 2 deletions packages/houdini-react/src/runtime/componentFields.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { defaultComponentField, type Cache } from '$houdini/runtime/cache/cache'
import { getFieldsForType } from '$houdini/runtime/lib/selection'
import type { DocumentArtifact, GraphQLValue } from 'houdini'
import type { DocumentArtifact, GraphQLLoadedValue, GraphQLValue } from 'houdini'

export function injectComponents({
cache,
Expand All @@ -12,7 +12,7 @@ export function injectComponents({
cache: Cache
selection: DocumentArtifact['selection']
data: GraphQLValue | null
variables: Record<string, GraphQLValue> | undefined | null
variables: Record<string, GraphQLLoadedValue> | undefined | null
parentType?: string
}) {
// if the value is null, we're done
Expand Down
8 changes: 6 additions & 2 deletions packages/houdini-react/src/runtime/hooks/useDocumentStore.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import type { DocumentArtifact, GraphQLVariables, QueryResult } from '$houdini/lib/types'
import type {
DocumentArtifact,
GraphQLVariables,
QueryResult,
GraphQLObject,
} from '$houdini/lib/types'
import type { DocumentStore, ObserveParams } from '$houdini/runtime/client'
import type { GraphQLObject } from 'houdini'
import * as React from 'react'

import { useClient } from '../routing'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import type { DocumentArtifact, GraphQLVariables, QueryResult } from '$houdini/lib/types'
import type {
DocumentArtifact,
GraphQLObject,
GraphQLVariables,
QueryResult,
} from '$houdini/lib/types'
import type { DocumentStore, SendParams } from '$houdini/runtime/client'
import type { GraphQLObject } from 'houdini'

import { useSession } from '../routing/Router'
import useDeepCompareEffect from './useDeepCompareEffect'
Expand Down

0 comments on commit b846ed9

Please sign in to comment.