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()]
};

Package Sidebar

Install

npm i rollup-plugin-graphql-tag

Weekly Downloads

41

Version

0.1.0

License

MIT

Unpacked Size

15.1 kB

Total Files

7

Last publish

Collaborators

  • timhall