All Articles

Day 23

Day 3 - Adding custom query

The main interesting note in todays vidoes was how we can add custom metatdata to a query.

The example we worked with was modifying the footer for the basic Gatsby starter site. After changing the author name, we added a whole new field and named it ‘createdAt’. The field was not available through the ___graphql site until we restarted the dev server.

Not the most terribly exciting discovery but rather interesting to me. I think this is one of those smaller ‘aha!’ moments but for the life of me I can’t figure out why, at least not yet.

After adding the new field to our layout.js file, we jumped into adding a new blog.js file which we’ll be adding a query to look through newly added markdown files and show them. All in all this so far is everything I had already done while going through the Gatsbyjs.org tutorials. I’m encouraged by the mini aha, and there is still a lot of content to go. Maybe it’ll be worth it in the end, maybe it’ll just be a review and not the ‘master class’ that the title promises.