Content#
Get the data for a specific content given its path.
Get Content#
Query options function#
Use the getContentQuery function to get the query options object for fetching the content at a given path.
Hook#
Use the useGetContent hook to get the content at a given path.
Parameters#
path: string
Required: Yes
version: string
Required: No
page: number
Required: No
fullObjects: boolean
Required: No
expand: string[]
Required: No
Add Content#
Mutation options function#
Use the createContentMutation function to get the mutation for adding content at a given path.
Hook#
Use the useCreateContent hook to add content at a given path.
Parameters#
path: string
Required: Yes
data: object
Required: Yes
It can have the following fields:
@id: stringRequired: No
@static_behaviors: unknownRequired: No
@type: stringRequired: Yes
allow_discussion: booleanRequired: No
blocks: unknownRequired: No
blocks_layout: string[]Required: No
contributors: string[]Required: No
creators: string[]Required: No
description: stringRequired: No
effective: stringRequired: No
exclude_from_nav: booleanRequired: No
expires: stringRequired: No
id: stringRequired: No
language: stringRequired: No
preview_caption: stringRequired: No
preview_image: objectRequired: No
It has the following fields:
content-type: stringRequired: Yes
data: stringRequired: Yes
encoding: stringRequired: Yes
filename: stringRequired: Yes
relatedItems: array(RelatedObject)Required: No
rights: stringRequired: No
title: stringRequired: Yes
versioning_enabled: booleanRequired: No
Update Content#
Mutation function#
Use the updateContentMutation function to get the mutation for updating content at a given path.
Hook#
Use the useUpdateContent hook to update content at a given path.
Parameters#
path: string
Required: Yes
data: object
Required: Yes
It can have the following fields:
allow_discussion: booleanRequired: No
blocks: unknownRequired: No
blocks_layout: string[]Required: No
contributors: string[]Required: No
creators: string[]Required: No
description: stringRequired: No
effective: stringRequired: No
exclude_from_nav: booleanRequired: No
expires: stringRequired: No
id: stringRequired: No
preview_caption: stringRequired: No
preview_image: objectRequired: No
It has the following fields:
content-type: stringRequired: Yes
data: stringRequired: Yes
encoding: stringRequired: Yes
filename: stringRequired: Yes
relatedItems: array(RelatedObject)Required: No
rights: stringRequired: No
table_of_contents: booleanRequired: No
title: stringRequired: No
versioning_enabled: booleanRequired: No
Delete Content#
Mutation function#
Use the deleteContentMutation function to get the mutation for deleting content at a given path.
Hook#
Use the useDeleteContent hook to delete content at a given path.
Parameters#
path: string
Required: Yes