Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

gqty

Package Overview
Dependencies
Maintainers
1
Versions
318
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 2.1.0 to 2.2.0

4

Accessor/index.js

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

const nullObjectKey = {};
const unionsCacheValueMap = new WeakMap();
const unionsCacheValueMap = /* @__PURE__ */ new WeakMap();
function getCacheValueReference(cacheValue, unions) {

@@ -213,3 +213,3 @@ if (unions === void 0)

if (!cacheValueMap) {
cacheValueMap = new WeakMap();
cacheValueMap = /* @__PURE__ */ new WeakMap();
cacheValueMap.set(unions, mapKey);

@@ -216,0 +216,0 @@ }

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

function createAccessorCache() {
const proxyCacheMap = new WeakMap();
const arrayProxyMap = new WeakMap();
const proxySet = new WeakSet();
const selectionProxyMap = new WeakMap();
const selectionSetHistory = new Map();
const selectionChildRelations = new Map();
const proxyCacheMap = /* @__PURE__ */ new WeakMap();
const arrayProxyMap = /* @__PURE__ */ new WeakMap();
const proxySet = /* @__PURE__ */ new WeakSet();
const selectionProxyMap = /* @__PURE__ */ new WeakMap();
const selectionSetHistory = /* @__PURE__ */ new Map();
const selectionChildRelations = /* @__PURE__ */ new Map();
function getAccessor(selection, cacheValue, proxyFactory) {

@@ -21,3 +21,3 @@ const mapKey = cacheValue == null ? nullObjectKey : typeof cacheValue === "object" ? cacheValue : notFoundObjectKey;

if (cacheMap == null) {
cacheMap = new WeakMap();
cacheMap = /* @__PURE__ */ new WeakMap();
proxyCacheMap.set(selection, cacheMap);

@@ -37,3 +37,3 @@ }

if (proxyMap == null) {
proxyMap = new WeakMap();
proxyMap = /* @__PURE__ */ new WeakMap();
arrayProxyMap.set(selection, proxyMap);

@@ -62,3 +62,3 @@ }

if (selectionSet == null) {
selectionSet = new Set();
selectionSet = /* @__PURE__ */ new Set();
selectionSetHistory.set(accessorSelection, selectionSet);

@@ -75,3 +75,3 @@ }

if (childs) {
const selectionsWithChilds = selections || (selections = new Set());
const selectionsWithChilds = selections || (selections = /* @__PURE__ */ new Set());
childs.forEach((childAccessor) => {

@@ -99,3 +99,3 @@ const childSelections = getSelectionSetHistory(childAccessor);

if (childs == null) {
childs = new Set();
childs = /* @__PURE__ */ new Set();
selectionChildRelations.set(parentSelection, childs);

@@ -102,0 +102,0 @@ }

@@ -8,5 +8,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 mergeWith__default = /*#__PURE__*/_interopDefaultLegacy(mergeWith);
const mergeWith__default = /*#__PURE__*/_interopDefault(mergeWith);

@@ -13,0 +13,0 @@ function createCache(normalization) {

@@ -5,2 +5,3 @@ import { CacheInstance } from '../Cache';

import type { InnerClientState, SubscriptionsClient } from './client';
import type { FetchOptions } from '../Schema/types';
export interface ResolveOptions<TData> {

@@ -65,2 +66,6 @@ /**

retry?: RetryOptions;
/**
* Pass any extra fetch options
*/
fetchOptions?: FetchOptions;
}

@@ -94,2 +99,3 @@ export declare type RetryOptions = {

onSubscription?: ResolveOptions<any>['onSubscription'];
fetchOptions?: FetchOptions;
}

@@ -96,0 +102,0 @@ export interface Resolved {

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

require('../Selection/selection.js');
const dataCache = require('../Cache/dataCache.js');

@@ -138,3 +137,4 @@ const index = require('../Error/index.js');

onNoCacheFound,
onEmptyResolve
onEmptyResolve,
fetchOptions
} = {}) {

@@ -225,3 +225,4 @@ const prevFoundValidCache = innerState.foundValidCache;

} : void 0,
retry
retry,
fetchOptions
});

@@ -250,3 +251,3 @@ prevAllowCache = innerState.allowCache;

};
const resolutionTempCache = new Map();
const resolutionTempCache = /* @__PURE__ */ new Map();
const resolutionTempCacheTimeout = catchSelectionsTimeMS * 5;

@@ -297,3 +298,3 @@ function buildQueryAndCheckTempCache(selections, type, normalizationHandler, ignoreResolveCache, isGlobalCache) {

}
const executionResult = await queryFetcher(query, variables);
const executionResult = await queryFetcher(query, variables, options.fetchOptions);
const { data, errors } = executionResult;

@@ -433,3 +434,3 @@ if (data) {

}
const selectionsByRoot = new Map();
const selectionsByRoot = /* @__PURE__ */ new Map();
for (const selection of selections) {

@@ -447,3 +448,3 @@ const root = selection.selectionsList[1];

}
const unsubscribeCallbacks = new Set();
const unsubscribeCallbacks = /* @__PURE__ */ new Set();
const unsubscribe = async () => {

@@ -450,0 +451,0 @@ await Promise.all(Array.from(unsubscribeCallbacks).map((cb) => cb()));

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

this.hasFetchSubscribers = false;
this.onFetchListeners = new Set();
this.onCacheChangeListeners = new Set();
this.onFetchListeners = /* @__PURE__ */ new Set();
this.onCacheChangeListeners = /* @__PURE__ */ new Set();
}

@@ -12,0 +12,0 @@ sendCacheChange(data) {

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

function track(callback, { onError, refetch } = {}) {
const trackerSelections = new Set();
const trackerSelections = /* @__PURE__ */ new Set();
let lastError;

@@ -20,0 +20,0 @@ function callOnError(err) {

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

exports.Selection = selection.Selection;
Object.defineProperty(exports, 'SelectionType', {
enumerable: true,
get: function () { return selection.SelectionType; }
});
exports.SelectionType = selection.SelectionType;
exports.SchemaUnionsKey = types.SchemaUnionsKey;

@@ -26,0 +23,0 @@ exports.parseSchemaType = types.parseSchemaType;

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

constructor() {
this.fetchSelections = new Set();
this.fetchSelections = /* @__PURE__ */ new Set();
this.listening = true;
this.selectionAddListeners = new Set();
this.selectionCacheListeners = new Set();
this.selectionCacheRefetchListeners = new Set();
this.selectionAddListeners = /* @__PURE__ */ new Set();
this.selectionCacheListeners = /* @__PURE__ */ new Set();
this.selectionCacheRefetchListeners = /* @__PURE__ */ new Set();
}

@@ -43,3 +43,3 @@ addSelection(selection) {

function createInterceptorManager() {
const interceptors = new Set();
const interceptors = /* @__PURE__ */ new Set();
const globalInterceptor = new Interceptor();

@@ -46,0 +46,0 @@ interceptors.add(globalInterceptor);

@@ -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 mergeWith__default = /*#__PURE__*/_interopDefaultLegacy(mergeWith);
const mergeWith__default = /*#__PURE__*/_interopDefault(mergeWith);

@@ -73,3 +73,3 @@ function toString(v) {

const normalizedCache = {};
const normalizedSelections = new Map();
const normalizedSelections = /* @__PURE__ */ new Map();
function getCacheFromSelection(selection, notFoundValue, cache) {

@@ -85,3 +85,3 @@ let container;

if (!selectionsSet) {
selectionsSet = new Set();
selectionsSet = /* @__PURE__ */ new Set();
normalizedSelections.set(id, selectionsSet);

@@ -116,3 +116,3 @@ }

function scanNormalizedObjects(obj) {
const pendingObjects = new Set([obj]);
const pendingObjects = /* @__PURE__ */ new Set([obj]);
for (const container of pendingObjects) {

@@ -119,0 +119,0 @@ for (const value of Object.values(container)) {

{
"name": "gqty",
"version": "2.1.0",
"version": "2.2.0",
"description": "gqty client without queries",

@@ -9,2 +9,7 @@ "sideEffects": false,

},
"peerDependenciesMeta": {
"graphql": {
"optional": true
}
},
"dependencies": {

@@ -36,3 +41,4 @@ "lodash": "^4.17.21"

"./package.json": "./package.json"
}
},
"readme": "# [GQty](https://gqty.dev) [![Documentation](https://img.shields.io/badge/documentation-documentation?color=C00B84)](https://gqty.dev)\n\n> GQty is a fully-featured GraphQL client, which lowers the barrier of entry towards using GraphQL.\n\nData requirements within your application are picked up automatically, freeing you from having to maintain GraphQL queries by-hand. It offers a first-class TypeScript experience. See API documentation at all times within autocomplete.\n\nMake breaking changes to your API, and see type-errors exactly where things are breaking, in realtime. No more running a separate validation step.\n\n**More documentation is available at [gqty.dev/docs/getting-started](https://gqty.dev/docs/getting-started).**\n\n<a href=\"https://gqty.dev\">\n <img alt=\"Example usage\" src=\"https://user-images.githubusercontent.com/13242392/112103674-fddc4980-8ba1-11eb-8c83-b527dcb0243d.PNG\" />\n</a>\n"
}

@@ -30,7 +30,7 @@ 'use strict';

const selectionTree = {};
const variablesMap = new Map();
const variablesMap = /* @__PURE__ */ new Map();
const variableTypes = {};
const variablesMapKeyValue = {};
if (normalization) {
const selectionsSet = new Set();
const selectionsSet = /* @__PURE__ */ new Set();
for (const selection of selections) {

@@ -37,0 +37,0 @@ if (selection.cofetchSelections) {

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

const createScheduler = ({ globalInterceptor }, resolveSchedulerSelections, catchSelectionsTimeMS) => {
const resolveListeners = new Set();
const resolveListeners = /* @__PURE__ */ new Set();
function subscribeResolve(fn) {

@@ -19,7 +19,7 @@ resolveListeners.add(fn);

}
const errorsMap = new Map();
const pendingSelectionsGroups = new Set();
const pendingSelectionsGroupsPromises = new Map();
const selectionsOnTheFly = new Set();
const selectionsWithFinalErrors = new Set();
const errorsMap = /* @__PURE__ */ new Map();
const pendingSelectionsGroups = /* @__PURE__ */ new Set();
const pendingSelectionsGroupsPromises = /* @__PURE__ */ new Map();
const selectionsOnTheFly = /* @__PURE__ */ new Set();
const selectionsWithFinalErrors = /* @__PURE__ */ new Set();
const scheduler = {

@@ -40,3 +40,3 @@ resolving: null,

};
const errorsListeners = new Set();
const errorsListeners = /* @__PURE__ */ new Set();
function subscribeErrors(fn) {

@@ -43,0 +43,0 @@ errorsListeners.add(fn);

@@ -20,10 +20,19 @@ import type { ExecutionResult } from 'graphql';

export declare type ScalarsEnumsHash = Record<string, true>;
export declare type QueryFetcher = (query: string, variables?: Record<string, any>) => Promise<ExecutionResult> | ExecutionResult;
export interface FetchOptions extends Omit<RequestInit, 'body'> {
}
export declare type QueryFetcher = (query: string, variables: Record<string, any> | undefined, fetchOptions?: FetchOptions) => Promise<ExecutionResult> | ExecutionResult;
export interface ParseSchemaTypeInfo {
pureType: string;
isNullable: boolean;
hasDefaultValue: boolean;
isArray: boolean;
nullableItems: boolean;
}
export declare function parseSchemaType(type: string): ParseSchemaTypeInfo;
export interface FieldDescription {
description?: string | null;
deprecated?: string | null;
defaultValue?: string | null;
}
export declare type ArgsDescriptions = Record<string, Record<string, FieldDescription | undefined>>;
export declare function parseSchemaType(type: string, fieldDesc?: FieldDescription | undefined): ParseSchemaTypeInfo;
export declare type DeepPartial<T> = T extends Function ? T : T extends Array<infer U> ? _DeepPartialArray<U> : T extends object ? _DeepPartialObject<T> : T | undefined;

@@ -30,0 +39,0 @@ interface _DeepPartialArray<T> extends Array<DeepPartial<T>> {

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

const SchemaUnionsKey = Symbol("unionsKey");
function parseSchemaType(type) {
function parseSchemaType(type, fieldDesc = void 0) {
let isArray = false;
let isNullable = true;
let hasDefaultValue = !!(fieldDesc && fieldDesc.defaultValue !== null);
let pureType = type;

@@ -27,2 +28,3 @@ let nullableItems = true;

isNullable,
hasDefaultValue,
isArray,

@@ -29,0 +31,0 @@ nullableItems

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

exports.Selection = selection.Selection;
Object.defineProperty(exports, 'SelectionType', {
enumerable: true,
get: function () { return selection.SelectionType; }
});
exports.SelectionType = selection.SelectionType;

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

exports.SelectionType = void 0;
(function(SelectionType2) {
var SelectionType = /* @__PURE__ */ ((SelectionType2) => {
SelectionType2[SelectionType2["Query"] = 0] = "Query";
SelectionType2[SelectionType2["Mutation"] = 1] = "Mutation";
SelectionType2[SelectionType2["Subscription"] = 2] = "Subscription";
})(exports.SelectionType || (exports.SelectionType = {}));
return SelectionType2;
})(SelectionType || {});
class Selection {

@@ -43,3 +43,3 @@ constructor({

this.unions = unions;
this.type = type || (prevSelection == null ? void 0 : prevSelection.type) || 0;
this.type = type || (prevSelection == null ? void 0 : prevSelection.type) || 0 /* Query */;
if (prevSelection)

@@ -49,3 +49,3 @@ this.prevSelection = prevSelection;

addCofetchSelections(selections) {
const cofetchSet = this.currentCofetchSelections || (this.currentCofetchSelections = new Set());
const cofetchSet = this.currentCofetchSelections || (this.currentCofetchSelections = /* @__PURE__ */ new Set());
for (const selection of selections) {

@@ -69,1 +69,2 @@ cofetchSet.add(selection);

exports.Selection = Selection;
exports.SelectionType = SelectionType;

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

function createSelectionManager() {
const selectionCache = new Map();
const selectionCache = /* @__PURE__ */ new Map();
const incIds = {};
const aliasMap = new Map();
const aliasMap = /* @__PURE__ */ new Map();
let incHashId = -1;

@@ -48,0 +48,0 @@ const stringsHash = {};

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

const serializedVariablesCache = new WeakMap();
const serializedVariablesCache = /* @__PURE__ */ new WeakMap();
function serializeVariables(variables) {

@@ -8,0 +8,0 @@ let serializedVariables;

@@ -12,5 +12,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 mergeWith__default = /*#__PURE__*/_interopDefaultLegacy(mergeWith);
const mergeWith__default = /*#__PURE__*/_interopDefault(mergeWith);

@@ -17,0 +17,0 @@ const isInteger = (v) => Number.isInteger(v);

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

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