@common-stack/client-core
Advanced tools
Comparing version 0.5.21 to 0.5.23
@@ -65,3 +65,6 @@ import { IdGetterObj } from '@apollo/client/core'; | ||
container?: interfaces.Container; | ||
reqHeaders?: any; | ||
requestResponsePair?: { | ||
req: Record<string, any>; | ||
res: Record<string, any>; | ||
}; | ||
}): IClientState; | ||
@@ -68,0 +71,0 @@ get connectionParams(): any; |
@@ -116,3 +116,3 @@ import*as React from'react';import {merge,without,union,map,castArray}from'lodash';import {Container}from'inversify';/* eslint-disable @typescript-eslint/no-explicit-any */ | ||
const cn = args.container || this.container; | ||
const headers = args.reqHeaders; // Use headers as needed in the function | ||
const { requestResponsePair } = args; | ||
return this.clientStateParams.reduce((acc, curr) => { | ||
@@ -142,3 +142,3 @@ const defs = curr.typeDefs ? (Array.isArray(curr.typeDefs) ? curr.typeDefs : [curr.typeDefs]) : []; | ||
: attemptFuncAccumulator; | ||
const preLinks = preLinksAccumulator.concat((curr.preLinkFuncs || []).map((linkF) => linkF(cn, headers)) || []); | ||
const preLinks = preLinksAccumulator.concat((curr.preLinkFuncs || []).map((linkF) => linkF(cn, requestResponsePair)) || []); | ||
const connectionParams = curr.connectionParam | ||
@@ -145,0 +145,0 @@ ? connectionParamsFuncAccumulator.concat(consoldidatedConnection(curr.connectionParam, cn)) |
@@ -10,3 +10,6 @@ import { Resolvers, IdGetterObj, PossibleTypesMap, TypePolicies, Operation, ApolloLink } from '@apollo/client/core'; | ||
export type ResolverType = Resolvers | Resolvers[] | ((service: any) => Resolvers) | ((service: any) => Resolvers)[] | ((service: any) => any) | ((service: any) => any)[]; | ||
export type ApolloLinkFunc = (container: interfaces.Container, req?: any) => ApolloLink; | ||
export type ApolloLinkFunc = (container: interfaces.Container, req?: any, requestResponsePair?: { | ||
req: Record<string, any>; | ||
res: Record<string, any>; | ||
}) => ApolloLink; | ||
export type ApolloConnectionParamFunc = ((container: interfaces.Container) => ConnectionParams) | ConnectionParams; | ||
@@ -13,0 +16,0 @@ export type IWSConnectionCallbackFunc = (webSocket: any, error: Error[], result?: any) => void | Promise<void>; |
{ | ||
"name": "@common-stack/client-core", | ||
"version": "0.5.21", | ||
"version": "0.5.23", | ||
"description": "common core for higher packages to depend on", | ||
@@ -34,3 +34,3 @@ "license": "ISC", | ||
}, | ||
"gitHead": "4cc2a1dccc27572118245f2ea4f671d70a3db9d3" | ||
"gitHead": "231f165758372d5e8c2eeb7d8bdc16a7c996b42e" | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
43650
698