Static Queries

Learn how to use Gatsby's useStaticQuery hook to fetch data in non-page components.

We'll cover the following...

Overview

We have learned how to fetch the data our page components need using an exported page query. Now, we look at how to fetch data for non-page components using GraphQL queries and the useStaticQuery hook. Queries made this way are called component or static queries. They are called static because ...