From b031e6c4778f08dec18f16d1b43c0baa68b567fb Mon Sep 17 00:00:00 2001 From: Jason Kuhrt Date: Wed, 30 Oct 2024 21:40:10 -0400 Subject: [PATCH] refactor: remove type hook property from ctx --- src/layers/6_client/context.ts | 3 --- src/layers/6_client/extension/use.ts | 5 +++-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/layers/6_client/context.ts b/src/layers/6_client/context.ts index b022c9cd6..23b2ceaad 100644 --- a/src/layers/6_client/context.ts +++ b/src/layers/6_client/context.ts @@ -1,5 +1,4 @@ import type { Anyware } from '../../lib/anyware/__.js' -import type { Chain } from '../../lib/chain/__.js' import type { RequestPipeline } from '../../requestPipeline/__.js' import type { Schema } from '../../types/Schema/__.js' import type { Extension } from './extension/extension.js' @@ -16,13 +15,11 @@ export interface Context { scalars: Schema.Scalar.Registry typeHooks: { onRequestResult: Extension.Hooks.OnRequestResult[] - property: Chain.Extension[] onRequestDocumentRootType: Extension.Hooks.OnRequestDocumentRootType[] } } export type TypeHooksEmpty = { - property: [] onRequestDocumentRootType: [] onRequestResult: [] } diff --git a/src/layers/6_client/extension/use.ts b/src/layers/6_client/extension/use.ts index 998ee729e..51be2b1ba 100644 --- a/src/layers/6_client/extension/use.ts +++ b/src/layers/6_client/extension/use.ts @@ -23,9 +23,10 @@ export interface Use<$Args extends Chain.Extension.Parameters> { ConfigManager.SetAtPath< $Args['context'], ['typeHooks', 'onRequestResult'], + // dprint-ignore ( - $Extension['typeHooks']['onRequestResult'] extends undefined ? $Args['context']['typeHooks']['onRequestResult'] - // dprint-ignore + $Extension['typeHooks']['onRequestResult'] extends undefined + ? $Args['context']['typeHooks']['onRequestResult'] : [ ...$Args['context']['typeHooks']['onRequestResult'], $Extension['typeHooks']['onRequestResult'],