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 - npm Package Compare versions

Comparing version 1.0.14 to 1.0.15

17

dist/batcher.js

@@ -12,3 +12,3 @@ "use strict";

let batcherHandle = new QueryBatcher(queries, concurrent);
let executedBatchPromise = batcherHandle.batchQueryExecute();
let executedBatchPromise = batcherHandle.queryBatchExecute();
return executedBatchPromise;

@@ -18,3 +18,3 @@ }

class QueryBatcher {
constructor(queries, concurrent) {
constructor(queries, concurrent = 4) {
this.queries = queries;

@@ -35,15 +35,8 @@ this.concurrent = concurrent;

}
batchQueryExecute() {
async queryBatchExecute() {
let queries = this.getQueries();
let concurrent = this.getConcurrent();
let sliced = this.sliceQueryArray(queries, concurrent);
// let target = sliced.target;
// let original = sliced.original; //TODO: refactor "original" to "remaining"
// if (target !== undefined) {
// for (let query in target) {
// client.query({});
// }
// } else {
// return sliced;
// }
let res = Promise.all(sliced.target.map(this.queryExecute));
return res;
}

@@ -50,0 +43,0 @@

@@ -10,4 +10,4 @@ "use strict";

createContent(
markup: markup1
raw: raw1
markup: "markupA"
raw: "rawA"
) {

@@ -19,4 +19,4 @@ markup

createContent(
markup: markup2
raw: raw2
markup: "markupB"
raw: "rawB"
) {

@@ -28,4 +28,4 @@ markup

createContent(
markup: markup3
raw: raw3
markup: "markupC"
raw: "rawC"
) {

@@ -37,4 +37,4 @@ markup

createContent(
markup: markup4
raw: raw4
markup: "markupD"
raw: "rawD"
) {

@@ -46,4 +46,4 @@ markup

createContent(
markup: markup5
raw: raw5
markup: "markupE"
raw: "rawE"
) {

@@ -55,4 +55,4 @@ markup

createContent(
markup: markup6
raw: raw6
markup: "markupF"
raw: "rawF"
) {

@@ -64,4 +64,4 @@ markup

createContent(
markup: markup7
raw: raw7
markup: "markupE"
raw: "rawE"
) {

@@ -75,4 +75,4 @@ markup

createContent(
markup: markup1
raw: raw1
markup: "markupA"
raw: "rawA"
) {

@@ -84,4 +84,4 @@ markup

createContent(
markup: markup2
raw: raw2
markup: "markupB"
raw: "rawB"
) {

@@ -119,7 +119,2 @@ markup

test("execute consecutive queries", async t => {
//TODO
t.pass();
});
test("execute two types of queries <query> && <mutation>", async t => {

@@ -132,4 +127,6 @@ //TODO

//TODO
let q = new QueryBatcher(sampleQueries);
let res = q.queryBatchExecute();
t.pass();
});
//
{
"name": "graphql-query-factory",
"version": "1.0.14",
"version": "1.0.15",
"description": "",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -18,3 +18,3 @@ # GraphQL Query Batcher

| ✓ | TravisCI | [https://travis-ci.org/alechp/graphql-query-factory](https://travis-ci.org/alechp/graphql-query-factory)|
| ☐ | Webpack | Babel has been useful for testing. Going to convert to webpack to enable uglification, tree-shaking, etc. |
## Getting Started

@@ -21,0 +21,0 @@ #### Installation

@@ -11,3 +11,3 @@ //@flow

let batcherHandle = new QueryBatcher(queries, concurrent);
let executedBatchPromise = batcherHandle.batchQueryExecute();
let executedBatchPromise = batcherHandle.queryBatchExecute();
return executedBatchPromise;

@@ -19,3 +19,3 @@ }

concurrent: number;
constructor(queries, concurrent) {
constructor(queries, concurrent = 4) {
this.queries = queries;

@@ -36,15 +36,8 @@ this.concurrent = concurrent;

}
batchQueryExecute(): mixed {
async queryBatchExecute(): mixed {
let queries = this.getQueries();
let concurrent = this.getConcurrent();
let sliced = this.sliceQueryArray(queries, concurrent);
// let target = sliced.target;
// let original = sliced.original; //TODO: refactor "original" to "remaining"
// if (target !== undefined) {
// for (let query in target) {
// client.query({});
// }
// } else {
// return sliced;
// }
let res = Promise.all(sliced.target.map(this.queryExecute));
return res;
}

@@ -51,0 +44,0 @@

@@ -9,4 +9,4 @@ const { QueryBatcher, batcher } = require("../batcher.js");

createContent(
markup: markup1
raw: raw1
markup: "markupA"
raw: "rawA"
) {

@@ -19,4 +19,4 @@ markup

createContent(
markup: markup2
raw: raw2
markup: "markupB"
raw: "rawB"
) {

@@ -29,4 +29,4 @@ markup

createContent(
markup: markup3
raw: raw3
markup: "markupC"
raw: "rawC"
) {

@@ -39,4 +39,4 @@ markup

createContent(
markup: markup4
raw: raw4
markup: "markupD"
raw: "rawD"
) {

@@ -49,4 +49,4 @@ markup

createContent(
markup: markup5
raw: raw5
markup: "markupE"
raw: "rawE"
) {

@@ -59,4 +59,4 @@ markup

createContent(
markup: markup6
raw: raw6
markup: "markupF"
raw: "rawF"
) {

@@ -69,4 +69,4 @@ markup

createContent(
markup: markup7
raw: raw7
markup: "markupE"
raw: "rawE"
) {

@@ -82,4 +82,4 @@ markup

createContent(
markup: markup1
raw: raw1
markup: "markupA"
raw: "rawA"
) {

@@ -92,4 +92,4 @@ markup

createContent(
markup: markup2
raw: raw2
markup: "markupB"
raw: "rawB"
) {

@@ -128,7 +128,2 @@ markup

test("execute consecutive queries", async t => {
//TODO
t.pass();
});
test("execute two types of queries <query> && <mutation>", async t => {

@@ -141,4 +136,6 @@ //TODO

//TODO
let q = new QueryBatcher(sampleQueries);
let res = q.queryBatchExecute();
t.pass();
});
//

@@ -25,5 +25,6 @@ ### Todo

* [x] `batch-queries`/execute single query
* [ ] `batch-queries`/execute consecutive queries
* [ ] `batch-queries`/execute queries in proper order
* [ ] `batch-queries`/execute two types of queries
* [ ] `batch-queries`/execute four queries concurrently
* [x] `batch-queries`/execute four queries concurrently
* [ ] `factory-queries`/build and batch queries
* [ ] Add React (CRA) example

@@ -30,0 +31,0 @@ * [ ] Add simple node (CLI) example

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