ezonno / gatsby-mesh-example

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

gatsby-mesh-example

Example of @gentics/gatsby-source-mesh Please file any issues over there.

Install

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

You can either choose to use this example in combination with the preconfigured Gentics Mesh Demo instance which will be regularly resetted or you can download the Gentics Mesh Demo server and start it via java -jar mesh-demo-x.y.z.jar. In that case you can update the gatsby-config.js and use http://localhost:8080/api/v1/demo/graphql instead.

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:

{
  vehicles: allNodes(filter: {schema: {name: {eq: "vehicle"}}}) {
    edges {
      node {
        data {
          slug
          name
          description
          weight
          vehicleImage {
            uuid
            path
            fields {
              image {
                width
                height
              }
            }
          }
        }
      }
    }
  }
  categories: allNodes(filter: {schema: {name: {eq: "category"}}}) {
    edges {
      node {
        childrenNodes {
          id
          data {
            name
            slug
          }
        }
        data {
          slug
          name
        }
      }
    }
  }
}

Deploy

Deploy to Netlify

See https://github.com/gentics/gatsby-source-mesh for more.

Fork

This example is a fork of the gatsby-graphcms example.

About

License:MIT License


Languages

Language:CSS 56.2%Language:JavaScript 43.8%