Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Where does allContentfulPerson, etc come from? #12

Open
unformatt opened this issue Apr 23, 2019 · 1 comment
Open

Where does allContentfulPerson, etc come from? #12

unformatt opened this issue Apr 23, 2019 · 1 comment

Comments

@unformatt
Copy link

I'm coming from there:
https://app.contentful.com/spaces/tns8ne4b11g0/onboarding/explore

It mentions

async function getPeople() {
  const entries = await client.getEntries({ content_type: 'person' })
  return entries.items
}

However, this is nowhere in the src code. The code uses this:

export const pageQuery = graphql`
  query ArbitraryNameHomeQuery {
    allContentfulBlogPost(sort: { fields: [publishDate], order: DESC }) {
      edges {
        node {
          title
          slug
          publishDate(formatString: "MMMM Do, YYYY")
          tags
          heroImage {
            sizes(maxWidth: 350, maxHeight: 196, resizingBehavior: SCALE) {
             ...GatsbyContentfulSizes_withWebp
            }
          }
          description {
            childMarkdownRemark {
              html
            }
          }
        }
      }
    }
    allContentfulPerson(filter: { id: { eq: "c15jwOBqpxqSAOy2eOO4S0m" } }) {
      edges {
        node {
          name
          shortBio {
            shortBio
          }
          title
          heroImage: image {
            sizes(
              maxWidth: 1180
              maxHeight: 480
              resizingBehavior: PAD
              background: "rgb:000000"
            ) {
              ...GatsbyContentfulSizes_withWebp
            }
          }
        }
      }
    }
  }
`

Where does allContentfulPerson come from?

@skeet
Copy link

skeet commented Feb 23, 2021

I wasn't sure about this either but found out it's a gatsby-source-contentful convention - https://www.gatsbyjs.com/plugins/gatsby-source-contentful/#how-to-query-for-nodes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants