Skip to content

Built for people who want to own their automations. Join the waitlist for an invite.

Package listing

@kody/shopify

docs/domains.md

74 lines · 2.8 KB · Markdown

Domain map

Helpers are thin GraphQL wrappers. Each module accepts shop and apiVersion, projects a slim object, and keeps writes behind dryRun.

Read helpers

NeedExportNotes
Is auth working?./smoke-testLocal checks always; live shop read when configured
Shop profile./shop getShopName, plan, currency, primary domain
Catalog./products listProducts / getProductShopify search query supported
Orders./orders listOrders / getOrderNewest first
Customers./customers listCustomers / getCustomerSearch by email or name
Locations / on-hand./inventoryLevels use the available quantity name
Collections./collectionsIncludes a small product page on getCollection
Fulfillment orders./fulfillments listFulfillmentOrdersPer order
Drafts./draft-ordersOpen quotes / invoices
Webhook list./webhooks listWebhooksCurrent app subscriptions
Metafields./metafields listMetafieldsOwner type + id

Write helpers (dry-run by default)

NeedExportMutation
New / updated product./productsproductCreate, productUpdate
New customer./customerscustomerCreate
Inventory delta./inventory adjustInventoryinventoryAdjustQuantities (@idempotent required on 2026-04+)
Mark shipped./fulfillments createFulfillmentfulfillmentCreate
Draft invoice./draft-orders createDraftOrderdraftOrderCreate
Subscribe / remove webhook./webhookswebhookSubscriptionCreate / Delete
Set metafield./metafields setMetafieldmetafieldsSet

Pass dryRun: false only after a human confirms the shop and payload.

Escape hatches

Anything not wrapped belongs on ./graphql (preferred) or ./request (legacy REST). Examples:

import { shopifyGraphql } from 'kody:@kody/shopify/graphql'

await shopifyGraphql({
	shop: 'acme',
	query: `query {
		automaticDiscountNodes(first: 10) {
			nodes { id automaticDiscount { ... on DiscountAutomaticBasic { title } } }
		}
	}`,
})
import { shopifyRequest } from 'kody:@kody/shopify/request'

await shopifyRequest({
	shop: 'acme',
	path: '/gift_cards.json',
	query: { limit: 5 },
})

Adding another domain

See CONTRIBUTING.md. Start with src/orders.ts as the template. Keep src/lib/client.ts as the only authenticated transport.

API version

Default 2026-07. Shopify releases Admin versions in January, April, July, and October. When you bump the default, update DEFAULT_API_VERSION in src/lib/shop.ts, the README, and this file in the same commit. Re-read the GraphQL reference for renamed fields before wrapping new mutations.