GitXplorerGitXplorer
b

koa-server

public
52 stars
2 forks
19 issues

Commits

List of commits on branch main.
Verified
ed33300632ca5f36f1736ca7c1a8f37c96807d62

build(deps): bump mongoose from 8.9.3 to 8.9.4 (#896)

ddependabot[bot] committed 5 days ago
Verified
2f56ef63ec27f0091001c0c0938fd3f3cb170700

build(deps): bump mongodb-client-encryption from 6.1.0 to 6.1.1 (#885)

ddependabot[bot] committed 12 days ago
Verified
daf3e83c329d037f5809187f1e27c17fdb4ef6b9

build(deps): bump mongoose from 8.9.1 to 8.9.3 (#894)

ddependabot[bot] committed 12 days ago
Verified
2e9c9a07bc2bb568a087b3537c9ab31592cfe17c

build(deps): bump graphql from 16.9.0 to 16.10.0 (#890)

ddependabot[bot] committed a month ago
Verified
6741f1773f5f0940086d3e5512c84e1f65a770aa

build(deps): bump react-dom from 18.3.0 to 19.0.0 (#881)

ddependabot[bot] committed a month ago
Verified
e1ab10a699ceb4c4ef12ab442ca1fc2463ea08bb

build(deps): bump mongoose from 8.8.4 to 8.9.1 (#889)

ddependabot[bot] committed a month ago

README

The README file for this repository.

image

koa-server

GraphQL Back-end Server with Relay, Koa, MongoDB and Mongoose

Tests Passing Coverage Status follow on Twitter

🚧 WIP 🚧

Note See Front-end project graphql-relay-web

Stack

  • [x] Koa
  • [x] MongoDB
  • [x] Mongoose
  • [x] GraphQL
  • [x] Relay
  • [x] Jest
  • [x] SuperTest
  • [x] Code Coverage(Coverall) see
  • [x] Linter (Eslint)
  • [x] Prettier

Project architecture

.
├── graphql/
│   └── schema.graphql
├── script
├── src/
│   ├── __tests__
│   ├── database
│   ├── graphql
│   ├── modules/
│   │   ├── event/
│   │   │   ├── __tests__
│   │   │   ├── fixure
│   │   │   ├── mutations/
│   │   │   │   ├── __tests__
│   │   │   │   ├── EventCreateMutation.ts
│   │   │   │   ├── EventDeleteMutation.ts
│   │   │   │   ├── EventUpdateMutation.ts
│   │   │   │   └── index.ts
│   │   │   ├── EventFilterInputType.ts
│   │   │   ├── EventLoader.ts
│   │   │   ├── EventModel.ts
│   │   │   └── EventType.ts
│   │   └── node/
│   │       └── typeRegister.ts
│   ├── schema/
│   │   ├── MutationType.ts
│   │   ├── QueryType.ts
│   │   └── schema.ts
│   └── shared
└── test

Getting Started

  • clone this repo
# install dependencies
> yarn
# or
> yarn install

# copy .env file
> cp .env.example .env

# start project
> yarn start

# see on GraphiQL graphql interface on localhost link
http://localhost:9000/graphql

# or see graphql Playground
http://localhost:9000/playground

Generating the schema

> yarn schema

Create events manually

> yarn seed

to-do

demo

Mutations

  • Event Create Mutation
mutation {
  EventCreate(
    input: {
      eventId: 564654
      name: "nice event"
      start: "2022-07-01T00:00:00.000Z"
      end: "2022-07-01T23:59:59.000Z"
      allDay: false
    }
  ) {
    event {
      id
      name
      start
      end
      allDay
    }
    error
    success
  }
}
  • Event delete Mutation
mutation {
  EventDelete(input: { eventId: "629521641ff2c2c8f5f2e449" }) {
    eventId
    error
    success
  }
}
  • Event Update Mutation
mutation {
  EventUpdate(
    input: {
      eventId: "62952906f5c651ced019adf3"
      name: "nice event /o/"
      start: "2022-07-01T00:00:00.000Z"
      end: "2022-07-01T23:59:59.000Z"
      allDay: false
    }
  ) {
    event {
      id
      name
      start
      end
      allDay
    }
    error
    success
  }
}

Queries

  • Event queries
query {
  events {
    edges {
      node {
        name
        start
        end
        allDay
      }
    }
  }
}

contributions

Feel free to contribute to this project, if you find any bugs or improvements, open an issue and send a PR about it \o/