@rytass/wms-module-graphql 0.1.4 → 0.1.5
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/docs/integration-guide.md +47 -0
- package/package.json +2 -2
|
@@ -68,6 +68,24 @@ The reference consumer ([`wms-standalone`](#13-reference-implementation-wms-stan
|
|
|
68
68
|
|
|
69
69
|
The frontend package (`wms-module-react`) is **ESM-only** (`"type": "module"`). Bundlers that target Next.js / Vite / webpack 5 handle this transparently; classic CJS-only Node tools do not.
|
|
70
70
|
|
|
71
|
+
### 2.1 pnpm build-script approval
|
|
72
|
+
|
|
73
|
+
If you are on **pnpm 9 or newer**, the first `pnpm install` will refuse to run native build scripts for several transitive dependencies and surface `ERR_PNPM_IGNORED_BUILDS`. This is pnpm's supply-chain protection, not a WMS issue, but it is the very first error a fresh integrator hits.
|
|
74
|
+
|
|
75
|
+
Resolve it once by approving the packages WMS transitively needs to build:
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
pnpm approve-builds
|
|
79
|
+
# Or, in pnpm-workspace.yaml:
|
|
80
|
+
# allowBuilds:
|
|
81
|
+
# '@apollo/protobufjs': true
|
|
82
|
+
# '@nestjs/core': true
|
|
83
|
+
# '@parcel/watcher': true
|
|
84
|
+
# sharp: true
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
After approval, `pnpm install` completes cleanly. The exact list pnpm asks you to approve depends on your other dependencies; the four above are the ones triggered by WMS's NestJS + Apollo + native-image stack.
|
|
88
|
+
|
|
71
89
|
---
|
|
72
90
|
|
|
73
91
|
## 3. Quick start (60 seconds)
|
|
@@ -208,6 +226,35 @@ WmsModuleGraphqlModule.forRootAsync(
|
|
|
208
226
|
|
|
209
227
|
See [API Reference - wms-module-graphql](./api-reference.md) for the full `forRootAsync` signature.
|
|
210
228
|
|
|
229
|
+
### Adding your own resolvers alongside WMS
|
|
230
|
+
|
|
231
|
+
`WmsModuleGraphqlModule` calls `GraphQLModule.forRootAsync(...)` internally — that registration is workspace-global, so you cannot register a second `GraphQLModule` (see §13.1). What you **can** do is put your own resolvers in **sibling NestJS modules** imported in `AppModule`:
|
|
232
|
+
|
|
233
|
+
```ts
|
|
234
|
+
// apps/api/src/modules/posts/posts.module.ts
|
|
235
|
+
import { Module } from '@nestjs/common';
|
|
236
|
+
import { TypeOrmModule } from '@nestjs/typeorm';
|
|
237
|
+
import { Post } from './post.entity';
|
|
238
|
+
import { PostResolver } from './post.resolver';
|
|
239
|
+
|
|
240
|
+
@Module({
|
|
241
|
+
imports: [TypeOrmModule.forFeature([Post])],
|
|
242
|
+
providers: [PostResolver],
|
|
243
|
+
})
|
|
244
|
+
export class PostsModule {}
|
|
245
|
+
|
|
246
|
+
// apps/api/src/app/app.module.ts
|
|
247
|
+
@Module({
|
|
248
|
+
imports: [
|
|
249
|
+
/* ... TypeOrm, Config, WmsModuleGraphqlModule ... */
|
|
250
|
+
PostsModule, // your sibling module
|
|
251
|
+
],
|
|
252
|
+
})
|
|
253
|
+
export class AppModule {}
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
NestJS's GraphQL module discovers every `@Resolver()` class from every imported module via DI and merges them into the **same** schema. So your `Post`/`User` resolvers coexist in one schema with the WMS resolvers automatically — no extra wiring needed. The §13.1 "one GraphQLModule" constraint only forbids a second `GraphQLModule.forRoot(...)` registration, not additional resolvers.
|
|
257
|
+
|
|
211
258
|
### 4.3 `.env`
|
|
212
259
|
|
|
213
260
|
Keep DB credentials in `.env` (and add it to `.gitignore`).
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rytass/wms-module-graphql",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.5",
|
|
4
4
|
"description": "Rytass WMS Module — GraphQL schema, resolvers and DTOs for warehouse management",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"rytass",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"@nestjs/apollo": ">=13.0.0 <13.2.0",
|
|
50
50
|
"@nestjs/common": "^11.0.0",
|
|
51
51
|
"@nestjs/graphql": "^13.0.0",
|
|
52
|
-
"@rytass/wms-module-core": "^0.1.
|
|
52
|
+
"@rytass/wms-module-core": "^0.1.5",
|
|
53
53
|
"graphql": "^16.0.0",
|
|
54
54
|
"reflect-metadata": "^0.1.13 || ^0.2.0",
|
|
55
55
|
"rxjs": "^7.8.0"
|