structure-graphql

Tool for structuring the GraphQL project

this package has been deprecated
Last updated 2 years ago by viacheslavyefremov .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install structure-graphql 
SYNC missed versions from official npm registry.

structure-graphql

Tool for structuring the GraphQL project.

Usage

  1. Define the convenient structure. For instance:
src/
  |- graphql/
      |- author/
      |   |- resolver.ts
      |   |- schema.graphql
      |
      |- book/
          |- resolver.ts
          |- schema.graphql
  1. Import all schemas and resolvers from the following folder.
const { typeDefs, resolvers } = getTypesAndResolvers({
  folder: 'src/graphql'
})
  1. Use them for the schema.
import { makeExecutableSchema } from 'graphql-tools'

const schema = makeExecutableSchema({ typeDefs, resolvers })

Notes

  • Schema extensions: .graphql, .gql
  • Resolver extensions: .js, .ts
  • Resolver filenames: resolver (default).
    • This is a custom option that can be set in the resolversFilename field. Also can be a glob (e.g. *resolver).

Current Tags

  • 1.0.4                                ...           latest (2 years ago)

5 Versions

  • 1.0.4 [deprecated]           ...           2 years ago
  • 1.0.3 [deprecated]           ...           2 years ago
  • 1.0.2 [deprecated]           ...           2 years ago
  • 1.0.1 [deprecated]           ...           2 years ago
  • 1.0.0 [deprecated]           ...           2 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 1
Dependencies (3)
Dev Dependencies (6)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |