Skip to content

Commit

Permalink
Remove manyToMany warnings (#2189)
Browse files Browse the repository at this point in the history
  • Loading branch information
benjie authored Sep 30, 2024
2 parents c4f5413 + 0df1711 commit 78e56ab
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/great-cameras-double.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"graphile-build-pg": patch
---

Fix issue with manyToMany behavior warnings
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ declare global {
isIndexed?: boolean;
}
}
namespace GraphileBuild {
interface BehaviorStrings {
manyToMany: true;
}
}
}

export const PgIndexBehaviorsPlugin: GraphileConfig.Plugin = {
Expand Down Expand Up @@ -87,6 +92,15 @@ export const PgIndexBehaviorsPlugin: GraphileConfig.Plugin = {
},
},
schema: {
behaviorRegistry: {
add: {
// HACK: this impacts a community plugin and isn't part of core.
manyToMany: {
entities: [],
description: "(Legacy support hack - many-to-many relationship)",
},
},
},
entityBehavior: {
pgCodecAttribute: {
inferred: {
Expand Down Expand Up @@ -115,7 +129,7 @@ export const PgIndexBehaviorsPlugin: GraphileConfig.Plugin = {
"-single",

// HACK: this impacts a community plugin and isn't part of core.
"-manyToMany" as GraphileBuild.BehaviorString,
"-manyToMany",
);
}
return newBehavior;
Expand Down

0 comments on commit 78e56ab

Please sign in to comment.