From 91c309d05f873bfbdf0c9fe4d9cdafde914166b4 Mon Sep 17 00:00:00 2001 From: Ilya Semenov Date: Thu, 20 Jun 2024 19:32:04 +0700 Subject: [PATCH] orchid-graphql: remove dependency on pqb --- .changeset/rare-comics-hide.md | 5 +++++ packages/orchid-graphql/package.json | 4 +--- packages/orchid-graphql/src/orm/orm.ts | 2 +- .../orchid-graphql/tests/main/async-field-modifier.test.ts | 4 ++-- pnpm-lock.yaml | 3 --- 5 files changed, 9 insertions(+), 9 deletions(-) create mode 100644 .changeset/rare-comics-hide.md diff --git a/.changeset/rare-comics-hide.md b/.changeset/rare-comics-hide.md new file mode 100644 index 0000000..ee5474a --- /dev/null +++ b/.changeset/rare-comics-hide.md @@ -0,0 +1,5 @@ +--- +"orchid-graphql": patch +--- + +Remove dependency on `pqb`. diff --git a/packages/orchid-graphql/package.json b/packages/orchid-graphql/package.json index def60c2..b625b74 100644 --- a/packages/orchid-graphql/package.json +++ b/packages/orchid-graphql/package.json @@ -31,8 +31,7 @@ }, "peerDependencies": { "graphql": "^16", - "orchid-orm": "^1.12.0", - "pqb": ">=0.14" + "orchid-orm": "^1.22.0" }, "devDependencies": { "@apollo/server": "^4.7.1", @@ -41,7 +40,6 @@ "graphql-request": "^6.0.0", "graphql-tag": "^2.12.6", "orchid-orm": "^1.23.0", - "pqb": "^0.25.0", "tsconfig-vite-node": "^1.1.2", "tsup": "^8.1.0", "vite": "^5.3.1", diff --git a/packages/orchid-graphql/src/orm/orm.ts b/packages/orchid-graphql/src/orm/orm.ts index c0452d2..a4951a4 100644 --- a/packages/orchid-graphql/src/orm/orm.ts +++ b/packages/orchid-graphql/src/orm/orm.ts @@ -1,6 +1,6 @@ import { OrmAdapter } from "graphql-orm" +import type { Query } from "orchid-orm" import { DbTable, raw } from "orchid-orm" -import type { Query } from "pqb" export type OrchidOrm = OrmAdapter< DbTable, diff --git a/packages/orchid-graphql/tests/main/async-field-modifier.test.ts b/packages/orchid-graphql/tests/main/async-field-modifier.test.ts index a24a5d5..dc1d48d 100644 --- a/packages/orchid-graphql/tests/main/async-field-modifier.test.ts +++ b/packages/orchid-graphql/tests/main/async-field-modifier.test.ts @@ -1,6 +1,5 @@ import gql from "graphql-tag" import * as r from "orchid-graphql" -import { _queryWhere } from "pqb" import { assert, test } from "vitest" import { BaseTable, create_client, create_db, Resolvers } from "../setup" @@ -62,7 +61,8 @@ const graph = r.graph({ favorite_for_user(query, user_id: number) { return query.beforeQuery(async (query) => { const tag = await db.user.find(user_id).get("favorite_tag") - _queryWhere(query, [{ tag }]) + // beforeQuery doesn't support returning a new query, update it in-place + query.q = query.where({ tag }).q }) }, }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 5e7a891..5ce6399 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -125,9 +125,6 @@ importers: orchid-orm: specifier: ^1.23.0 version: 1.23.0(typescript@5.4.5) - pqb: - specifier: ^0.25.0 - version: 0.25.0 tsconfig-vite-node: specifier: ^1.1.2 version: 1.1.2