GithubHelp home page GithubHelp logo

staccats / koa-graphql-template Goto Github PK

View Code? Open in Web Editor NEW

This project forked from sunxiuguo/koa-graphql-template

0.0 0.0 0.0 1.13 MB

This is a koa Graphql server template build with typescript, use type-graphql and typegoose

License: MIT License

JavaScript 13.00% TypeScript 87.00%

koa-graphql-template's Introduction

preview

TypeScript and Koa GraphQL Server Template

This is a koa GraphQL template build with typescript

Include

  • Koa2
  • apollo-server-koa v2
  • GraphQL(use type-graphql)
  • mongodb (use mongoose + typegoose as orm)
  • eslint
  • nodemon
  • prettier

Getting Started

  1. install all dependencies

    yarn

  2. install mongodb

    brew tap mongodb/brew

    brew install [email protected]

  3. start mongo service

    brew services start [email protected]

  4. start server

    yarn serve

  5. visit GraphQL

    http://localhost:4000/graphql

    5.1 try to create a mutation

    mutation {
        saveInfo(data: { hobby:["唱","跳","rap","篮球"], height:"165", weight: 100}){
            hobby
            height
            weight
        }
    }
    

    then you will see

    5.2 try to query

    query {
        #   students(age:22){
        #     sex
        #     name
        #     age
        #   }
    
        #   studentsWithInfo {
        #     sex
        #     name
        #     age
        #   }
    
        infos {
            _id
            height
            weight
            hobby
        }
    }
    

    then you will see

koa-graphql-template's People

Contributors

sunxiuguo avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.