Field 'shopOwnerName' doesn't exist on type 'Shop'

There’s a new documented field shopOwnerName in the GraphQL 2024-10 API.

But when it is accessed:

const { admin } = await authenticate.admin(request);
const data = await admin.graphql(
 `#graphql
  query {
    shop {
      shopOwnerName
    }
  }`,
);

We encounter an error: GraphqlQueryError: Field 'shopOwnerName' does not exist on type 'Shop', even though it is accessible in the GraphQL Playground locally.

Hi Ed,

Are you sure you’re using version 2024-10 in your app? It should work in the same way as the GraphiQL app.

Hi @Liam-Shopify, thank you for your reply. It was indeed the root cause; we thought it was updated everywhere (app.toml, web interface), and if it works in GraphiQL then the issue should be with the package, or somewhere else. But we indeed forgot to update the version in the shopifyApp.

For anyone else looking for this information, you can actually determine the Shop Owner from the online access token.

There’s a specific account_owner flag in the online access token that you can use to differentiate between staff accounts and the owner account.

1 Like