1.2.11 • Published 6 years ago

apollo-directives-package v1.2.11

Weekly downloads
2,263
License
MIT
Repository
github
Last release
6 years ago

Apollo-directives-package

npm package

This is directives package for Apollo

Usage example

in .js

var { RenameDirective } = require('apollo-directives-package') // in VanillaJS(javascript)
// or
import { RenameDirective } from 'apollo-directives-package' // in ES

const schema = makeExecutableSchema({
  schemaDirectives: {
    ...
    rename: RenameDirective,
  }
})

in .ts

// in Typescript
import { RenameDirective } from 'apollo-directives-package'

const schema = makeExecutableSchema({
  schemaDirectives: {
    ...
    rename: RenameDirective, // if graphql-tools >= 3.x.x
    rename: RenameDirective as any, // if graphql-tools < 3.x.x
  }
})
type Query {
  getBook: Book
  anotherGetBook: Book @rename(type: "Query", to: "allBook")
}

type Mutation {
  createBook(title: "Apollo Directives Package"): Book
  newBook(title: "Apollo Directives Package"): Book @rename(type: "Mutation", to: "createBook")
}

Directives list

  1. RenameDirective: To rename(redirect) other Query, Mutation, Field resolve

Please pull-request to update your awesome directive!🤩 and give me your username in github, npm to register collaborators.

To Do

Bugs

  • Directive type is no match in Typescript -> Resolved.(Refer to version of graphql-tools)
makeExecutableSchema({
    schemaDirectives: {...} // <- type no match error in Typescript
})

License

Code copyright 2018 Yoonho Go. Code released under the MIT license.

1.2.11

6 years ago

1.2.10

6 years ago

1.1.10

7 years ago

1.1.9

7 years ago

1.0.9

7 years ago

1.0.8

7 years ago

1.0.7

7 years ago

1.0.6

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago