Querying For Data

Once data is pulled into Gatsby, your pages and components specify what data they access through GraphQL queries.

 Main Guides 4

How to use Gatsby without GraphQL

If you find GraphQL confusing, or just want to simplify things, it’s possible to use an “unstructured data” approach -- no GraphQL required.

How to explore the data layer using GraphiQL

GraphiQL is a query IDE available in local development. It shows you the data that a GraphQL query returns alongside that query. Most Gatsby users compose their queries in GraphiQL and then cut-and-paste them into their Javascript files.

How to query for data in a page

Pages can specify exactly the data they require from sources via GraphQL queries.

How to query for data in a component with the useStaticQuery hook

Components can specify exactly the data they require from sources via GraphQL queries, though they cannot use variables in the query.

 Additional Guides 1

  • Query for data in a component with the StaticQuery component