Go Pro Sign Up Login

Buy Now and unlock this series

$

44

.99

$

34

.99

yours forever

Become a Pro and unlock everything

$

24

.99

per month

GraphQL Static Queries

In this video, we will dive deeper into GraphQL and understand what exactly is happening within our project and how it is integrating with GraphQL. We will look at our static query component and the GraphQL query function within the render prop.

Downloads

Become a pro to download code and videos

Comments

User avatar

Rocky

over 2 years ago

@mike connor Noticed it too. The newer Gatsby version (im currently using 2.8.22) is a lot cleaner. It's using hooks, it's a standard return statement, and the SEO/helmet piece has been moved.

But you can still test your new data by putting description in the query, and then calling it in the return with {data.site.siteMetadata.description}

Pretty handy and awesome!

mike connor

over 2 years ago

this is relevant to chp. 6.

Gatsby v2.1.0 introduces useStaticQuery, a new Gatsby feature that provides the ability to use a React Hook to query with GraphQL at build time.

The old way uses a render prop. The new way uses a hook. To me - seems like less typing and easier to look at. Interesting to put Scott's Header code up side by side w/ the Header component in the ver 2.1 code.

Nick

about 3 years ago

It moved to the SEO component =)

Nick

about 3 years ago

Gastsby changes a lot - you are using a more recent version

Pat B

about 3 years ago

I should say, where does Helmet come from?

Pat B

about 3 years ago

Where does come from? My site didn't build with that tag.

Want to join the conversation?

Become a Pro member today!