Load Data using GraphQL Queries in a Gatsby Component with StaticQuery
summary
Builds a small Gatsby starter site and proves a component can fetch build-time data itself using a GraphQL query rather than relying on a page query. Uses Node.js + Gatsby, a local siteMetadata JSON file as the data source, React components and the Gatsby StaticQuery (or its hook) to inject the title into a header. One simple GraphQL query returns the title and the page renders it successfully, demo runs end-to-end.
AI-written summary · about
chapters (8)
- 0:00Start
- 2:54Gatsby and Graphql
- 5:04What Is Gatsby
- 22:17Building a Brand New Gatsby Website
- 23:30Add a React Header
- 28:32Import Graphql
- 31:06Static Queries
- 31:51The Static Query Hook
related talks
27mBeyond Static: Dynamic Web Applications with Gatsby
25mLive coding a Portfolio with Gatsby + GraphQL
38mLIVE DEMO: Using GatsbyJS to build a decoupled (Drupal) website
50mUsing GatsbyJS to build a decoupled (Drupal) website (Live demo)
17mThe Client-Side Revolution, Brought to You by React
45mPump up the JAM with Gatsby
59mGoodbye REST; Hello GraphQL
28mCurious Use Cases of GraphQL
