Tento will return you a ShopifyJobOperation instance what give you ability to check current job
status and method to update the job
status.
Tento Metaobject Delete
Delete one
Tento represents Shopify Delete Metaobject mutation
You can delete the specified metaobject and its associated metafields:
index.ts
schema.ts
import { tento } from "@drizzle-team/tento";
import * as schema from "./schema";
const client = tento({ schema });
await client.metaobjects.designer.delete("gid://shopify/Metaobject/1");
Bulk delete
Tento represents Shopify Bulk Delete Metaobject mutation
You can delete the specified list of metaobjects:
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.bulkDelete([
"gid://shopify/Metaobject/1",
"gid://shopify/Metaobject/2",
]);
// return type
const result: ShopifyJobOperation
Job operation
After the bulk deletion you can check current job
status using:
import { tento } from "@drizzle-team/tento";
import * as schema from "./schema";
const client = tento({ schema });
const result = await client.metaobjects.designer.bulkDelete([
"gid://shopify/Metaobject/1",
"gid://shopify/Metaobject/2",
]);
const isDone = result.done;
// return type
const result: {
done: boolean,
checkDone(): Promise<boolean>
}
const isDone: boolean;
To update job
status info you can call checkDone()
method:
const result = await client.metaobjects.designer.bulkDelete([
"gid://shopify/Metaobject/1",
"gid://shopify/Metaobject/2",
]);
const isDone = await result.checkDone();
// return type
const isDone: boolean