Querying content
For any content model you create, Hygraph will automatically generate queries to fetch content entries, as well as mutations to create, update, delete, publish, and unpublish them.
You can try out all of the queries, and mutations your project has inside of the API Playground.
You can visit the API Playground by navigating to it from the sidebar:
API Playground
If you begin to type inside of the API Playground product
you will see autosuggest recommend some queries. We'll get the query to fetch a single product entry, multiple, an individual product version, and the connection query to fetch edges/nodes.
GraphQL query
Let's use the products
query to fetch all of our product content entries, as well as the fields for name
, price
, and the image
:
{products {namepriceimage {urlfileName}}}
If you execute this query using the "Play icon" you'll get the results of the content entries you saved.
Execute operation
You'll want to explore the API Reference to explore more of the API functionlity. This includes filtering, pagination, ordering, transforming image assets, and more.