From 6ba1ff15f3616c1dcfaf897d52323f9108a64217 Mon Sep 17 00:00:00 2001 From: Scott Twiname Date: Thu, 28 Nov 2024 12:13:28 +1300 Subject: [PATCH] Fix subscriptions including multichain metadata tables (#2609) * Fix subscriptions including multichain metadata tables * Update changelog --- packages/query/CHANGELOG.md | 2 ++ packages/query/src/graphql/plugins/PgSubscriptionPlugin.ts | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/query/CHANGELOG.md b/packages/query/CHANGELOG.md index 064639fdfb..e0a4481adc 100644 --- a/packages/query/CHANGELOG.md +++ b/packages/query/CHANGELOG.md @@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] +### Fixed +- Crash with query service subscriptions on multichain projects (#2609) ## [2.17.0] - 2024-11-25 ### Changed diff --git a/packages/query/src/graphql/plugins/PgSubscriptionPlugin.ts b/packages/query/src/graphql/plugins/PgSubscriptionPlugin.ts index 3862dad304..8a4b93e796 100644 --- a/packages/query/src/graphql/plugins/PgSubscriptionPlugin.ts +++ b/packages/query/src/graphql/plugins/PgSubscriptionPlugin.ts @@ -46,7 +46,7 @@ export const PgSubscriptionPlugin = makeExtendSchemaPlugin((build) => { // Generate subscription fields for all database tables (pgIntrospectionResultsByKind as PgIntrospectionResultsByKind).class.forEach((table) => { - if (!table.namespace || table.name === '_metadata') return; + if (!table.namespace || table.name.includes('_metadata')) return; const field = inflection.allRows(table); const type = inflection.tableType(table);