Koa GraphQL Template Save

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

Project README
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

Open Source Agenda is not affiliated with "Koa GraphQL Template" Project. README Source: sunxiuguo/Koa-GraphQL-Template
Stars
45
Open Issues
15
Last Commit
1 year ago
License
MIT

Open Source Agenda Badge

Open Source Agenda Rating