graphql-create-schema

    0.1.1 • Public • Published

    graphql-create-schema

    create a graphql schema using one or more files.

    Each file containing queries, mutations, types or resolvers is then merged to a single executable schema.

    js-standard-style

    usage

    const { makeExecutableSchema } = require('graphql-tools')
    const createSchema = require('graphql-create-schema')
    const types = [
      require('./user'),
      require('./product')
    ]
    const schema = createSchema(makeExecutableSchema, types)

    each file can export their own typeDefs and resolvers

    // type.js
    module.exports = {
      typeDefs: {
        query: '....',
        mutation: '....',
        types: '',
      },
      resolvers: {
        Query: {}
        Mutation: {}
      }
    }

    license

    Apache License, Version 2.0

    Install

    npm i graphql-create-schema

    DownloadsWeekly Downloads

    0

    Version

    0.1.1

    License

    Apache-2.0

    Unpacked Size

    2.88 kB

    Total Files

    5

    Last publish

    Collaborators

    • jameskyburz