Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

graphql-koa-scripts

Package Overview
Dependencies
Maintainers
1
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

graphql-koa-scripts

-

latest
npmnpm
Version
2.0.5
Version published
Maintainers
1
Created
Source

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

FAQs

Package last updated on 23 Sep 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts