Skip to content

Commit

Permalink
orchid-graphql: remove dependency on pqb
Browse files Browse the repository at this point in the history
  • Loading branch information
IlyaSemenov committed Jun 20, 2024
1 parent e6d8a97 commit 91c309d
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
5 changes: 5 additions & 0 deletions .changeset/rare-comics-hide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"orchid-graphql": patch
---

Remove dependency on `pqb`.
4 changes: 1 addition & 3 deletions packages/orchid-graphql/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion packages/orchid-graphql/src/orm/orm.ts
Original file line number Diff line number Diff line change
@@ -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<any>,
Expand Down
Original file line number Diff line number Diff line change
@@ -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"
Expand Down Expand Up @@ -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
})
},
},
Expand Down
3 changes: 0 additions & 3 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 91c309d

Please sign in to comment.