Skip to content

Commit

Permalink
refactor: inline graphql-parse-resolve-info
Browse files Browse the repository at this point in the history
  • Loading branch information
IlyaSemenov committed Feb 23, 2024
1 parent 150441c commit 262aa3e
Show file tree
Hide file tree
Showing 8 changed files with 462 additions and 43 deletions.
7 changes: 7 additions & 0 deletions .changeset/wicked-starfishes-join.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"objection-graphql-resolver": minor
"orchid-graphql": minor
"graphql-orm": minor
---

Inline graphql-parse-resolve-info to prevent false peer dependency error in dependent packages.
4 changes: 1 addition & 3 deletions packages/graphql-orm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,11 @@
"author": "Ilya Semenov",
"license": "MIT",
"type": "module",
"dependencies": {
"graphql-parse-resolve-info": "^4.12.0"
},
"peerDependencies": {
"graphql": "^16"
},
"devDependencies": {
"@types/node": "^20.11.20",
"tsconfig-vite-node": "^1.1.0"
}
}
5 changes: 4 additions & 1 deletion packages/graphql-orm/src/resolvers/graph.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
import type { GraphQLResolveInfo } from "graphql"
import { parseResolveInfo, ResolveTree } from "graphql-parse-resolve-info"

import { FiltersDef } from "../filters/filters"
import { OrmAdapter } from "../orm/orm"
import { Paginator } from "../paginators/base"
import {
parseResolveInfo,
type ResolveTree,
} from "../utils/graphql-parse-resolve-info"
import type { TableResolver, TableResolverOptions } from "./table"

export type GraphResolverOptions<Orm extends OrmAdapter, Context> = Pick<
Expand Down
13 changes: 13 additions & 0 deletions packages/graphql-orm/src/utils/graphql-parse-resolve-info-debug.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// Mimic npm debug (but don't actually have it as a dependency)

interface DebugFn {
(message: string, ...args: any[]): void
enabled: boolean
}

// eslint-disable-next-line @typescript-eslint/no-unused-vars
export default function debugFactory(name: string): DebugFn {
function debug() {}
debug.enabled = false
return debug
}
Loading

0 comments on commit 262aa3e

Please sign in to comment.