gqml
TypeScript icon, indicating that this package has built-in type declarations

0.6.2 • Public • Published

gqml

a framework base on menhera graphql-yoga

examples: https://github.com/uu-z/gqml-examples

Start

$ yarn add gqml
const { gqml, gql } = require("../index");
 
gqml.yoga({
  typeDefs: gql`
    type Query {
      hello(name: String): String!
    }
  `,
  resolvers: {
    Query: {
      hello: (_, { name }) => `Hello ${name || "World"}`
    }
  },
  options: {
    context: ctx => ctx
  },
  beforeStart: ({ server }) => {
    server.get("/test", (req, res) => {
      res.send("Hello World!");
    });
  },
  listen: {
    port: 8001
  }
});

example with modules

const { gqml } = require("gqml");
require("./modules");
 
gqml.yoga({
  listen: {
    port: 8001
  }
});

Readme

Keywords

none

Package Sidebar

Install

npm i gqml

Weekly Downloads

16

Version

0.6.2

License

MIT

Unpacked Size

104 kB

Total Files

35

Last publish

Collaborators

  • vaiii