New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

graphql-query-factory

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

graphql-query-factory

![CI Build Status Bar](https://travis-ci.org/alechp/graphql-query-factory.svg?branch=flow)

  • 1.0.18
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
decreased by-66.67%
Maintainers
1
Weekly downloads
 
Created
Source

GraphQL Query Batcher

CI Build Status Bar

Status

You can use QueryBuilder today. QueryBuilder takes an array of variable objects and injects them into your GraphQL query.

Roadmap

StatusSummaryComment
QueryFactoryCombines Builder & Batcher
QueryBuilderBuilds individual query strings based on the number of variable combinations you have.
QueryBatcherExecutes the entire array of GraphQL Query Strings.
Ava
FlowDependencies added but not finished
Babel
TravisCIhttps://travis-ci.org/alechp/graphql-query-factory
WebpackBabel has been useful for testing. Going to convert to webpack to enable uglification, tree-shaking, etc.

Getting Started

Installation
npm install graphql-query-factory -S
Sample Use

QueryFactory

Not available yet

QueryBuilder - Sample Project

const { builder } = require('graphql-query-factory');
const log = console.log;

const sampleMutation = `mutation {
    createContent(
      markup: $markup
      raw: $raw
    ) {
      markup
      raw
    }
  }`;

  const queryVariablesArray = [
    {
      "markup": "markup1",
      "raw": "raw1"
    },
    {
      "markup": "markup2",
      "raw": "raw2"
    },
    {
      "markup": "markup3",
      "raw": "raw3"
    }
  ];

  let queries = builder(sampleMutation, queryVariablesArray)
                .then( data =>
                    data.map(d => log(d))
                )
                .catch(err => log(`QueryBuilder failed. Error: ${err}`));

QueryBuilder Output:

mutation {
    createContent(
      markup: markup1
      raw: raw1
    ) {
      markup
      raw
    }
  }
mutation {
    createContent(
      markup: markup2
      raw: raw2
    ) {
      markup
      raw
    }
  }
mutation {
    createContent(
      markup: markup3
      raw: raw3
    ) {
      markup
      raw
    }
  }

QueryBatcher

Not available yet

Environment Variables

When using QueryBatcher() or batcher you must include two environment variables:

  • GQL_SIMPLE_ENDPOINT:
  • GQL_AUTH_TOKEN

Keywords

FAQs

Package last updated on 21 Sep 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc