Skip to main content
A submit datasource allows a Form component to save the data. You can perform two types of actions
  • Create
  • Update

Automatic generation

This feature is helpful if you don’t want to start from scratch to configure your submit datasource Entities: Choose the entity you want to save/update Fields: Choose the fields you want to save in the submit datasource Query type: choose create or update Then click on the Generate button. This will generate the basic submit datasource configuration for you

Configure a submit datasource manually

There are two main configurations needed to configure a submit action
  • Query
  • Variables

Query

Here, you should define the GraphQL mutation you want to execute during the submit action

Datasource variables

Generate Variables Using Context Value: If true, the datasource will take all values in the form context and submit them Variables List: Here, you can add all data values you want to send in the request. You can combine this option with the Generate variables using context value.

Other settings

Refetch Queries: Allows to execute a query, which is helpful, for instance, when you want to refresh the datasource of the form and get the data from the server after the submit is completed Data Path: This is useful when you want to use the Generate Variables Using Context Value On Completed Configurations: This will determine the behaviour after the submit action is completed

Mutation examples

Submit a single entity

Submit an entity with child entities (Array)

Codenull allows the creation of multiple entities in the same request. You need to make sure to send all data in the same way as the tables are related to each other. In the next example, a Seguimiento has multiple Etapas
The variable data.Etapas should have the array of Etapas that will be created among the Seguimiento This is how the request data should look The next is a full example of a subimt with a parent and child entities:

Submit an entity with a parent entity

Query
Variables List