@graphql-ez/client
Advanced tools
+2
-8
@@ -16,4 +16,2 @@ /// <reference types="node" /> | ||
| } | ||
| export declare function getStringFromStream(stream: import('stream').Readable): Promise<string>; | ||
| export declare function getJSONFromStream<T>(stream: import('stream').Readable): Promise<T>; | ||
| export declare type QueryFunctionPostGet = <TData, TVariables = {}, TExtensions = {}>(document: TypedDocumentNode<TData, TVariables> | string, options?: { | ||
@@ -53,5 +51,3 @@ variables?: TVariables; | ||
| unsubscribe: () => void; | ||
| iterator: AsyncGenerator<ExecutionResult<TData, { | ||
| [key: string]: any; | ||
| }>, void, unknown>; | ||
| iterator: AsyncGenerator<ExecutionResult<TData, import("graphql/jsutils/ObjMap").ObjMap<unknown>>, void, unknown>; | ||
| }>; | ||
@@ -63,5 +59,3 @@ client: Promise<import("graphql-ws").Client>; | ||
| unsubscribe: () => void; | ||
| iterator: AsyncGenerator<ExecutionResult<TData_1, { | ||
| [key: string]: any; | ||
| }>, void, unknown>; | ||
| iterator: AsyncGenerator<ExecutionResult<TData_1, import("graphql/jsutils/ObjMap").ObjMap<unknown>>, void, unknown>; | ||
| }>; | ||
@@ -68,0 +62,0 @@ client: Promise<import("subscriptions-transport-ws-envelop").SubscriptionClient>; |
+6
-20
@@ -15,16 +15,2 @@ 'use strict'; | ||
| async function getStringFromStream(stream) { | ||
| const chunks = []; | ||
| for await (const chunk of stream) { | ||
| chunks.push(chunk); | ||
| } | ||
| return Buffer.concat(chunks).toString("utf-8"); | ||
| } | ||
| async function getJSONFromStream(stream) { | ||
| const chunks = []; | ||
| for await (const chunk of stream) { | ||
| chunks.push(chunk); | ||
| } | ||
| return JSON.parse(Buffer.concat(chunks).toString("utf-8")); | ||
| } | ||
| class GraphQLErrorJSON extends Error { | ||
@@ -77,3 +63,3 @@ constructor(message, locations, extensions) { | ||
| console.error({ | ||
| body: await getStringFromStream(body), | ||
| body: await body.text(), | ||
| headers: headers2 | ||
@@ -83,3 +69,4 @@ }); | ||
| } | ||
| return getJSONFromStream(body); | ||
| const json = await body.json(); | ||
| return json; | ||
| }; | ||
@@ -100,3 +87,3 @@ const queryPost = async function queryPost2(document, { variables, headers: headersArg, extensions, operationName } = {}) { | ||
| console.error({ | ||
| body: await getStringFromStream(body), | ||
| body: await body.text(), | ||
| headers: headers2 | ||
@@ -106,3 +93,4 @@ }); | ||
| } | ||
| return getJSONFromStream(body); | ||
| const json = await body.json(); | ||
| return json; | ||
| }; | ||
@@ -166,3 +154,1 @@ const assertedQuery = async (document, options2) => { | ||
| exports.EZClient = EZClient; | ||
| exports.getJSONFromStream = getJSONFromStream; | ||
| exports.getStringFromStream = getStringFromStream; |
+7
-19
@@ -11,16 +11,2 @@ import { documentParamsToURIParams } from '@graphql-ez/utils/clientURI'; | ||
| async function getStringFromStream(stream) { | ||
| const chunks = []; | ||
| for await (const chunk of stream) { | ||
| chunks.push(chunk); | ||
| } | ||
| return Buffer.concat(chunks).toString("utf-8"); | ||
| } | ||
| async function getJSONFromStream(stream) { | ||
| const chunks = []; | ||
| for await (const chunk of stream) { | ||
| chunks.push(chunk); | ||
| } | ||
| return JSON.parse(Buffer.concat(chunks).toString("utf-8")); | ||
| } | ||
| class GraphQLErrorJSON extends Error { | ||
@@ -73,3 +59,3 @@ constructor(message, locations, extensions) { | ||
| console.error({ | ||
| body: await getStringFromStream(body), | ||
| body: await body.text(), | ||
| headers: headers2 | ||
@@ -79,3 +65,4 @@ }); | ||
| } | ||
| return getJSONFromStream(body); | ||
| const json = await body.json(); | ||
| return json; | ||
| }; | ||
@@ -96,3 +83,3 @@ const queryPost = async function queryPost2(document, { variables, headers: headersArg, extensions, operationName } = {}) { | ||
| console.error({ | ||
| body: await getStringFromStream(body), | ||
| body: await body.text(), | ||
| headers: headers2 | ||
@@ -102,3 +89,4 @@ }); | ||
| } | ||
| return getJSONFromStream(body); | ||
| const json = await body.json(); | ||
| return json; | ||
| }; | ||
@@ -161,2 +149,2 @@ const assertedQuery = async (document, options2) => { | ||
| export { EZClient, getJSONFromStream, getStringFromStream }; | ||
| export { EZClient }; |
+9
-9
| { | ||
| "name": "@graphql-ez/client", | ||
| "version": "0.2.3", | ||
| "version": "0.3.0", | ||
| "sideEffects": false, | ||
@@ -10,14 +10,14 @@ "peerDependencies": { | ||
| "dependencies": { | ||
| "@graphql-ez/utils": "^0.1.2", | ||
| "@graphql-tools/utils": "^8.2.4", | ||
| "@types/eventsource": "^1.1.6", | ||
| "@graphql-ez/utils": "^0.1.3", | ||
| "@graphql-tools/utils": "^8.6.0", | ||
| "@types/eventsource": "^1.1.8", | ||
| "eventsource": "^1.1.0", | ||
| "extract-files": "^11.0.0", | ||
| "form-data": "^4.0.0", | ||
| "graphql-ws": "^5.5.0", | ||
| "graphql-ws": "^5.5.5", | ||
| "isomorphic-ws": "^4.0.1", | ||
| "node-fetch": "^2.6.5", | ||
| "subscriptions-transport-ws-envelop": "^2.0.1", | ||
| "undici": "^4.7.0", | ||
| "ws": "^8.2.2" | ||
| "node-fetch": "^3.1.0", | ||
| "subscriptions-transport-ws-envelop": "^2.0.2", | ||
| "undici": "^4.12.1", | ||
| "ws": "^8.4.0" | ||
| }, | ||
@@ -24,0 +24,0 @@ "repository": { |
+2
-2
@@ -9,5 +9,5 @@ 'use strict'; | ||
| function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } | ||
| function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; } | ||
| const EventSource__default = /*#__PURE__*/_interopDefaultLegacy(EventSource); | ||
| const EventSource__default = /*#__PURE__*/_interopDefault(EventSource); | ||
@@ -14,0 +14,0 @@ function createSSESubscription(href, getHeaders) { |
+2
-2
@@ -10,5 +10,5 @@ 'use strict'; | ||
| function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } | ||
| function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; } | ||
| const assert__default = /*#__PURE__*/_interopDefaultLegacy(assert); | ||
| const assert__default = /*#__PURE__*/_interopDefault(assert); | ||
@@ -15,0 +15,0 @@ function createStreamHelper(client, path, getHeaders) { |
@@ -11,5 +11,5 @@ 'use strict'; | ||
| function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } | ||
| function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; } | ||
| const ws__default = /*#__PURE__*/_interopDefaultLegacy(ws); | ||
| const ws__default = /*#__PURE__*/_interopDefault(ws); | ||
@@ -16,0 +16,0 @@ function createGraphQLWSWebsocketsClient(wsEndpoint, options = {}) { |
@@ -11,5 +11,5 @@ 'use strict'; | ||
| function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } | ||
| function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; } | ||
| const ws__default = /*#__PURE__*/_interopDefaultLegacy(ws); | ||
| const ws__default = /*#__PURE__*/_interopDefault(ws); | ||
@@ -16,0 +16,0 @@ function createSubscriptionsTransportWebsocketsClient(wsEndpoint, options = {}) { |
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
44198
-2.73%1109
-2.8%+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
- Removed
- Removed
- Removed
- Removed
Updated
Updated
Updated
Updated
Updated
Updated
Updated