npm

Ready to take your JavaScript development to the next level? Meet npm Enterprise - the ultimate in enterprise JavaScript. Learn more »

@nodeframe/apollo-tools

1.0.1 • Public • Published

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
)

Keywords

none

install

npm i @nodeframe/apollo-tools

Downloadsweekly downloads

7

version

1.0.1

license

ISC

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability