@@ -414,18 +414,18 @@ const introspectHeadersForConnection = (
414414 return { headers, queryParams } ;
415415} ;
416416
417- /** Resolve a config's introspection snapshot text: legacy rows inline it in
418- * `introspectionJson`; new rows point at the plugin blob store via
419- * `introspectionHash`. Null when the integration has no snapshot (live
420- * introspection territory). */
417+ /** Resolve a config's introspection snapshot text from the plugin blob store
418+ * (`introspectionHash`). Null when the integration has no snapshot (live
419+ * introspection territory). Pre-blob rows that inlined the JSON are
420+ * rewritten by the introspection-to-blob migrations before this code reads
421+ * them. */
421422const loadIntrospectionJson = (
422423 storage : GraphqlStore ,
423424 config : GraphqlIntegrationConfig ,
424- ) : Effect . Effect < string | null , StorageFailure > => {
425- if ( config . introspectionJson != null ) return Effect . succeed ( config . introspectionJson ) ;
426- if ( config . introspectionHash != null ) return storage . getIntrospection ( config . introspectionHash ) ;
427- return Effect . succeed ( null ) ;
428- } ;
425+ ) : Effect . Effect < string | null , StorageFailure > =>
426+ config . introspectionHash != null
427+ ? storage . getIntrospection ( config . introspectionHash )
428+ : Effect . succeed ( null ) ;
429429
430430/** Introspect a config live or from its stored snapshot, applying connection
431431 * auth. A non-null `introspectionJson` (loaded via `loadIntrospectionJson`)
@@ -558,9 +558,6 @@ const makeGraphqlExtension = (ctx: PluginCtx<GraphqlStore>) => {
558558 GraphqlIntegrationConfig . make ( {
559559 endpoint : input . endpoint ,
560560 name : input . name ?. trim ( ) || slugFromEndpoint ( input . endpoint ) ,
561- ...( input . introspectionJson !== undefined
562- ? { introspectionJson : input . introspectionJson }
563- : { } ) ,
564561 ...( input . headers !== undefined ? { headers : input . headers } : { } ) ,
565562 ...( input . queryParams !== undefined ? { queryParams : input . queryParams } : { } ) ,
566563 authenticationTemplate : input . authenticationTemplate
@@ -602,7 +599,7 @@ const makeGraphqlExtension = (ctx: PluginCtx<GraphqlStore>) => {
602599 // their operation bindings) are produced lazily when a connection is
603600 // created (`resolveTools`) / a tool is first invoked (`invokeTool`),
604601 // using that connection's credential.
605- if ( baseConfig . introspectionJson === undefined ) {
602+ if ( input . introspectionJson === undefined ) {
606603 yield * ctx . transaction (
607604 ctx . core . integrations . register ( {
608605 slug,
@@ -617,7 +614,7 @@ const makeGraphqlExtension = (ctx: PluginCtx<GraphqlStore>) => {
617614
618615 // Pre-supplied introspection JSON: parse it offline (no network) and
619616 // persist the operation bindings + snapshot so production stays offline.
620- const introspection = yield * parseIntrospectionJson ( baseConfig . introspectionJson ) ;
617+ const introspection = yield * parseIntrospectionJson ( input . introspectionJson ) ;
621618 const { result } = yield * extract ( introspection ) ;
622619 const prepared = prepareOperations ( result . fields , introspection ) ;
623620
@@ -629,9 +626,8 @@ const makeGraphqlExtension = (ctx: PluginCtx<GraphqlStore>) => {
629626 // carries only its hash.
630627 const snapshotJson = JSON . stringify ( { data : introspection } ) ;
631628 const introspectionHash = yield * sha256Hex ( snapshotJson ) ;
632- const { introspectionJson : _inline , ...withoutInline } = baseConfig ;
633629 const config = GraphqlIntegrationConfig . make ( {
634- ...withoutInline ,
630+ ...baseConfig ,
635631 introspectionHash,
636632 } ) ;
637633
@@ -677,9 +673,6 @@ const makeGraphqlExtension = (ctx: PluginCtx<GraphqlStore>) => {
677673 const next = GraphqlIntegrationConfig . make ( {
678674 endpoint : input . endpoint ?? current . endpoint ,
679675 name : input . name ?. trim ( ) || current . name ,
680- ...( current . introspectionJson !== undefined
681- ? { introspectionJson : current . introspectionJson }
682- : { } ) ,
683676 ...( current . introspectionHash !== undefined
684677 ? { introspectionHash : current . introspectionHash }
685678 : { } ) ,
0 commit comments