Skip to content

Conversation

@fabien0102
Copy link
Contributor

Use case

I want to have all posts tags without draft (as bricolage.io)

My graphql query:

{
  allMarkdownRemark(
      limit: 2000,
      frontmatter: {
        draft: {
          ne: true
        }
      }
    ) {
      groupBy(field: frontmatter___tags) {
        fieldValue
        totalCount
      }
    }
}

BUT! No one of my posts have draft: true, so I can't query on draft (no present in my schema)… BTW, I tried to add a draft: false to force have draft into my schema! So, I find a new issue (all non-truthy values are removed)

@gatsbybot
Copy link
Collaborator

Deploy preview ready!

Built with commit ced351f

https://deploy-preview-829--gatsbyjs.netlify.com

@gatsbybot
Copy link
Collaborator

Deploy preview ready!

Built with commit ced351f

https://deploy-preview-829--gatsbygram.netlify.com

@KyleAMathews
Copy link
Contributor

Oooo much better!

@KyleAMathews KyleAMathews merged commit 0e9731b into gatsbyjs:1.0 Apr 20, 2017
@KyleAMathews
Copy link
Contributor

Yeah, _.isNil is what I wanted not truthy

@fabien0102 fabien0102 deleted the 1.0-fix-boolean-frontmatter branch April 23, 2017 12:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants