@nodeframe/apollo-tools
v1.0.1
Published
Features ======= - wite Resolver with es-decorator styke
Downloads
3
Readme
Features
- wite Resolver with es-decorator styke
you can write a resolver like this
import GraphQLTools from '@nodeframe/apollo-tool'
class CommentSchema extends GraphQLTools.GraphQLResolver {
@GraphQLTools.Query
comments(...){
...
}
@GraphQLTools.Query
comment(...){
...
}
@GraphQLTools.Mutation
addComment(...){
...
}
@GraphQLTools.Subscription
commentAdded(...){
...
}
}
Usage
const comment = new CommentSchema()
comment.Resolvers
will be transformed to
{
Query:{
comments(...){
}
comment(...){
}
},
Mutation:{
addComment(...){
}
},
Subscription:{
commentAdded(...){
}
}
}
Utilities
You can merge many schemas with GraphQLTools.createResolvers
GraphQLTools.createResolvers(
CommentSchema,
TaskSchema
)