GraphQL - How to query the shop pages by metafields

New Member
1 0 0

Using GraphQL, I can't seem to find a solution to query specific shop pages by metafields.


Use case:


We added a few metafields to the Online Store -> Pages. An example of a custom field is "Page Type", which can be one of three selections.


Is it currently possible to run a graphql query and only return results that match the metafield conditions?


Example: select * from shopPages where pageType = category.


I know we're not using SQL, but just want to show the type of graphql query we're trying to accomplish.



Shopify Staff
Shopify Staff
1125 78 159

Hello @blackandred , 


At this time, it isn't possible to query pages based on metafield via the Storefront or Admin APIs. Querying pages in the Admin API in general appears to be lacking quite a bit of functionality actually, if I'm being honest - but the Storefront API also only allows for querying pages based on either created_at, updated_at, title, or handle.