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

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

  • 1.0.9
  • Source
  • npm
  • Socket score

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

GraphQL Query Batcher

Status

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

Roadmap

  • QueryFactory - Combines Builder & Batcher
  • QueryBuilder - Builds individual query strings based on the number of variable combinations you have.
  • QueryBatcher - Executes the entire array of GraphQL Query Strings.
  • Ava Tests
  • CI status bar

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 addMarkup($markup:String!, $raw: String!) {
    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 addMarkup($markup:String!, $raw: String!) {
    createContent(
      markup: markup1 
      raw: raw1
    ) {
      markup
      raw
    }
  }
mutation addMarkup($markup:String!, $raw: String!) {
    createContent(
      markup: markup2 
      raw: raw2
    ) {
      markup
      raw
    }
  }
mutation addMarkup($markup:String!, $raw: String!) {
    createContent(
      markup: markup3 
      raw: raw3
    ) {
      markup
      raw
    }
  }

QueryBatcher

Not available yet

Keywords

FAQs

Package last updated on 07 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