Using the GraphQL API

Each node in a Uni hosts a GraphQL API that provides full CRUD support for your data model in addition to extended functionality such as working with Files and Secure Messages.

Queries

Vendia generates the following GraphQL queries for the top-level entities in your data model.

getX

Supports retrieving an item by id.

listX

Supports listing items. Returns a nextToken that can be used for pagination.

Mutations

Vendia generates the following GraphQL mutations for the top-level entities in your data model.

Note: Mutations containing "_async" execute asynchronously and return a tx_id that can be used for status polling and correlation purposes. To configure failure notifications for asynchronous mutations, see Dead-letter notifications.

addX_async / removeX_async

Supports adding and removing items for array types.

createX_async / deleteX_async

Supports creating and deleting items for object types.

putX_async

Put mutations update an item by replacing the entire item with the input specified in the mutation. All required fields must be specified in the input, and any absent fields will be removed in the datastore.

i.e.

putShape_async(
   id: "234160b5-58f1-485c-9745-737e539eb20f", 
   input: { 
       name: "square", 
       color: "red", 
       numSides: 4 
   }
) {error}

updateX_async

Supports partial update of an item. Only the fields specified in the input will be updated. Fields absent in the input are preserved in the datastore. Fields can be explicitly removed by specifying a null value.

i.e.

updateShape_async(
   id: "234160b5-58f1-485c-9745-737e539eb20f", 
   input: { 
       name: null, 
       numSides: 5
   }
) {error}

This mutation removes the name field, preserves the existing value of the color field, and updates the numSides field.

Note: Nested objects can be explicitly removed if they do not contain required fields. i.e.

updateMyObject_async(
   id: "234160b5-58f1-485c-9745-737e539eb20f", 
   input: { 
       nestedObject: null
   }
) {error}

A nested object must first be created in an updateX_async operation before values can be added to it.

updateMyObject_async(
   id: "234160b5-58f1-485c-9745-737e539eb20f", 
   input: { 
       nestedObject: {}
   }
) {error}

updateMyObject_async(
   id: "234160b5-58f1-485c-9745-737e539eb20f", 
   input: { 
       nestedObject: {
           nestedField: "test"
       }
   }
) {error}

Other Feature Documentation

Using Secure Messages

Next Steps

Using File Storage

Integrating a Vendia chain with other Cloud, Web, and Mobile Services

Learning More

Terms and Definitions

Show table of contents
Edit this page