1.1.2-alpha • Published 6 years ago
@jjsoft2018/graphql-harmony v1.1.2-alpha
Graphql Harmony
feature & complete
- graphql endpoint
- graphql playground
- graphql cache
- net server
- error handling
- cache
How to start server
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
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
yarn docs
# and see files in ./docs1.2.3-alpha
6 years ago
1.2.2-alpha
6 years ago
1.2.1-alpha
6 years ago
1.2.0-alpha
6 years ago
1.1.9-alpha
6 years ago
1.1.8-alpha
6 years ago
1.1.7-alpha
6 years ago
1.1.6-alpha
6 years ago
1.1.5-alpha
6 years ago
1.1.4-alpha
6 years ago
1.1.3-alpha
6 years ago
1.1.2-alpha
6 years ago
1.1.1-alpha
6 years ago
1.1.0-alpha.1
7 years ago
1.1.0-alpha.0
7 years ago
1.0.0-alpha
7 years ago
0.0.14
7 years ago
0.0.13
7 years ago
0.0.12
7 years ago
0.0.11
7 years ago
0.0.10
7 years ago
0.0.9
7 years ago
0.0.8
7 years ago
0.0.7
7 years ago
0.0.6
7 years ago
0.0.5
7 years ago