These are the docs for v2, which has an open maintenance window until April 1, 2021. View the v3 docs.

  • Gatsbyjs.com
    Gatsbyjs.com
  • Gatsby Cloud
    Gatsby Cloud
  • Support
    Support
  • Contact
    Contact
  • Log in
    Log in
docs
    • Tutorial
      Tutorial
    • How-to Guides
      How-to Guides
    • Reference
      Reference
    • Conceptual Guide
      Conceptual Guide
    • Quick Start
      Quick Start
    • v2

      • v3

        v3

      • v2

        v2

      • v1

        v1

DocumentationHow-to Guides
Docs

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
  • Accessibility Statement
  • Code of Conduct
  • Logo & Assets
  • Privacy Policy
  Docs
  • How-to Guides
    • Overview
    • Overview
    • How to use Gatsby without GraphQL
    • How to explore the data layer using GraphiQL
    • How to query for data in a page
    • How to query for data in a component with the useStaticQuery hook
    • Additional Guides 1