How to Deploy a Shopify Dashboard Template with GraphQL
Thank you for taking the time to document these issues! This is incredibly valuable feedback for the community working with Sanity Connect for Shopify and Hydrogen.
You've hit on a fundamental issue when working with Sanity's GraphQL API: anonymous inline object definitions don't translate cleanly to GraphQL. GraphQL requires all types to be explicitly named at the top level of your schema, and when it encounters inline objects, you'll typically see errors like "Encountered anonymous inline object for field/type... To use this field with GraphQL you will need to create a top-level schema type for it."
Your solution of extracting these inline definitions into proper named object types is exactly the right approach:
Inline objects you correctly lifted:
galleryProductsectionfootermenulinkGrouppriceRange
In settings.ts, changing from inline object definitions to named type references ensures these types can be properly resolved:
fields: [
{
name: 'menu',
title: 'Menu',
type: 'menu' // Named type reference instead of inline definition
},
{
name: 'footer',
title: 'Footer',
type: 'footer' // Named type reference
},
{
name: 'seo',
title: 'SEO',
type: 'seo.standard' // Named type reference
}
]For the productOption issue, the change from type: 'option' to type: 'productOption' suggests the template had a mismatch between the inline type name and the actual schema type that should be referenced.
This is a best practice pattern when working with Sanity schemas intended for GraphQL consumption - always prefer explicitly named document and object types over anonymous inline definitions. It makes your schema more maintainable, reusable, and most importantly, compatible with GraphQL generation.
Since the Shopify template is relatively new as part of the evolving Sanity Connect ecosystem, these kinds of adjustments are valuable for others who might hit the same issues. If you haven't already, consider sharing this feedback in the relevant GitHub repository or Sanity's community Slack - it could help improve the template for future users!
Sanity – Build the way you think, not the way your CMS thinks
Sanity is the developer-first content operating system that gives you complete control. Schema-as-code, GROQ queries, and real-time APIs mean no more workarounds or waiting for deployments. Free to start, scale as you grow.