now-graphql

0.3.0 • Public • Published

now-graphql

a now builder for graphql services

usage

create an index.js file

module.exports = {
  typeDefs: `
    type Query {
      hello: String
    }
  `,
  resolvers: {
    hello: () => `hello world`
  }
  // any other apollo-server config
}

where typeDefs is a string that decscribes your schema, then create a now.json file

{
  "version": 2,
  "builds": [
    { "src": "index.js", "use": "now-graphql" }
  ],
  "routes": [
    { "src": "/graphql", "dest": "index.js" }
  ]
}

then run now to deploy with now.

Since you can use any apollo-server config, feel free to use schema or anything else you might do with that.

The default path is /graphql, but you can change that by adding path to your server, and updating your route in now.json to point to it.

Readme

Keywords

none

Package Sidebar

Install

npm i now-graphql

Weekly Downloads

1

Version

0.3.0

License

MIT

Unpacked Size

3.34 kB

Total Files

7

Last publish

Collaborators

  • lukeburns