Skip to content

Commit e9f52a2

Browse files
shaunspi-mono
andcommitted
Use metaobject values API on Admin API 2026-07
Metaobject values provide a simpler JSON interface for reading and writing field data. Align the runtime, codegen, and webhook versions and raise the app package minimum so ApiVersion.July26 is available. Co-authored-by: AI (Pi/GPT-5.6 Sol) <noreply@pi.dev>
1 parent c7ef2af commit e9f52a2

5 files changed

Lines changed: 17 additions & 25 deletions

File tree

.graphqlrc.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,11 @@ function getConfig() {
88
projects: {
99
default: shopifyApiProject({
1010
apiType: ApiType.Admin,
11-
apiVersion: ApiVersion.October25,
12-
documents: ["./app/**/*.{js,ts,jsx,tsx}", "./app/.server/**/*.{js,ts,jsx,tsx}"],
11+
apiVersion: ApiVersion.July26,
12+
documents: [
13+
"./app/**/*.{js,ts,jsx,tsx}",
14+
"./app/.server/**/*.{js,ts,jsx,tsx}",
15+
],
1316
outputDir: "./app/types",
1417
}),
1518
},

app/routes/app._index.tsx

Lines changed: 8 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -89,17 +89,12 @@ export const action = async ({ request }: ActionFunctionArgs) => {
8989

9090
const metaobjectResponse = await admin.graphql(
9191
`#graphql
92-
mutation shopifyReactRouterTemplateUpsertMetaobject($handle: MetaobjectHandleInput!, $metaobject: MetaobjectUpsertInput!) {
93-
metaobjectUpsert(handle: $handle, metaobject: $metaobject) {
92+
mutation shopifyReactRouterTemplateUpsertMetaobject($handle: MetaobjectHandleInput!, $values: JSON!) {
93+
metaobjectUpsert(handle: $handle, values: $values) {
9494
metaobject {
9595
id
9696
handle
97-
title: field(key: "title") {
98-
jsonValue
99-
}
100-
description: field(key: "description") {
101-
jsonValue
102-
}
97+
values
10398
}
10499
userErrors {
105100
field
@@ -113,15 +108,10 @@ export const action = async ({ request }: ActionFunctionArgs) => {
113108
type: "$app:example",
114109
handle: "demo-entry",
115110
},
116-
metaobject: {
117-
fields: [
118-
{ key: "title", value: "Demo Entry" },
119-
{
120-
key: "description",
121-
value:
122-
"This metaobject was created by the Shopify app template to demonstrate the metaobject API.",
123-
},
124-
],
111+
values: {
112+
title: "Demo Entry",
113+
description:
114+
"This metaobject was created by the Shopify app template to demonstrate the metaobject API.",
125115
},
126116
},
127117
},
@@ -133,8 +123,7 @@ export const action = async ({ request }: ActionFunctionArgs) => {
133123
product: responseJson!.data!.productCreate!.product,
134124
variant:
135125
variantResponseJson!.data!.productVariantsBulkUpdate!.productVariants,
136-
metaobject:
137-
metaobjectResponseJson!.data!.metaobjectUpsert!.metaobject,
126+
metaobject: metaobjectResponseJson!.data!.metaobjectUpsert!.metaobject,
138127
};
139128
};
140129

app/shopify.server.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import prisma from "./db.server";
1010
const shopify = shopifyApp({
1111
apiKey: process.env.SHOPIFY_API_KEY,
1212
apiSecretKey: process.env.SHOPIFY_API_SECRET || "",
13-
apiVersion: ApiVersion.October25,
13+
apiVersion: ApiVersion.July26,
1414
scopes: process.env.SCOPES?.split(","),
1515
appUrl: process.env.SHOPIFY_APP_URL || "",
1616
authPathPrefix: "/auth",
@@ -25,7 +25,7 @@ const shopify = shopifyApp({
2525
});
2626

2727
export default shopify;
28-
export const apiVersion = ApiVersion.October25;
28+
export const apiVersion = ApiVersion.July26;
2929
export const addDocumentResponseHeaders = shopify.addDocumentResponseHeaders;
3030
export const authenticate = shopify.authenticate;
3131
export const unauthenticated = shopify.unauthenticated;

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"@react-router/node": "^7.12.0",
3131
"@react-router/serve": "^7.12.0",
3232
"@shopify/app-bridge-react": "^4.2.4",
33-
"@shopify/shopify-app-react-router": "^1.1.0",
33+
"@shopify/shopify-app-react-router": "^1.2.1",
3434
"@shopify/shopify-app-session-storage-prisma": "^9.0.0",
3535
"isbot": "^5.1.31",
3636
"prisma": "^6.16.3",

shopify.app.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ name = "Description"
2828
type = "multi_line_text_field"
2929

3030
[webhooks]
31-
api_version = "2025-10"
31+
api_version = "2026-07"
3232

3333
# Handled by: /app/routes/webhooks.app.uninstalled.tsx
3434
[[webhooks.subscriptions]]

0 commit comments

Comments
 (0)