1.2.3-alpha • Published 5 years ago
@jjsoft2018/graphql-harmony v1.2.3-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 ./docs
1.2.3-alpha
5 years ago
1.2.2-alpha
5 years ago
1.2.1-alpha
5 years ago
1.2.0-alpha
5 years ago
1.1.9-alpha
5 years ago
1.1.8-alpha
5 years ago
1.1.7-alpha
5 years ago
1.1.6-alpha
5 years ago
1.1.5-alpha
5 years ago
1.1.4-alpha
5 years ago
1.1.3-alpha
5 years ago
1.1.2-alpha
5 years ago
1.1.1-alpha
5 years ago
1.1.0-alpha.1
5 years ago
1.1.0-alpha.0
5 years ago
1.0.0-alpha
5 years ago
0.0.14
5 years ago
0.0.13
5 years ago
0.0.12
5 years ago
0.0.11
5 years ago
0.0.10
5 years ago
0.0.9
5 years ago
0.0.8
5 years ago
0.0.7
5 years ago
0.0.6
5 years ago
0.0.5
5 years ago