younifyd
Menu

metaobjectDefinitionUpdate

Updates a MetaobjectDefinition's configuration and field structure. You can modify the definition's name, description, display name key, access controls, and capabilities, as well as those of all its fields.

Use it in a workflow

  1. Add a step and choose the Shopify connector.
  2. Pick the metaobjectDefinitionUpdate action (under Metaobject).
  3. Fill in the fields below, then reference the result from later steps as {{metaobjectdefinitionupdate.response.data}}.

Query

This is the mutation the action sends by default. Edit it in the step's Query field to change which fields come back.

graphql
mutation MetaobjectDefinitionUpdate($id: ID!, $definition: MetaobjectDefinitionUpdateInput!) {
  metaobjectDefinitionUpdate(id: $id, definition: $definition) {
    metaobjectDefinition {
      access {
        admin
        customerAccount
        storefront
      }
      capabilities {
        onlineStore
        publishable
        renderable
        translatable
      }
      createdAt
      createdByApp {
        apiKey
        appStoreAppUrl
        appStoreDeveloperUrl
        availableAccessScopes
        banner
        description
        developerName
        developerType
        developerUrl
        embedded
        failedRequirements
        features
        feedback
        handle
        icon
        id
        installUrl
        installation
        isPostPurchaseAppInUse
        launchUrl
        navigationItems
        optionalAccessScopes
        previouslyInstalled
        pricingDetails
        pricingDetailsSummary
        privacyPolicyUrl
        publicCategory
        published
        requestedAccessScopes
        screenshots
        shopifyDeveloped
        title
        uninstallMessage
        uninstallUrl
        webhookApiVersion
      }
      createdByStaff {
        accountType
        active
        email
        exists
        firstName
        id
        initials
        isShopOwner
        lastName
        locale
        name
        phone
        privateData
      }
      description
      displayNameKey
      fieldDefinitions {
        capabilities
        description
        key
        name
        required
        type
        validations
      }
      hasThumbnailField
      id
      metaobjectsCount
      name
      standardTemplate {
        access
        description
        displayNameKey
        enabledCapabilities
        fieldDefinitions
        name
        type
      }
      type
      updatedAt
    }
    userErrors {
      code
      elementIndex
      elementKey
      field
      message
    }
  }
}

Variables

Pass these as a JSON object in the step's Variables field.

idstringrequired

The ID of the metaobject definition to update.

definitionobjectrequired

The input fields for updating a metaobject definition.

namestring
descriptionstring
fieldDefinitionsarray<object>3 fields
accessobject3 fields
displayNameKeystring
resetFieldOrderboolean
capabilitiesobject4 fields
json
{
  "id": "string",
  "definition": {
    "name": "string",
    "description": "string",
    "fieldDefinitions": [
      {
        "create": "string",
        "update": "string",
        "delete": "string"
      }
    ],
    "access": {
      "admin": "MERCHANT_READ",
      "storefront": "NONE",
      "customerAccount": "NONE"
    },
    "displayNameKey": "string",
    "resetFieldOrder": false,
    "capabilities": {
      "publishable": {
        "enabled": "string"
      },
      "translatable": {
        "enabled": "string"
      },
      "renderable": {
        "enabled": "string",
        "data": "string"
      },
      "onlineStore": {
        "enabled": "string",
        "data": "string"
      }
    }
  }
}

Response

Read the result with {{metaobjectdefinitionupdate.response.data.data.metaobjectDefinitionUpdate}}. If the API returns errors, the step fails and they are at {{metaobjectdefinitionupdate.response.data.errors}}.

metaobjectDefinitionobject
accessobject3 fields
capabilitiesobject4 fields
createdAtstring
createdByAppobject35 fields
createdByStaffobject13 fields
descriptionstring
displayNameKeystring
fieldDefinitionsarray<object>
hasThumbnailFieldboolean
idstring
metaobjectsCountnumber
namestring
standardTemplateobject7 fields
typestring
updatedAtstring
userErrorsarray<object>
codeobject
elementIndexobject
elementKeyobject
fieldobject
messageobject

Need more? See the Shopify guide for connection setup and behaviour shared by every action.