Nearly Perfected Mystique

    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
      }
    });

    Keywords

    none

    Install

    npm i gqml

    DownloadsWeekly Downloads

    10

    Version

    0.6.2

    License

    MIT

    Unpacked Size

    104 kB

    Total Files

    35

    Last publish

    Collaborators

    • vaiii