Skip to content

Commit

Permalink
refactor: remove type hook property from ctx
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonkuhrt committed Oct 31, 2024
1 parent d7d0752 commit b031e6c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
3 changes: 0 additions & 3 deletions src/layers/6_client/context.ts
Original file line number Diff line number Diff line change
@@ -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'
Expand All @@ -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: []
}
Expand Down
5 changes: 3 additions & 2 deletions src/layers/6_client/extension/use.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@ export interface Use<$Args extends Chain.Extension.Parameters<Use_>> {
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'],
Expand Down

0 comments on commit b031e6c

Please sign in to comment.