Shop emoji
Tento
Shopify data framework for NodeJS and TypeScript
Tento [店頭] means "shop" in Japanese
Andrew Sherman Andrew Sherman
Dan Kochetov Dan Kochetov
Alex Blokh Alex Blokh
by Drizzle.Team
Documentation
Declare schema
Shopify clients
OAuth
Schema pull
Schema push
Runtime migrations
Queries filter
Queries pagination
import { metaobject, metafield } from '@drizzle-team/tento';

export const designer = metaobject({
  name: "Designer",
  type: "designer",
  fieldDefinitions: (f) => ({
    name: f.singleLineTextField({
      name: "Title",
      required: true,
      validations: (v) => [v.min(1), v.max(50)],
    }),
    description: f.multiLineTextField({
      name: "Description",
    }),
    website: f.url({
      name: "Website",
    }),
  }),
});

export const designer_reference = metafield({
  name: "Designer",
  key: "designer",
  namespace: "custom",
  ownerType: "PRODUCT",
  useAsCollectionCondition: true,
  visibleToStorefrontApi: true,
  pin: true,
  fieldDefinition: (f) =>
    f.metaobjectReference({
      validations: (v) => [v.metaobjectDefinitionType(() => designer.type)],
    }),
});