#
Common Custom Dashboard Mutations
#
Introduction
As an Engine partner, you have the option to create a custom artist/admin dashboard. While the majority of your project configuration will occur through on-chain transactions, there are specific off-chain fields that need to be set directly via our GraphQL API.
This documentation outlines the permissions necessary for executing relevant actions and mutations. Please note that a user can only execute a mutation with the artist role for a project if their public address matches the artist address set for the project. A user can execute a mutation with the allowlisted role only if they are the super admin on the project's contract's ACL contract (V3 and up), or if they have been whitelisted on the project's contract (V2 and below).
For all mutations listed in this documentation, the user must include the x-hasura-role header in their request, specifying either artist or allowlisted as the role, as appropriate.
#
Actions
Actions are specialized mutations that go beyond simple CRUD operations. Within your custom creator dashboard, you might find the updateFeatures
and updateProjectMedia
actions particularly useful.
The updateFeatures
action initiates a test run of a feature script for a test token. Upon validating that the output aligns with the provided feature fields, it updates both the feature_fields
and feature_script
on the project. Both artists and allowlisted users can execute this action. Artists can make updates either before the project is completed, or afterwards, if the allowlisted user has toggled the enable_artist_update_after_completion
flag on the project's associated features row.
The updateProjectMedia
action refreshes various media assets linked to a project's tokens. The refreshed media depends on the parameters passed to the action, which may include different formats of preview images and features. This action is accessible to both artists and allowlisted users. However, the execution of this action is rate-limited to once 24 hours for artists.
Here are the parameters accepted by the updateProjectMedia
action:
projectId
: The ID of the project to be updated.features
: A boolean that indicates whether to recalculate features for the project's tokens.render
: A boolean that indicates whether to re-render the preview images for the project.renderVideo
: A boolean that indicates whether to re-render preview videos/gifs for the project.
All these actions are executed via specific mutations in the GraphQL API.
#
Tags
Tags and projects share a many-to-many relationship, managed through the entity_tags
table. Tags serve as non-functional descriptors that can be used to categorize projects. To associate a tag with a project, the insert_entity_tags
mutation is used.
In the context of an Engine dashboard, you're likely most interested in presentation tags, which can be fetched with the following query:
query {
tags(where: {grouping_name: {_eq: presentation}}) {
name
}
}
Both the artist and contract admin roles have the permissions to execute the insert_entity_tags
mutation. Here's an example of how to use this mutation:
mutation {
insert_entity_tags(objects: [{ project_id: "0x...", tag_name: "animated"}])
}
#
Project
The table below lists permissions for directly updating relevant off-chain fields on the project row. Many of these fields are optional and are intended to enrich the descriptive content on your frontend. Fields marked with an asterisk (*) have a functional impact on the project.
All these fields are updated using the update_projects_metadata_by_pk
mutation.
Please note: In the tables above, 'X' stands for write permissions, and '-' stands for no write permissions.