@contractspec/lib.graphql-prisma 3.7.5 → 3.7.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +31 -48
- package/dist/browser/index.js +2 -2
- package/dist/index.js +2 -2
- package/dist/node/index.js +2 -2
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -1,71 +1,54 @@
|
|
|
1
1
|
# @contractspec/lib.graphql-prisma
|
|
2
2
|
|
|
3
|
-
Website: https://contractspec.io
|
|
3
|
+
Website: https://contractspec.io
|
|
4
4
|
|
|
5
|
+
**Pothos + Prisma builder factory with injectable client/DMMF.**
|
|
5
6
|
|
|
6
|
-
|
|
7
|
+
## What It Provides
|
|
7
8
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
- **Layer**: lib.
|
|
10
|
+
- **Consumers**: bundles with Prisma.
|
|
11
|
+
- Related ContractSpec packages include `@contractspec/lib.schema`, `@contractspec/tool.bun`, `@contractspec/tool.typescript`.
|
|
12
|
+
- Related ContractSpec packages include `@contractspec/lib.schema`, `@contractspec/tool.bun`, `@contractspec/tool.typescript`.
|
|
11
13
|
|
|
12
14
|
## Installation
|
|
13
15
|
|
|
14
|
-
|
|
15
|
-
npm install @contractspec/lib.graphql-prisma
|
|
16
|
-
# or
|
|
17
|
-
bun add @contractspec/lib.graphql-prisma
|
|
18
|
-
```
|
|
16
|
+
`npm install @contractspec/lib.graphql-prisma`
|
|
19
17
|
|
|
20
|
-
|
|
18
|
+
or
|
|
21
19
|
|
|
22
|
-
|
|
23
|
-
- **DMMF**: Uses Prisma's DMMF for type generation.
|
|
20
|
+
`bun add @contractspec/lib.graphql-prisma`
|
|
24
21
|
|
|
25
22
|
## Usage
|
|
26
23
|
|
|
27
|
-
|
|
28
|
-
import { builder } from '@contractspec/lib.graphql-prisma';
|
|
29
|
-
import { prisma } from '@contractspec/app.cli-database';
|
|
30
|
-
|
|
31
|
-
builder.prismaObject('User', {
|
|
32
|
-
fields: (t) => ({
|
|
33
|
-
id: t.exposeID('id'),
|
|
34
|
-
email: t.exposeString('email'),
|
|
35
|
-
}),
|
|
36
|
-
});
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
24
|
+
Import the root entrypoint from `@contractspec/lib.graphql-prisma`, or choose a documented subpath when you only need one part of the package surface.
|
|
62
25
|
|
|
26
|
+
## Architecture
|
|
63
27
|
|
|
28
|
+
- `src/index.ts` is the root public barrel and package entrypoint.
|
|
64
29
|
|
|
30
|
+
## Public Entry Points
|
|
65
31
|
|
|
32
|
+
- Export `.` resolves through `./src/index.ts`.
|
|
66
33
|
|
|
34
|
+
## Local Commands
|
|
67
35
|
|
|
36
|
+
- `bun run dev` — contractspec-bun-build dev
|
|
37
|
+
- `bun run build` — bun run prebuild && bun run build:bundle && bun run build:types
|
|
38
|
+
- `bun run typecheck` — tsc --noEmit
|
|
39
|
+
- `bun run publish:pkg` — bun publish --tolerate-republish --ignore-scripts --verbose
|
|
40
|
+
- `bun run publish:pkg:canary` — bun publish:pkg --tag canary
|
|
41
|
+
- `bun run clean` — rm -rf dist
|
|
42
|
+
- `bun run prebuild` — contractspec-bun-build prebuild
|
|
43
|
+
- `bun run build:bundle` — contractspec-bun-build transpile
|
|
44
|
+
- `bun run build:types` — contractspec-bun-build types
|
|
68
45
|
|
|
46
|
+
## Recent Updates
|
|
69
47
|
|
|
48
|
+
- Replace eslint+prettier by biomejs to optimize speed.
|
|
70
49
|
|
|
50
|
+
## Notes
|
|
71
51
|
|
|
52
|
+
- Prisma client injection must stay lazy — eagerly importing the client breaks tree-shaking and test isolation.
|
|
53
|
+
- DMMF handling is version-sensitive; Prisma major upgrades require validation here first.
|
|
54
|
+
- Depends on graphql-core — keep builder factory usage aligned.
|
package/dist/browser/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// src/index.ts
|
|
2
2
|
import SchemaBuilder from "@pothos/core";
|
|
3
|
-
import PrismaPlugin from "@pothos/plugin-prisma";
|
|
4
3
|
import ComplexityPlugin from "@pothos/plugin-complexity";
|
|
5
4
|
import DataloaderPlugin from "@pothos/plugin-dataloader";
|
|
5
|
+
import PrismaPlugin from "@pothos/plugin-prisma";
|
|
6
6
|
import RelayPlugin from "@pothos/plugin-relay";
|
|
7
7
|
import TracingPlugin, {
|
|
8
8
|
isRootField,
|
|
@@ -11,8 +11,8 @@ import TracingPlugin, {
|
|
|
11
11
|
import"@pothos/plugin-prisma";
|
|
12
12
|
import"@pothos/plugin-relay";
|
|
13
13
|
import"@pothos/plugin-complexity";
|
|
14
|
-
import { GeoJSONResolver } from "graphql-scalars";
|
|
15
14
|
import { ScalarTypeEnum } from "@contractspec/lib.schema";
|
|
15
|
+
import { GeoJSONResolver } from "graphql-scalars";
|
|
16
16
|
function createPrismaSchemaBuilder(options) {
|
|
17
17
|
const debugBuilder = process.env.CONTRACTSPEC_DEBUG_GRAPHQL_BUILDER === "true";
|
|
18
18
|
const plugins = [
|
package/dist/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
// src/index.ts
|
|
3
3
|
import SchemaBuilder from "@pothos/core";
|
|
4
|
-
import PrismaPlugin from "@pothos/plugin-prisma";
|
|
5
4
|
import ComplexityPlugin from "@pothos/plugin-complexity";
|
|
6
5
|
import DataloaderPlugin from "@pothos/plugin-dataloader";
|
|
6
|
+
import PrismaPlugin from "@pothos/plugin-prisma";
|
|
7
7
|
import RelayPlugin from "@pothos/plugin-relay";
|
|
8
8
|
import TracingPlugin, {
|
|
9
9
|
isRootField,
|
|
@@ -12,8 +12,8 @@ import TracingPlugin, {
|
|
|
12
12
|
import"@pothos/plugin-prisma";
|
|
13
13
|
import"@pothos/plugin-relay";
|
|
14
14
|
import"@pothos/plugin-complexity";
|
|
15
|
-
import { GeoJSONResolver } from "graphql-scalars";
|
|
16
15
|
import { ScalarTypeEnum } from "@contractspec/lib.schema";
|
|
16
|
+
import { GeoJSONResolver } from "graphql-scalars";
|
|
17
17
|
function createPrismaSchemaBuilder(options) {
|
|
18
18
|
const debugBuilder = process.env.CONTRACTSPEC_DEBUG_GRAPHQL_BUILDER === "true";
|
|
19
19
|
const plugins = [
|
package/dist/node/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// src/index.ts
|
|
2
2
|
import SchemaBuilder from "@pothos/core";
|
|
3
|
-
import PrismaPlugin from "@pothos/plugin-prisma";
|
|
4
3
|
import ComplexityPlugin from "@pothos/plugin-complexity";
|
|
5
4
|
import DataloaderPlugin from "@pothos/plugin-dataloader";
|
|
5
|
+
import PrismaPlugin from "@pothos/plugin-prisma";
|
|
6
6
|
import RelayPlugin from "@pothos/plugin-relay";
|
|
7
7
|
import TracingPlugin, {
|
|
8
8
|
isRootField,
|
|
@@ -11,8 +11,8 @@ import TracingPlugin, {
|
|
|
11
11
|
import"@pothos/plugin-prisma";
|
|
12
12
|
import"@pothos/plugin-relay";
|
|
13
13
|
import"@pothos/plugin-complexity";
|
|
14
|
-
import { GeoJSONResolver } from "graphql-scalars";
|
|
15
14
|
import { ScalarTypeEnum } from "@contractspec/lib.schema";
|
|
15
|
+
import { GeoJSONResolver } from "graphql-scalars";
|
|
16
16
|
function createPrismaSchemaBuilder(options) {
|
|
17
17
|
const debugBuilder = process.env.CONTRACTSPEC_DEBUG_GRAPHQL_BUILDER === "true";
|
|
18
18
|
const plugins = [
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contractspec/lib.graphql-prisma",
|
|
3
|
-
"version": "3.7.
|
|
3
|
+
"version": "3.7.8",
|
|
4
4
|
"description": "Pothos + Prisma builder factory with injectable client/DMMF",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"contractspec",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"typecheck": "tsc --noEmit"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@contractspec/lib.schema": "3.7.
|
|
30
|
+
"@contractspec/lib.schema": "3.7.8",
|
|
31
31
|
"@pothos/core": "^4.9.1",
|
|
32
32
|
"@pothos/plugin-complexity": "^4.1.2",
|
|
33
33
|
"@pothos/plugin-dataloader": "^4.4.2",
|
|
@@ -41,9 +41,9 @@
|
|
|
41
41
|
"graphql": ">=16.13.1"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
|
-
"@contractspec/tool.typescript": "3.7.
|
|
44
|
+
"@contractspec/tool.typescript": "3.7.8",
|
|
45
45
|
"typescript": "^5.9.3",
|
|
46
|
-
"@contractspec/tool.bun": "3.7.
|
|
46
|
+
"@contractspec/tool.bun": "3.7.8"
|
|
47
47
|
},
|
|
48
48
|
"type": "module",
|
|
49
49
|
"exports": {
|