Skip to main content

UseDetailPage

Status: Developer Preview

This hook is used to create an entity detail page which can read and update an entity.

Example

Ts
Signature

Parameters

options

parameterDetailPageOptions<T, C, U, EntityField, VarNameCreate, VarNameUpdate>

Options used to configure the result of the useDetailPage hook.

Signature

pageId

propertystring

The page id. This is optional, but if provided, it will be used to identify the page when extending the detail page query

queryDocument

propertyT

The query document to fetch the entity.

entityField

propertyEntityField

The field of the query document that contains the entity.

params

property{ id: string; }

The parameters used to identify the entity.

entityName

propertystring

The entity type name for custom field configuration lookup. Required to filter out readonly custom fields before mutations. If not provided, the function will try to infer it from the query document.

createDocument

propertyC

The document to create the entity.

updateDocument

propertyU

The document to update the entity.

setValuesForUpdate

property( entity: NonNullable<ResultOf<T>[EntityField]>, ) => WithLooseCustomFields<VariablesOf<U>[VarNameUpdate]>

The function to set the values for the update document.

transformCreateInput

property(input: VariablesOf<C>[VarNameCreate]) => VariablesOf<C>[VarNameCreate]

transformUpdateInput

property(input: VariablesOf<U>[VarNameUpdate]) => VariablesOf<U>[VarNameUpdate]

onSuccess

property(entity: ResultOf<C>[keyof ResultOf<C>] | ResultOf<U>[keyof ResultOf<U>]) => void

The function to call when the update is successful.

onError

property(error: unknown) => void

The function to call when the update is successful.

Signature

form

propertyUseFormReturn<RemoveNullFields<VariablesOf<U>['input']>>

submitHandler

property(event: FormEvent<HTMLFormElement>) => void

entity

propertyDetailPageEntity<T, EntityField>

isPending

propertyboolean

refreshEntity

property() => void

resetForm

property() => void
Was this chapter helpful?
Report Issue
Edited Feb 23, 2026ยทEdit this page