@nodeframe/apollo-tools
Features ======= - wite Resolver with es-decorator styke
Last updated 2 years ago by nodeframe .
ISC · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @nodeframe/apollo-tools 
SYNC missed versions from official npm registry.

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
)

Current Tags

  • 1.0.1                                ...           latest (2 years ago)

1 Versions

  • 1.0.1                                ...           2 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 2
Last Day 0
Last Week 2
Last Month 5
Dependencies (2)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |