Example of Gatsby source plugin for GraphCMS
Clone or download
Latest commit 925a89c Jan 15, 2019

README.md

gatsby-graphcms-example

Example of @GraphCMS/gatsby-source-graphcms

Install

  1. git clone https://github.com/GraphCMS/gatsby-graphcms-example.git && cd gatsby-graphcms-example/
  2. yarn && yarn develop

GraphiQL

For an kitchen sink GraphiQL query you can run on Gatsby’s graphql debugger at http://localhost:8000/___graphql, try this link to preload with gatsby develop running:

Preload kitchen sink GraphiQL query

It puts this in the console:

{
  allArtist {
    edges {
      artist: node {
        id
        name
        slug
        picture {
          id
          handle
          width
          height
        }
        records {
          id
          slug
          title
        }
      }
    }
  }
  allRecord {
    edges {
      record: node {
        id
        slug
        title
        artist {
          id
          slug
          name
        }
        tracks {
          id
          title
          aliasedLength
        }
        cover {
          handle
        }
        reviews {
          id
          slug
          title
        }
      }
    }
  }
  allReview {
    edges {
      review: node {
        id
        slug
        createdAt
        record {
          slug
          title
          artist {
            slug
            name
          }
        }
        title
        review
        rating
        comments {
          body
        }
      }
    }
  }
}

Deploy

Deploy to Netlify

Contributors

and you?

Current limitations

See https://github.com/GraphCMS/gatsby-source-graphcms for more.