Skip to content

timneutkens/micro-graphql

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 

Repository files navigation

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

About

Example usage of GraphQL with ZEIT's micro

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published