Example usage of GraphQL with ZEIT's micro
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
README.md

README.md

Micro-graphql

Example usage of GraphQL with ZEIT's micro

Installation

npm install -g micro or yarn global add micro

Usage

Create an index.js file with the following contents:

const { buildSchema } = require('graphql')
const graphqlHTTP = require('express-graphql')

const schema = buildSchema(`
  type Query {
    hello: String
  }
`)

const rootValue = {
  hello: () => 'Hello world'
}

module.exports = graphqlHTTP({
  schema,
  rootValue,
  graphiql: true
})

Then run micro index.js

Boilerplates

Kennet Postigo made an excellent boilerplate based on the example above: hyperfuse/micro-graphql

Alternatives

Micro with Apollo