Skip to content
This repository has been archived by the owner on Feb 4, 2022. It is now read-only.

Commit

Permalink
Cleaning up GraphQL queries
Browse files Browse the repository at this point in the history
  • Loading branch information
cnocon committed Dec 28, 2020
1 parent 7928170 commit 9a5530d
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 21 deletions.
2 changes: 0 additions & 2 deletions gatsby-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,10 @@
* See: https://www.gatsbyjs.org/docs/node-apis/
*/
const path = require('path');
const { postCategoriesDataQuery } = require('./queries/postCategoriesData');
const { allPostsDataQuery } = require('./queries/allPostsData');
const { chunkArray } = require('./helpers/chunkArray');

exports.createPages = async ({ actions, graphql }) => {
const categoriesData = await graphql(postCategoriesDataQuery);
const allPostsData = await graphql(allPostsDataQuery);
const allPosts = allPostsData.data.allButterPost.edges.reverse();
const chunkedPosts = chunkArray(allPosts, 3);
Expand Down
2 changes: 1 addition & 1 deletion queries/allPostsData.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const allPostsDataQuery = `{
allButterPost(filter: {categories: {elemMatch: {slug: {in: ["growth", "npm","node","netlify","webhooks","gatsby","cli","git","sass","javascript","workflow"]}}}}, sort: {fields: created}) {
allButterPost(sort: {fields: created}) {
edges {
node {
id
Expand Down
18 changes: 0 additions & 18 deletions queries/postCategoriesData.js

This file was deleted.

0 comments on commit 9a5530d

Please sign in to comment.