Request:
mutation {
createAsset (
input: {
asset: {
name: "Example Asset #1"
type: "Preferred Equity"
authorizedTotal: "5000000"
status: "Active"
}
}
) {
asset {
id
}
}
}
Response:
{
"data": {
"createAsset": {
"asset": {
"id": "b29704fd-5613-4f16-b712-a942a126413b"
}
}
}
}
Numeric field | Usage |
---|---|
authorizedTotal | The total number of shares/units authorized for sale overall |
In this example, the mutation creates a new asset with the required properties. It also shows a return payload requested as part of the mutation. This is a powerful feature of GraphQL which gives the developer a high degree of control over what information is returned as a result of a mutation. The ID of the newly created asset is returned in the payload.