GatsbyJS is React-based framework for building static sites. Because Gatsby uses GraphQL as its data source, we can use a lot of helpful GraphQL features to help streamline our code. In this article, I’ll show how to use GraphQL fragments in Gatsby queries and how to share those queries across your project.
GraphQL fragments are “reusable units” of query fields that can be used within the same query or across multiple queries.
Let’s use a GatsbyJS-powered blog as an example of how to make and reuse fragments.
In this example, our blog uses a template file
blog-post.js to build pages…
In day-to-day development, we run across smaller tasks that need to parse and structure a hefty amount of data. One programming pattern we can use is MapReduce, which allows large datasets to be broken up and processed concurrently. Being appropriately named, MapReduce is primarily two steps: a
map, where data is divided into a distinct part (and sometimes transformed), and a
reduce, where the data is combined into the desired output (a sum or list). MapReduce programs are often created for huge amounts of data and are run across clusters of processors.
Software Engineer @ The Flatiron School.