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. You can also update capabilities for metaobject just providing publishable capability input.

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",
  },
  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;
}