Tento Metaobject Update

Tento represents Shopify Update Metaobject mutation

The object that you pass to update should have keys that match field names in your Metaobject Definition schema. Values of undefined are ignored in the object.

index.ts
schema.ts
import { tento } from "@drizzle-team/tento";
import * as schema from "./schema";

const client = tento({ schema });

const result = await client.metaobjects.designer.update("gid://shopify/Metaobject/1", {
  fields: {
    name: "Alex",
  },
});
// return type
const result: {
  _id: string;
  _handle: string;
  _displayName: string;
  _updatedAt: Date;
  name: string;
  description: string | null;
  website: string | null;
}

If you need to update capabilities for metaobject you can provide publishable capability input:

const result = await client.metaobjects.designer.update("gid://shopify/Metaobject/1", {
  fields: {
    name: "Alex",
  },
  capabilities: {
    publishable: {
      status: "ACTIVE", // ACTIVE | DRAFT
    },
  },
});
// return type
const result: {
  _id: string;
  _handle: string;
  _displayName: string;
  _updatedAt: Date;
  name: string;
  description: string | null;
  website: string | null;
}