# @jjsoft2018/graphql-harmony

> [![pipeline status](https://gitlab.jjsoft.kr/DONNA/graphql-harmony/badges/master/pipeline.svg)](https://gitlab.jjsoft.kr/DONNA/graphql-harmony/commits/master) [![coverage report](https://gitlab.jjsoft.kr/DONNA/graphql-harmony/badges/master/coverage.svg)](

Latest version **1.2.3-alpha** (published 2019-10-24) · MIT license · 0 weekly downloads

## Install

```sh
npm install @jjsoft2018/graphql-harmony
pnpm add @jjsoft2018/graphql-harmony
yarn add @jjsoft2018/graphql-harmony
bun add @jjsoft2018/graphql-harmony
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.3-alpha |
| Published | 2019-10-24 |
| First published | 2018-12-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 15 |
| Unpacked size | 1.8 MB |
| Known vulnerabilities | 0 (+4 in 2 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | BichiKim |
| Maintainers | jjsoft |

## Links

- npm: https://www.npmjs.com/package/@jjsoft2018/graphql-harmony
- Repository: https://github.com/bichikim/graphql-type-server
- Homepage: https://github.com/bichikim/graphql-type-server#readme
- Issues: https://github.com/bichikim/graphql-type-server/issues
- npm.io page: https://npm.io/package/@jjsoft2018/graphql-harmony

## Dependencies (15)

- [cors](https://npm.io/package/cors.md) ^2.8.5
- [lodash](https://npm.io/package/lodash.md) ^4.17.11
- [express](https://npm.io/package/express.md) ^4.16.4
- [graphql](https://npm.io/package/graphql.md) 14.1.1
- [fs-extra](https://npm.io/package/fs-extra.md) ^7.0.1
- [commander](https://npm.io/package/commander.md) ^2.19.0
- [body-parser](https://npm.io/package/body-parser.md) ^1.19.0
- [jsonwebtoken](https://npm.io/package/jsonwebtoken.md) ^8.5.1
- [type-graphql](https://npm.io/package/type-graphql.md) ^0.17.1
- [@types/fs-extra](https://npm.io/package/@types/fs-extra.md) ^5.0.4
- [class-validator](https://npm.io/package/class-validator.md) ^0.9.1
- [reflect-metadata](https://npm.io/package/reflect-metadata.md) ^0.1.13
- [graphql-extensions](https://npm.io/package/graphql-extensions.md) ^0.5.7
- [@types/jsonwebtoken](https://npm.io/package/@types/jsonwebtoken.md) ^8.3.0
- [apollo-server-express](https://npm.io/package/apollo-server-express.md) ^2.4.8

## Recent versions

- 1.2.3-alpha (latest) — 2019-10-24
- 1.1.0-alpha.1 (alpha) — 2019-04-11
- 1.2.2-alpha — 2019-10-18
- 1.2.1-alpha — 2019-10-11
- 1.2.0-alpha — 2019-10-11
- 1.1.9-alpha — 2019-10-05
- 1.1.8-alpha — 2019-10-05
- 1.1.7-alpha — 2019-08-13
- 1.1.6-alpha — 2019-08-13
- 1.1.5-alpha — 2019-08-13
- 1.1.4-alpha — 2019-07-23
- 1.1.3-alpha — 2019-07-23
- 1.1.2-alpha — 2019-05-17
- 1.1.1-alpha — 2019-05-17
- 1.1.0-alpha.0 — 2019-04-11
- … 11 more at https://npm.io/package/@jjsoft2018/graphql-harmony/versions

## README

# Graphql Harmony

[![pipeline status](https://gitlab.jjsoft.kr/DONNA/graphql-harmony/badges/master/pipeline.svg)](https://gitlab.jjsoft.kr/DONNA/graphql-harmony/commits/master)
[![coverage report](https://gitlab.jjsoft.kr/DONNA/graphql-harmony/badges/master/coverage.svg)](https://gitlab.jjsoft.kr/DONNA/graphql-harmony/commits/master)

## feature & complete
- [x] graphql endpoint
- [x] graphql playground 
- [x] graphql cache
- [x] net server
- [x] error handling
- [ ] cache

## How to start server
```typescript
import {GraphqlServer} from './src'
const server = new GraphqlServer()
server.start({
  // see ./src/GraphqlServer/__types.ts IGraphqlServerOptions
}).then(({address}) => {
  const info = address()
  console.log(`server was started at ${info.address}::${info.port}`)
  server.stop().then(() => {
    console.log('server stopped')
  })
})

```

## How to create query
```typescript
import {Query, Resolver, Arg} from 'type-graphql'
import {HarmonyError, Err, ErrorGroup, ErrorItem} from './src'

class MyResolverError extends ErrorGroup {
  @Err() justError: ErrorItem = 'just error' as any
}

const myErrors = new MyResolverError()

@Resolver()
class MyResolver {
  @Query()
  getSomething(@Arg() name: string) {
    if(name === 'bichi'){
      // how to throw error
      throw new HarmonyError(myErrors.justError)
    }
    return name
  }
}
```

## using suggestion

refer to `./exapmles`


## Options
> see src/GraphqlServer/types.ts>IGraphqlServerOptions

## docs
```bash
yarn docs
# and see files in ./docs
```

---
_Source: https://npm.io/package/@jjsoft2018/graphql-harmony · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
