From 3fdc6cab2ed0719589b704f171d7399fa26051a0 Mon Sep 17 00:00:00 2001 From: "Jorge S. Cuesta" Date: Tue, 3 Dec 2024 10:47:44 -0400 Subject: [PATCH] Add PgOrderByRelatedPlugin to GraphQL query package Incorporated the PgOrderByRelatedPlugin to enhance querying capabilities by allowing ordering based on related entities. Updated the package.json and yarn.lock files to include the new dependency, ensuring all relevant configurations are in place. --- packages/query/package.json | 1 + packages/query/src/graphql/plugins/index.ts | 2 ++ yarn.lock | 8 ++++++++ 3 files changed, 11 insertions(+) diff --git a/packages/query/package.json b/packages/query/package.json index 473efc3dc7..e81fe645cc 100644 --- a/packages/query/package.json +++ b/packages/query/package.json @@ -31,6 +31,7 @@ ], "dependencies": { "@graphile-contrib/pg-many-to-many": "^1.0.2", + "@graphile-contrib/pg-order-by-related": "^1.0.0", "@graphile-contrib/pg-simplify-inflector": "^6.1.0", "@graphile/pg-aggregates": "^0.1.1", "@graphile/pg-pubsub": "^4.13.0", diff --git a/packages/query/src/graphql/plugins/index.ts b/packages/query/src/graphql/plugins/index.ts index ff4de95995..31c285808f 100644 --- a/packages/query/src/graphql/plugins/index.ts +++ b/packages/query/src/graphql/plugins/index.ts @@ -41,6 +41,7 @@ import PgConnectionTotalCount from '@subql/x-graphile-build-pg/node8plus/plugins import PgSimplifyInflectorPlugin from '@graphile-contrib/pg-simplify-inflector'; import PgManyToManyPlugin from '@graphile-contrib/pg-many-to-many'; import ConnectionFilterPlugin from 'postgraphile-plugin-connection-filter'; +import PgOrderByRelatedPlugin from '@graphile-contrib/pg-order-by-related'; // custom plugins import PgConnectionArgFirstLastBeforeAfter from './PgConnectionArgFirstLastBeforeAfter'; @@ -113,6 +114,7 @@ const plugins = [ PgRowByVirtualIdPlugin, PgDistinctPlugin, PgSearchPlugin, + PgOrderByRelatedPlugin, makeAddInflectorsPlugin((inflectors) => { const {constantCase: oldConstantCase} = inflectors; const enumValues = new Set(); diff --git a/yarn.lock b/yarn.lock index 96bbe28336..d62fc8d1d5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4050,6 +4050,13 @@ __metadata: languageName: node linkType: hard +"@graphile-contrib/pg-order-by-related@npm:^1.0.0": + version: 1.0.0 + resolution: "@graphile-contrib/pg-order-by-related@npm:1.0.0" + checksum: e5fa3655075b6c499926cf954e809ff827d23710919662a4a1de5a342b2d9874f7b5d47e4d7924aa8da65a3e33e716c57326358ef4cb8812ea125e21abefdd31 + languageName: node + linkType: hard + "@graphile-contrib/pg-simplify-inflector@npm:^6.1.0": version: 6.1.0 resolution: "@graphile-contrib/pg-simplify-inflector@npm:6.1.0" @@ -6860,6 +6867,7 @@ __metadata: resolution: "@subql/query@workspace:packages/query" dependencies: "@graphile-contrib/pg-many-to-many": ^1.0.2 + "@graphile-contrib/pg-order-by-related": ^1.0.0 "@graphile-contrib/pg-simplify-inflector": ^6.1.0 "@graphile/pg-aggregates": ^0.1.1 "@graphile/pg-pubsub": ^4.13.0