Shopify Metaobject and Metafield definitions require you to specify a strict schema of definitions and if (when) you need to change
those entities - you will need to do it via migrations.
Tento has a CLI tool for managing Shopify Metaobjects and Metafields schema definitions.
Based on your schema, Tento letβs you push your definitions schema directly to the Shopify, pull schema definitions from Shopify and has a couple of commands.
lets you push your Tento definitions schema directly to Shopify, see here
tento.config.ts
Tento migrations is configured through tento.config.ts configuration file.
Itβs required to provide schemaPath, shop and X-Shopify-Access-Token for Tento.
IMPORTANT
To have understanding of what SHOPIFY_SHOP_ID and SHOPIFY_ACCESS_TOKEN variables represent go through Tento Get started with OAuth.
pull
tento pull lets literally pull (introspect) your Shopify definitions schema and generate schema.ts tento schema file.
How it works under the hood?
When you run pull command it will:
Pull Metaobject and Metafield definitions schema from Shopify
Generate schema.ts tento schema file and save it to out folder
push
tento push lets literally push your Tento definitions schema directly to Shopify.
How it works under the hood?
When you run Tento push command it will:
Read through your Tento definitions schema file
Pull (introspect) Shopify definitions schema
Based on differences between those two it will generate list of definitions to create, update or delete
Apply those differences to the Shopify
Client
Tento also supports apply and removeschema definitions using client.
Apply
option
default
values
description
unknownEntities
ignore
ignore, remove
helps define the scope of metaobjects and metafields to be migrated, preventing unnecessary downloads and avoiding the deletion of other existing items
ignore
means that only the metaobjects and metafields from your definitions schema will be processed.
delete
means that all metaobjects and metafields will be processed. If you select this option and run command, we will create/ update your schema in Shopify and remove all metaobjects and metafields that do not exist in your schema.
Remove
option
default
values
description
unknownEntities
ignore
ignore, remove
helps define the scope of metaobjects and metafields to be migrated, preventing unnecessary downloads and avoiding the deletion of other existing items
ignore
means that only the metaobjects and metafields from your definitions schema will be processed.
delete
means that all metaobjects and metafields will be processed. If you select this option and run command, we will create/ update your schema in Shopify and remove all metaobjects and metafields that do not exist in your schema.