2.0.5 • Published 2 years ago

graphql-koa-scripts v2.0.5

Weekly downloads
26
License
MIT
Repository
-
Last release
2 years ago

Graphql Koa Scripts

npm node-current Build Status Coverage Status

Documentation: https://ryanhs.github.io/graphql-koa-scripts/

Motivation

This scripts made to be simplify the setup of projects. with koa + apollo graphql.

I really want to make a project setup as simple as possible:

  • index.js,
  • package.json,
  • Dockerfile (optional when needed)

Thats it! no more overhead setup.

Example index.js

With this enough index.js, graphql already setup. This what simple is?

Notes: if you use subscription on your graphql, it will automatically listen subscription-ws.

const { Server } = require('graphql-koa-scripts');

Server({
  configure: () => ({ PORT: 14099 }),

  router(_, { graphqlHandler }) {
    graphqlHandler({
      typeDefs: `
          type Query {
            hello: String
          }
        `,
      resolvers: {
        Query: {
          hello: () => 'Awesome!',
        },
      },
      endpointUrl: '/graphql',
    });
  },
})

Installation

To install just use yarn or npm. Example:

yarn add graphql-koa-scripts

Examples

API References

LICENSE

MIT

2.0.5

2 years ago

2.0.3

2 years ago

2.0.4

2 years ago

2.0.2

2 years ago

2.0.1

2 years ago

2.0.0

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago

1.0.0

2 years ago

0.0.27

3 years ago

0.0.26

3 years ago

0.0.25

4 years ago

0.0.23

4 years ago

0.0.22

4 years ago

0.0.21

4 years ago

0.0.20

4 years ago

0.0.18

4 years ago

0.0.19

4 years ago

0.0.17

4 years ago

0.0.16

4 years ago

0.0.15

4 years ago

0.0.14

4 years ago

0.0.13

4 years ago

0.0.12

4 years ago

0.0.11

4 years ago

0.0.10

4 years ago

0.0.7

4 years ago

0.0.5

4 years ago

0.0.4

4 years ago