@n1ru4l/in-memory-live-query-store
Advanced tools
Comparing version 0.8.0-alpha-35682dd.0 to 0.8.0-alpha-c8576d0.0
@@ -206,19 +206,2 @@ import { visit, visitWithTypeInfo, isNonNullType, isScalarType, execute, getOperationAST, GraphQLError, defaultFieldResolver, TypeInfo } from 'graphql'; | ||
const defaultResourceIdentifierNormalizer = (params) => `${params.typename}:${params.id}`; | ||
/* Utility for getting the parameters for the union parameter input type as a object. */ | ||
const getExecutionParameters = (params) => { | ||
if (params.length === 1) { | ||
return params[0]; | ||
} | ||
const [schema, document, rootValue, contextValue, variableValues, operationName, fieldResolver, typeResolver,] = params; | ||
return { | ||
schema, | ||
document, | ||
rootValue, | ||
contextValue, | ||
variableValues, | ||
operationName, | ||
fieldResolver, | ||
typeResolver, | ||
}; | ||
}; | ||
const nextTick = (_b = (_a = (typeof process === "object" && typeof process.nextTick === "function" | ||
@@ -236,4 +219,4 @@ ? process.nextTick | ||
this._idFieldName = "id"; | ||
this.makeExecute = (execute) => (...args) => { | ||
const { schema: inputSchema, document, rootValue, contextValue, variableValues, operationName, ...additionalArguments } = getExecutionParameters(args); | ||
this.makeExecute = (execute) => (args) => { | ||
const { schema: inputSchema, document, rootValue, contextValue, variableValues, operationName, ...additionalArguments } = args; | ||
const operationNode = getOperationAST(document, operationName); | ||
@@ -240,0 +223,0 @@ const fallbackToDefaultExecute = () => execute({ |
21
index.js
@@ -210,19 +210,2 @@ 'use strict'; | ||
const defaultResourceIdentifierNormalizer = (params) => `${params.typename}:${params.id}`; | ||
/* Utility for getting the parameters for the union parameter input type as a object. */ | ||
const getExecutionParameters = (params) => { | ||
if (params.length === 1) { | ||
return params[0]; | ||
} | ||
const [schema, document, rootValue, contextValue, variableValues, operationName, fieldResolver, typeResolver,] = params; | ||
return { | ||
schema, | ||
document, | ||
rootValue, | ||
contextValue, | ||
variableValues, | ||
operationName, | ||
fieldResolver, | ||
typeResolver, | ||
}; | ||
}; | ||
const nextTick = (_b = (_a = (typeof process === "object" && typeof process.nextTick === "function" | ||
@@ -240,4 +223,4 @@ ? process.nextTick | ||
this._idFieldName = "id"; | ||
this.makeExecute = (execute) => (...args) => { | ||
const { schema: inputSchema, document, rootValue, contextValue, variableValues, operationName, ...additionalArguments } = getExecutionParameters(args); | ||
this.makeExecute = (execute) => (args) => { | ||
const { schema: inputSchema, document, rootValue, contextValue, variableValues, operationName, ...additionalArguments } = args; | ||
const operationNode = graphql.getOperationAST(document, operationName); | ||
@@ -244,0 +227,0 @@ const fallbackToDefaultExecute = () => execute({ |
@@ -44,3 +44,3 @@ import { ExecutionResult, execute as defaultExecute, ExecutionArgs } from "graphql"; | ||
}; | ||
declare type ExecutionParameter = Parameters<typeof defaultExecute> | [ExecutionArgs]; | ||
declare type LiveExecuteReturnType = PromiseOrValue<AsyncIterableIterator<ExecutionResult | LiveExecutionResult> | ExecutionResult>; | ||
export declare class InMemoryLiveQueryStore { | ||
@@ -56,4 +56,4 @@ private _resourceTracker; | ||
private getPatchedSchema; | ||
makeExecute: (execute: typeof defaultExecute) => (...args: ExecutionParameter) => PromiseOrValue<AsyncIterable<ExecutionResult<any> | LiveExecutionResult> | ExecutionResult>; | ||
execute: (...args: ExecutionParameter) => PromiseOrValue<AsyncIterable<ExecutionResult<any> | LiveExecutionResult> | ExecutionResult>; | ||
makeExecute: (execute: typeof defaultExecute) => (args: ExecutionArgs) => LiveExecuteReturnType; | ||
execute: (args: ExecutionArgs) => LiveExecuteReturnType; | ||
/** | ||
@@ -60,0 +60,0 @@ * Invalidate queries (and schedule their re-execution) via a resource identifier. |
{ | ||
"name": "@n1ru4l/in-memory-live-query-store", | ||
"version": "0.8.0-alpha-35682dd.0", | ||
"version": "0.8.0-alpha-c8576d0.0", | ||
"peerDependencies": { | ||
@@ -9,3 +9,3 @@ "graphql": "^15.4.0 || ^16.0.0" | ||
"@graphql-tools/utils": "^8.5.2", | ||
"@n1ru4l/graphql-live-query": "0.9.0-alpha-35682dd.0", | ||
"@n1ru4l/graphql-live-query": "0.9.0-alpha-c8576d0.0", | ||
"@n1ru4l/push-pull-async-iterable-iterator": "^3.0.0" | ||
@@ -12,0 +12,0 @@ }, |
49452
929
+ Added@n1ru4l/graphql-live-query@0.9.0-alpha-c8576d0.0(transitive)
- Removed@n1ru4l/graphql-live-query@0.9.0-alpha-35682dd.0(transitive)