rollup-plugin-graphql-tag

    0.1.0 • Public • Published

    rollup-plugin-graphql-tag

    Import and preprocess graphql documents using graphql-tag with rollup.

    # src/schema.graphql
    type Book {
      title: String
      author: Author
    }
     
    type Author {
      name: String
      books: [Book]
    }
     
    type Query {
      getBooks: [Book]
      getAuthors: [Author]
    }
    // src/index.js
    import { ApolloServer } from 'apollo-server';
    import typeDefs from './schema.graphql';
    import * as resolvers from './resolvers';
     
    const server = new ApolloServer({ typeDefs, resolvers });
    import gql from 'rollup-plugin-graphql-tag';
     
    export default {
      input: 'src/index.js',
      output: 'dist/index.js',
      plugins: [gql()]
    };

    Install

    npm i rollup-plugin-graphql-tag

    DownloadsWeekly Downloads

    6

    Version

    0.1.0

    License

    MIT

    Unpacked Size

    15.1 kB

    Total Files

    7

    Last publish

    Collaborators

    • timhall