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

gqty

Package Overview
Dependencies
Maintainers
1
Versions
332
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gqty - npm Package Compare versions

Comparing version 3.0.0-alpha-e9f8f97b.0 to 3.0.0-alpha-eb61be5a.0

2

Accessor/resolve.js

@@ -308,2 +308,4 @@ 'use strict';

var _a;
if (accessor == null)
return;
const meta$1 = meta.$meta(accessor);

@@ -310,0 +312,0 @@ if (!meta$1)

4

Client/batching.d.ts
import { type Cache } from '../Cache';
import { Selection } from '../Selection';
export declare const addSelections: (cache: Cache, key: string, value: Set<Selection>) => Set<Set<Selection>>;
export declare const addSelections: (cache: Cache, key: string, selections: Set<Selection>) => Set<Set<Selection>>;
export declare const getSelectionsSet: (cache: Cache, key: string) => Set<Set<Selection>> | undefined;
export declare const delSelectionsSet: (cache: Cache, key: string) => boolean;
export declare const delSelectionSet: (cache: Cache, key: string) => boolean;
export declare const popSelectionsSet: (cache: Cache, key: string) => Set<Set<Selection>> | undefined;

@@ -6,3 +6,3 @@ 'use strict';

const pendingSelections = /* @__PURE__ */ new Map();
const addSelections = (cache, key, value) => {
const addSelections = (cache, key, selections) => {
if (!pendingSelections.has(cache)) {

@@ -15,3 +15,3 @@ pendingSelections.set(cache, /* @__PURE__ */ new Map());

}
return selectionsByKey.get(key).add(value);
return selectionsByKey.get(key).add(selections);
};

@@ -22,3 +22,3 @@ const getSelectionsSet = (cache, key) => {

};
const delSelectionsSet = (cache, key) => {
const delSelectionSet = (cache, key) => {
var _a, _b;

@@ -29,3 +29,3 @@ return (_b = (_a = pendingSelections.get(cache)) == null ? void 0 : _a.delete(key)) != null ? _b : false;

const result = getSelectionsSet(cache, key);
delSelectionsSet(cache, key);
delSelectionSet(cache, key);
return result;

@@ -35,4 +35,4 @@ };

exports.addSelections = addSelections;
exports.delSelectionsSet = delSelectionsSet;
exports.delSelectionSet = delSelectionSet;
exports.getSelectionsSet = getSelectionsSet;
exports.popSelectionsSet = popSelectionsSet;

@@ -5,2 +5,8 @@ 'use strict';

var __defProp = Object.defineProperty;
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
var __publicField = (obj, key, value) => {
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
return value;
};
var LegacySelectionType = /* @__PURE__ */ ((LegacySelectionType2) => {

@@ -24,5 +30,16 @@ LegacySelectionType2[LegacySelectionType2["Query"] = 0] = "Query";

}) {
this.cachePath = [];
this.prevSelection = null;
this.currentCofetchSelections = null;
__publicField(this, "id");
__publicField(this, "key");
__publicField(this, "type");
__publicField(this, "operationName");
__publicField(this, "unions");
__publicField(this, "args");
__publicField(this, "argTypes");
__publicField(this, "alias");
__publicField(this, "cachePath", []);
__publicField(this, "pathString");
__publicField(this, "selectionsList");
__publicField(this, "noIndexSelections");
__publicField(this, "prevSelection", null);
__publicField(this, "currentCofetchSelections", null);
var _a, _b, _c, _d, _e, _f;

@@ -29,0 +46,0 @@ this.id = id + "";

@@ -14,9 +14,6 @@ import type { Cache } from '../Cache';

export type Debugger = {
dispatch: (event: DebugEvent) => void;
dispatch: (event: DebugEvent) => Promise<void>;
/** Returns an unsubscribe function */
subscribe: (listener: DebugEventListener) => () => void;
};
export declare const createDebugger: () => {
dispatch: (event: DebugEvent) => void;
subscribe: (listener: DebugEventListener) => () => boolean;
};
export declare const createDebugger: () => Debugger;

@@ -8,4 +8,4 @@ 'use strict';

return {
dispatch: (event) => {
subs.forEach((sub) => sub(event));
dispatch: async (event) => {
await Promise.all([...subs].map((sub) => sub(event)));
},

@@ -12,0 +12,0 @@ subscribe: (listener) => {

@@ -63,8 +63,7 @@ import { type BaseGeneratedSchema, type FetchOptions } from '.';

export type CreateResolverFn<TSchema extends BaseGeneratedSchema> = (options?: ResolveOptions) => ResolverParts<TSchema>;
export type ResolveFn<TSchema extends BaseGeneratedSchema> = <TData extends unknown = unknown>(fn: DataFn<TSchema, TData>, options?: ResolveOptions) => Promise<DataResult<TData>>;
export type SubscribeFn<TSchema extends BaseGeneratedSchema> = <TData extends unknown = unknown>(fn: DataFn<TSchema, TData>, options?: SubscribeOptions) => AsyncGenerator<DataResult<TData>, void, unknown> & {
export type ResolveFn<TSchema extends BaseGeneratedSchema> = <TData extends unknown = unknown>(fn: DataFn<TSchema, TData>, options?: ResolveOptions) => Promise<TData>;
export type SubscribeFn<TSchema extends BaseGeneratedSchema> = <TData extends unknown = unknown>(fn: DataFn<TSchema, TData>, options?: SubscribeOptions) => AsyncGenerator<TData, void, unknown> & {
unsubscribe: Unsubscribe;
};
export type DataFn<TSchema, TResult = unknown> = (schema: TSchema) => TResult;
export type DataResult<TData = unknown> = TData extends undefined ? TData : TData extends void ? unknown : TData;
export type CreateResolverOptions = {

@@ -71,0 +70,0 @@ /**

@@ -6,3 +6,2 @@ 'use strict';

const index = require('../Accessor/index.js');
const pick = require('../Utils/pick.js');
const batching = require('./batching.js');

@@ -83,3 +82,3 @@ const context = require('./context.js');

pendingQueries.delete(pendingSelections);
batching.delSelectionsSet(clientCache, selectionsCacheKey);
batching.delSelectionSet(clientCache, selectionsCacheKey);
return resolveSelections.fetchSelections(selections2, {

@@ -89,7 +88,3 @@ cache: context$1.cache,

extensions,
fetchOptions: {
...fetchOptions,
cachePolicy,
retryPolicy
},
fetchOptions: { ...fetchOptions, cachePolicy, retryPolicy },
operationName

@@ -195,8 +190,5 @@ }).then((results) => {

var _a, _b;
const { accessor, resolve, selections } = createResolver(options);
fn(accessor);
const dataFn = () => {
var _a2;
return (_a2 = fn(accessor)) != null ? _a2 : pick.pick(accessor, selections);
};
const { accessor, resolve } = createResolver(options);
const dataFn = () => fn(accessor);
dataFn();
const fetchPromise = resolve().then(dataFn);

@@ -203,0 +195,0 @@ if ((_a = options == null ? void 0 : options.awaitsFetch) != null ? _a : true) {

@@ -47,3 +47,3 @@ 'use strict';

}
debug == null ? void 0 : debug.dispatch({
await (debug == null ? void 0 : debug.dispatch({
cache,

@@ -53,3 +53,3 @@ request: queryPayload,

selections
});
}));
return result;

@@ -227,4 +227,10 @@ }

} catch (error) {
if (!retryPolicy || !(error instanceof Error))
if (
// User doesn't want reties
!retryPolicy || // Let everything unknown through
!(error instanceof Error) || // GQtyErrors are supposed to be terminating
error instanceof index$1.GQtyError
) {
throw error;
}
return new Promise((resolve, reject) => {

@@ -231,0 +237,0 @@ retry.doRetry(retryPolicy, {

@@ -7,6 +7,14 @@ 'use strict';

var __defProp = Object.defineProperty;
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
var __publicField = (obj, key, value) => {
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
return value;
};
class GQtyError extends Error {
constructor(message, { graphQLErrors, otherError } = {}) {
super(message);
this.name = "GQtyError";
__publicField(this, "name", "GQtyError");
__publicField(this, "graphQLErrors");
__publicField(this, "otherError");
if (graphQLErrors)

@@ -13,0 +21,0 @@ this.graphQLErrors = graphQLErrors;

{
"name": "gqty",
"version": "3.0.0-alpha-e9f8f97b.0",
"version": "3.0.0-alpha-eb61be5a.0",
"description": "gqty client without queries",

@@ -5,0 +5,0 @@ "sideEffects": false,

@@ -8,2 +8,8 @@ 'use strict';

var __defProp = Object.defineProperty;
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
var __publicField = (obj, key, value) => {
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
return value;
};
const createSymbol = Symbol();

@@ -30,4 +36,10 @@ const aliasGenerator = {

this.key = key;
this.cacheKeys = [];
this.children = /* @__PURE__ */ new Map();
__publicField(this, "alias");
__publicField(this, "cacheKeys", []);
__publicField(this, "children", /* @__PURE__ */ new Map());
__publicField(this, "input");
__publicField(this, "parent");
__publicField(this, "root");
/** Indicates current selection being a inteface/union key. */
__publicField(this, "isUnion");
var _a, _b, _c;

@@ -52,6 +64,5 @@ if (token !== createSymbol) {

let current = this;
while (current) {
do {
ancestry.unshift(current);
current = current.parent;
}
} while (current = current.parent);
return ancestry;

@@ -58,0 +69,0 @@ }

@@ -14,5 +14,5 @@ 'use strict';

const hash = memoize__default["default"](
(...args) => objectHash__default["default"](args).replace(/^(\d)/, "a$1")
(...args) => objectHash__default["default"](args, { unorderedObjects: false }).replace(/^(\d)/, "a$1")
);
exports.hash = hash;

@@ -16,2 +16,4 @@ 'use strict';

for (const { key, input } of ancestry) {
if (node == null)
break;
if (input) {

@@ -18,0 +20,0 @@ node = node[key](input.values);

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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