How to use the graphql-tag.disableFragmentWarnings function in graphql-tag

To help you get started, we’ve selected a few graphql-tag examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ember-graphql / ember-apollo-client / lib / graphql-filter.js View on Github external
'use strict';

const Filter = require('broccoli-persistent-filter');
const gql = require('graphql-tag');

gql.disableFragmentWarnings();

module.exports = class GraphQLFilter extends Filter {
  constructor(inputNode, options) {
    super(inputNode, options);
    this.extensions = ['graphql'];
    this.targetExtension = 'js';
  }

  processString(source) {
    let output = [
      `const doc = ${JSON.stringify(gql([source]), null, 2)};`,
      `export default doc;`
    ];

    source.split('\n').forEach((line, i) => {
      let match = /^#import\s+(.*)/.exec(line);

graphql-tag

A JavaScript template literal tag that parses GraphQL queries

MIT
Latest version published 3 years ago

Package Health Score

80 / 100
Full package analysis

Similar packages