CreatePage
The CreatePage
component is responsible for handling the submission, loading, and error handling logic associated with creating a node.
Properties
createQuery
- required - The query called whenever creating the resource. It is passed an$input
variable.refetchQueries
- An array of additional queries to refetch.idPath
- required - The path in thecreateQuery
to the resulting created nodeid
onCreateCompleted
- Called whenever the creation is completed.onCreateCompleted(mutationData) -> Boolean
If this returns false, the user will not be redirected to the
View
page for the node.
onModalClosed
- Callback whenever the modal needs to be closed (if rendering as a modal)isModal
- Whether or not to render inside a modal instead of as its own page.visible
- IfisModal
is true, whether or not the modal is visible.beforeSubmit
- Callback allowing you to modify the payload before it is sent to the query.beforeSubmit(payload) -> Object
See below for an example of what payload looks like.
defaultValues
- Additional values you would like to add to theinput
object inside the payload.
Payload Object
Example
Last updated