@@ -80,17 +80,12 @@ export const action = async ({ request }) => {
8080 const variantResponseJson = await variantResponse . json ( ) ;
8181 const metaobjectResponse = await admin . graphql (
8282 `#graphql
83- mutation shopifyReactRouterTemplateUpsertMetaobject($handle: MetaobjectHandleInput!, $metaobject: MetaobjectUpsertInput !) {
84- metaobjectUpsert(handle: $handle, metaobject : $metaobject ) {
83+ mutation shopifyReactRouterTemplateUpsertMetaobject($handle: MetaobjectHandleInput!, $values: JSON !) {
84+ metaobjectUpsert(handle: $handle, values : $values ) {
8585 metaobject {
8686 id
8787 handle
88- title: field(key: "title") {
89- jsonValue
90- }
91- description: field(key: "description") {
92- jsonValue
93- }
88+ values
9489 }
9590 userErrors {
9691 field
@@ -104,15 +99,10 @@ export const action = async ({ request }) => {
10499 type : "$app:example" ,
105100 handle : "demo-entry" ,
106101 } ,
107- metaobject : {
108- fields : [
109- { key : "title" , value : "Demo Entry" } ,
110- {
111- key : "description" ,
112- value :
113- "This metaobject was created by the Shopify app template to demonstrate the metaobject API." ,
114- } ,
115- ] ,
102+ values : {
103+ title : "Demo Entry" ,
104+ description :
105+ "This metaobject was created by the Shopify app template to demonstrate the metaobject API." ,
116106 } ,
117107 } ,
118108 } ,
@@ -223,7 +213,13 @@ export default function Index() {
223213 borderRadius = "base"
224214 background = "subdued"
225215 >
226- < pre style = { { margin : 0 } } >
216+ < pre
217+ style = { {
218+ margin : 0 ,
219+ whiteSpace : "pre-wrap" ,
220+ wordBreak : "break-word" ,
221+ } }
222+ >
227223 < code > { JSON . stringify ( fetcher . data . product , null , 2 ) } </ code >
228224 </ pre >
229225 </ s-box >
@@ -235,7 +231,13 @@ export default function Index() {
235231 borderRadius = "base"
236232 background = "subdued"
237233 >
238- < pre style = { { margin : 0 } } >
234+ < pre
235+ style = { {
236+ margin : 0 ,
237+ whiteSpace : "pre-wrap" ,
238+ wordBreak : "break-word" ,
239+ } }
240+ >
239241 < code > { JSON . stringify ( fetcher . data . variant , null , 2 ) } </ code >
240242 </ pre >
241243 </ s-box >
@@ -247,7 +249,13 @@ export default function Index() {
247249 borderRadius = "base"
248250 background = "subdued"
249251 >
250- < pre style = { { margin : 0 } } >
252+ < pre
253+ style = { {
254+ margin : 0 ,
255+ whiteSpace : "pre-wrap" ,
256+ wordBreak : "break-word" ,
257+ } }
258+ >
251259 < code >
252260 { JSON . stringify ( fetcher . data . metaobject , null , 2 ) }
253261 </ code >
0 commit comments