@application-kit/graphql 0.2.2 → 0.3.0
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/CHANGELOG.md +10 -0
- package/README.md +25 -1
- package/dist/cjs/nest/graphql.config.d.ts +7 -0
- package/dist/cjs/nest/graphql.config.js +37 -0
- package/dist/cjs/nest/graphql.environment.d.ts +4 -0
- package/dist/cjs/nest/graphql.environment.js +32 -0
- package/dist/cjs/nest/index.d.ts +4 -0
- package/dist/cjs/nest/index.js +20 -0
- package/dist/cjs/nest/mercurius-options.d.ts +2 -0
- package/dist/cjs/nest/mercurius-options.interface.d.ts +11 -0
- package/dist/cjs/nest/mercurius-options.interface.js +2 -0
- package/dist/cjs/nest/mercurius-options.js +22 -0
- package/dist/esm/nest/graphql.config.d.ts +7 -0
- package/dist/esm/nest/graphql.config.js +34 -0
- package/dist/esm/nest/graphql.environment.d.ts +4 -0
- package/dist/esm/nest/graphql.environment.js +28 -0
- package/dist/esm/nest/index.d.ts +4 -0
- package/dist/esm/nest/index.js +4 -0
- package/dist/esm/nest/mercurius-options.d.ts +2 -0
- package/dist/esm/nest/mercurius-options.interface.d.ts +11 -0
- package/dist/esm/nest/mercurius-options.interface.js +1 -0
- package/dist/esm/nest/mercurius-options.js +15 -0
- package/package.json +31 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# @application-kit/graphql
|
|
2
2
|
|
|
3
|
+
## 0.3.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 1966fa9: Вход `@application-kit/graphql/nest` — периметр Mercurius-сервера: `createMercuriusOptions({ schemaPath, maxDepth,
|
|
8
|
+
playground, resolveSupportId })` (интроспекция только при включённой консоли, потолок вложенности, `errorFormatter`
|
|
9
|
+
через `formatGraphQLError` с одним `supportId` на ответ), окружение `GraphqlEnvironment` (`GRAPHQL_PLAYGROUND`,
|
|
10
|
+
`GRAPHQL_SCHEMA_PATH`) и конфиг `GraphqlConfig`. `@nestjs/mercurius`, `mercurius` и `@libs-for-dev/nestjs-config-module`
|
|
11
|
+
— optional peers, нужные только этому входу.
|
|
12
|
+
|
|
3
13
|
## 0.2.2
|
|
4
14
|
|
|
5
15
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -10,7 +10,8 @@ yarn add @application-kit/graphql
|
|
|
10
10
|
```
|
|
11
11
|
|
|
12
12
|
Peer-зависимости: `@nestjs/common`, `@nestjs/graphql`, `class-transformer`, `class-validator`, `graphql`,
|
|
13
|
-
`@apollo/client
|
|
13
|
+
`@apollo/client` — обязательные; `@nestjs/mercurius`, `mercurius`, `@libs-for-dev/nestjs-config-module` — optional,
|
|
14
|
+
нужны только входу `/nest`. Зависимость `@application-kit/typeorm` ставится сама (типы листинга
|
|
14
15
|
берут оттуда `FiltersMatchMode` и `SortOrder`).
|
|
15
16
|
|
|
16
17
|
## Входы
|
|
@@ -19,6 +20,7 @@ Peer-зависимости: `@nestjs/common`, `@nestjs/graphql`, `class-transfo
|
|
|
19
20
|
|------|----------|-------|
|
|
20
21
|
| `@application-kit/graphql` | сервер: ошибки, форматтер, типы листинга | `@nestjs/*`, `class-validator` |
|
|
21
22
|
| `@application-kit/graphql/client` | браузер и SSR: чтение `extensions` ответа | только `@apollo/client`, `graphql` (типы) |
|
|
23
|
+
| `@application-kit/graphql/nest` | периметр Mercurius-сервера: опции драйвера, окружение, конфиг | `mercurius`, `@nestjs/mercurius` (типы), `@libs-for-dev/nestjs-config-module` |
|
|
22
24
|
|
|
23
25
|
Клиентский вход не содержит импортов серверных зависимостей — его можно собирать в браузерный бандл.
|
|
24
26
|
|
|
@@ -44,6 +46,28 @@ export class BusinessGraphQLError extends BaseBusinessGraphQLError<MessageCode>
|
|
|
44
46
|
export type BusinessErrorOptions = BusinessErrorOptionsInterface<MessageCode>
|
|
45
47
|
```
|
|
46
48
|
|
|
49
|
+
## Сервер Mercurius (`/nest`)
|
|
50
|
+
|
|
51
|
+
- `createMercuriusOptions({ schemaPath, maxDepth, playground, resolveSupportId })` — опции `MercuriusDriver`:
|
|
52
|
+
выключена консоль (`playground: false`) — выключена и интроспекция схемы; запрос глубже `maxDepth` отвергается до
|
|
53
|
+
исполнения; `errorFormatter` прогоняет каждую ошибку через `formatGraphQLError` с одним `supportId` на ответ.
|
|
54
|
+
Пустой `schemaPath` — схема только в памяти.
|
|
55
|
+
- `GraphqlEnvironment` — `GRAPHQL_PLAYGROUND` (дефолт `false`) и необязательный `GRAPHQL_SCHEMA_PATH`;
|
|
56
|
+
`GraphqlConfig.createOptions({ schemaPath, maxDepth, resolveSupportId })` берёт флаг консоли из окружения, путь —
|
|
57
|
+
из окружения, если он задан, иначе из вызова. Регистрацию делает приложение:
|
|
58
|
+
|
|
59
|
+
```ts
|
|
60
|
+
ConfigsModule.forFeature([GraphqlConfig], [GraphqlEnvironment])
|
|
61
|
+
|
|
62
|
+
GraphQLModule.forRootAsync({
|
|
63
|
+
driver: MercuriusDriver,
|
|
64
|
+
inject: [GraphqlConfig],
|
|
65
|
+
useFactory: (config: GraphqlConfig) => config.createOptions({ maxDepth: 5, resolveSupportId, schemaPath: 'src/schema.gql' }),
|
|
66
|
+
})
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
Источник `supportId` (трасса, id запроса) пакет не выбирает: резолвер передаёт приложение.
|
|
70
|
+
|
|
47
71
|
## Клиент
|
|
48
72
|
|
|
49
73
|
- `supportIdFromError`, `rejectedCharactersFromError`, `messageCodeFromError` — читатели полей `extensions` ответа
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { GraphqlConfigOptionsInterface, MercuriusPerimeterOptions } from './mercurius-options.interface.js';
|
|
2
|
+
import { GraphqlEnvironment } from './graphql.environment.js';
|
|
3
|
+
export declare class GraphqlConfig {
|
|
4
|
+
private readonly environment;
|
|
5
|
+
constructor(environment: GraphqlEnvironment);
|
|
6
|
+
createOptions(options: GraphqlConfigOptionsInterface): MercuriusPerimeterOptions;
|
|
7
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.GraphqlConfig = void 0;
|
|
16
|
+
const common_1 = require("@nestjs/common");
|
|
17
|
+
const graphql_environment_js_1 = require("./graphql.environment.js");
|
|
18
|
+
const mercurius_options_js_1 = require("./mercurius-options.js");
|
|
19
|
+
let GraphqlConfig = class GraphqlConfig {
|
|
20
|
+
environment;
|
|
21
|
+
constructor(environment) {
|
|
22
|
+
this.environment = environment;
|
|
23
|
+
}
|
|
24
|
+
createOptions(options) {
|
|
25
|
+
return (0, mercurius_options_js_1.createMercuriusOptions)({
|
|
26
|
+
...options,
|
|
27
|
+
playground: this.environment.GRAPHQL_PLAYGROUND,
|
|
28
|
+
schemaPath: this.environment.GRAPHQL_SCHEMA_PATH ?? options.schemaPath,
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
exports.GraphqlConfig = GraphqlConfig;
|
|
33
|
+
exports.GraphqlConfig = GraphqlConfig = __decorate([
|
|
34
|
+
(0, common_1.Injectable)(),
|
|
35
|
+
__param(0, (0, common_1.Inject)(graphql_environment_js_1.GraphqlEnvironment)),
|
|
36
|
+
__metadata("design:paramtypes", [graphql_environment_js_1.GraphqlEnvironment])
|
|
37
|
+
], GraphqlConfig);
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.GraphqlEnvironment = void 0;
|
|
13
|
+
const nestjs_config_module_1 = require("@libs-for-dev/nestjs-config-module");
|
|
14
|
+
const class_transformer_1 = require("class-transformer");
|
|
15
|
+
const class_validator_1 = require("class-validator");
|
|
16
|
+
class GraphqlEnvironment {
|
|
17
|
+
GRAPHQL_PLAYGROUND = false;
|
|
18
|
+
GRAPHQL_SCHEMA_PATH;
|
|
19
|
+
}
|
|
20
|
+
exports.GraphqlEnvironment = GraphqlEnvironment;
|
|
21
|
+
__decorate([
|
|
22
|
+
(0, class_transformer_1.Expose)(),
|
|
23
|
+
(0, class_validator_1.IsBoolean)(),
|
|
24
|
+
(0, nestjs_config_module_1.ParseBoolean)(),
|
|
25
|
+
__metadata("design:type", Object)
|
|
26
|
+
], GraphqlEnvironment.prototype, "GRAPHQL_PLAYGROUND", void 0);
|
|
27
|
+
__decorate([
|
|
28
|
+
(0, class_transformer_1.Expose)(),
|
|
29
|
+
(0, class_validator_1.IsOptional)(),
|
|
30
|
+
(0, class_validator_1.IsString)(),
|
|
31
|
+
__metadata("design:type", String)
|
|
32
|
+
], GraphqlEnvironment.prototype, "GRAPHQL_SCHEMA_PATH", void 0);
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./graphql.config.js"), exports);
|
|
18
|
+
__exportStar(require("./graphql.environment.js"), exports);
|
|
19
|
+
__exportStar(require("./mercurius-options.js"), exports);
|
|
20
|
+
__exportStar(require("./mercurius-options.interface.js"), exports);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { MercuriusDriverConfig } from '@nestjs/mercurius';
|
|
2
|
+
import type { MercuriusContext } from 'mercurius';
|
|
3
|
+
export type GraphqlConfigOptionsInterface = Omit<MercuriusOptionsInterface, 'playground'>;
|
|
4
|
+
export interface MercuriusOptionsInterface {
|
|
5
|
+
readonly maxDepth: number;
|
|
6
|
+
readonly playground: boolean;
|
|
7
|
+
readonly resolveSupportId: SupportIdResolver;
|
|
8
|
+
readonly schemaPath: string;
|
|
9
|
+
}
|
|
10
|
+
export type MercuriusPerimeterOptions = Required<Pick<MercuriusDriverConfig, 'autoSchemaFile' | 'errorFormatter' | 'graphiql' | 'queryDepth' | 'sortSchema' | 'validationRules'>>;
|
|
11
|
+
export type SupportIdResolver = (request: MercuriusContext['reply']['request']) => string;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.createMercuriusOptions = void 0;
|
|
7
|
+
const graphql_1 = require("graphql");
|
|
8
|
+
const mercurius_1 = __importDefault(require("mercurius"));
|
|
9
|
+
const format_graphql_error_js_1 = require("../errors/format-graphql-error.js");
|
|
10
|
+
const createMercuriusOptions = ({ maxDepth, playground, resolveSupportId, schemaPath, }) => ({
|
|
11
|
+
autoSchemaFile: schemaPath || true,
|
|
12
|
+
errorFormatter: (execution, context) => {
|
|
13
|
+
const supportId = resolveSupportId(context.reply.request);
|
|
14
|
+
const errors = execution.errors.map((gqlError) => (0, format_graphql_error_js_1.formatGraphQLError)(gqlError, supportId));
|
|
15
|
+
return mercurius_1.default.defaultErrorFormatter({ ...execution, errors }, context);
|
|
16
|
+
},
|
|
17
|
+
graphiql: playground,
|
|
18
|
+
queryDepth: maxDepth,
|
|
19
|
+
sortSchema: true,
|
|
20
|
+
validationRules: playground ? [] : [graphql_1.NoSchemaIntrospectionCustomRule],
|
|
21
|
+
});
|
|
22
|
+
exports.createMercuriusOptions = createMercuriusOptions;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { GraphqlConfigOptionsInterface, MercuriusPerimeterOptions } from './mercurius-options.interface.js';
|
|
2
|
+
import { GraphqlEnvironment } from './graphql.environment.js';
|
|
3
|
+
export declare class GraphqlConfig {
|
|
4
|
+
private readonly environment;
|
|
5
|
+
constructor(environment: GraphqlEnvironment);
|
|
6
|
+
createOptions(options: GraphqlConfigOptionsInterface): MercuriusPerimeterOptions;
|
|
7
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
+
};
|
|
10
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
11
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
12
|
+
};
|
|
13
|
+
import { Inject, Injectable } from '@nestjs/common';
|
|
14
|
+
import { GraphqlEnvironment } from './graphql.environment.js';
|
|
15
|
+
import { createMercuriusOptions } from './mercurius-options.js';
|
|
16
|
+
let GraphqlConfig = class GraphqlConfig {
|
|
17
|
+
environment;
|
|
18
|
+
constructor(environment) {
|
|
19
|
+
this.environment = environment;
|
|
20
|
+
}
|
|
21
|
+
createOptions(options) {
|
|
22
|
+
return createMercuriusOptions({
|
|
23
|
+
...options,
|
|
24
|
+
playground: this.environment.GRAPHQL_PLAYGROUND,
|
|
25
|
+
schemaPath: this.environment.GRAPHQL_SCHEMA_PATH ?? options.schemaPath,
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
GraphqlConfig = __decorate([
|
|
30
|
+
Injectable(),
|
|
31
|
+
__param(0, Inject(GraphqlEnvironment)),
|
|
32
|
+
__metadata("design:paramtypes", [GraphqlEnvironment])
|
|
33
|
+
], GraphqlConfig);
|
|
34
|
+
export { GraphqlConfig };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
+
};
|
|
10
|
+
import { ParseBoolean } from '@libs-for-dev/nestjs-config-module';
|
|
11
|
+
import { Expose } from 'class-transformer';
|
|
12
|
+
import { IsBoolean, IsOptional, IsString } from 'class-validator';
|
|
13
|
+
export class GraphqlEnvironment {
|
|
14
|
+
GRAPHQL_PLAYGROUND = false;
|
|
15
|
+
GRAPHQL_SCHEMA_PATH;
|
|
16
|
+
}
|
|
17
|
+
__decorate([
|
|
18
|
+
Expose(),
|
|
19
|
+
IsBoolean(),
|
|
20
|
+
ParseBoolean(),
|
|
21
|
+
__metadata("design:type", Object)
|
|
22
|
+
], GraphqlEnvironment.prototype, "GRAPHQL_PLAYGROUND", void 0);
|
|
23
|
+
__decorate([
|
|
24
|
+
Expose(),
|
|
25
|
+
IsOptional(),
|
|
26
|
+
IsString(),
|
|
27
|
+
__metadata("design:type", String)
|
|
28
|
+
], GraphqlEnvironment.prototype, "GRAPHQL_SCHEMA_PATH", void 0);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { MercuriusDriverConfig } from '@nestjs/mercurius';
|
|
2
|
+
import type { MercuriusContext } from 'mercurius';
|
|
3
|
+
export type GraphqlConfigOptionsInterface = Omit<MercuriusOptionsInterface, 'playground'>;
|
|
4
|
+
export interface MercuriusOptionsInterface {
|
|
5
|
+
readonly maxDepth: number;
|
|
6
|
+
readonly playground: boolean;
|
|
7
|
+
readonly resolveSupportId: SupportIdResolver;
|
|
8
|
+
readonly schemaPath: string;
|
|
9
|
+
}
|
|
10
|
+
export type MercuriusPerimeterOptions = Required<Pick<MercuriusDriverConfig, 'autoSchemaFile' | 'errorFormatter' | 'graphiql' | 'queryDepth' | 'sortSchema' | 'validationRules'>>;
|
|
11
|
+
export type SupportIdResolver = (request: MercuriusContext['reply']['request']) => string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { NoSchemaIntrospectionCustomRule } from 'graphql';
|
|
2
|
+
import mercurius from 'mercurius';
|
|
3
|
+
import { formatGraphQLError } from '../errors/format-graphql-error.js';
|
|
4
|
+
export const createMercuriusOptions = ({ maxDepth, playground, resolveSupportId, schemaPath, }) => ({
|
|
5
|
+
autoSchemaFile: schemaPath || true,
|
|
6
|
+
errorFormatter: (execution, context) => {
|
|
7
|
+
const supportId = resolveSupportId(context.reply.request);
|
|
8
|
+
const errors = execution.errors.map((gqlError) => formatGraphQLError(gqlError, supportId));
|
|
9
|
+
return mercurius.defaultErrorFormatter({ ...execution, errors }, context);
|
|
10
|
+
},
|
|
11
|
+
graphiql: playground,
|
|
12
|
+
queryDepth: maxDepth,
|
|
13
|
+
sortSchema: true,
|
|
14
|
+
validationRules: playground ? [] : [NoSchemaIntrospectionCustomRule],
|
|
15
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@application-kit/graphql",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "Контракт ошибок GraphQL (сервер и клиент) и типы курсорного листинга для NestJS",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"apollo",
|
|
@@ -45,6 +45,16 @@
|
|
|
45
45
|
"default": "./dist/cjs/client/index.js"
|
|
46
46
|
}
|
|
47
47
|
},
|
|
48
|
+
"./nest": {
|
|
49
|
+
"import": {
|
|
50
|
+
"types": "./dist/esm/nest/index.d.ts",
|
|
51
|
+
"default": "./dist/esm/nest/index.js"
|
|
52
|
+
},
|
|
53
|
+
"require": {
|
|
54
|
+
"types": "./dist/cjs/nest/index.d.ts",
|
|
55
|
+
"default": "./dist/cjs/nest/index.js"
|
|
56
|
+
}
|
|
57
|
+
},
|
|
48
58
|
"./package.json": "./package.json"
|
|
49
59
|
},
|
|
50
60
|
"main": "./dist/cjs/index.js",
|
|
@@ -54,7 +64,7 @@
|
|
|
54
64
|
"dist"
|
|
55
65
|
],
|
|
56
66
|
"scripts": {
|
|
57
|
-
"build": "rm -rf ./dist && node ../../scripts/barrels.mjs create ./src --entry-only=client && tsc --project tsconfig.build.json && tsc --project tsconfig.build.cjs.json && node ../../scripts/barrels.mjs clean ./src && node ../../scripts/mark-cjs.mjs ./dist/cjs",
|
|
67
|
+
"build": "rm -rf ./dist && node ../../scripts/barrels.mjs create ./src --entry-only=client,nest && tsc --project tsconfig.build.json && tsc --project tsconfig.build.cjs.json && node ../../scripts/barrels.mjs clean ./src && node ../../scripts/mark-cjs.mjs ./dist/cjs",
|
|
58
68
|
"lint:tsc": "tsc --noEmit --pretty --project .",
|
|
59
69
|
"test:mutation": "stryker run",
|
|
60
70
|
"test:unit": "vitest run"
|
|
@@ -64,26 +74,44 @@
|
|
|
64
74
|
},
|
|
65
75
|
"devDependencies": {
|
|
66
76
|
"@apollo/client": "^4.2.12",
|
|
77
|
+
"@libs-for-dev/nestjs-config-module": "3.0.0",
|
|
67
78
|
"@nestjs/common": "^11.2.7",
|
|
68
79
|
"@nestjs/core": "^11.2.7",
|
|
69
80
|
"@nestjs/graphql": "^13.4.5",
|
|
81
|
+
"@nestjs/mercurius": "^13.4.5",
|
|
70
82
|
"@stryker-mutator/core": "^10.0.0",
|
|
71
83
|
"@stryker-mutator/vitest-runner": "^10.0.0",
|
|
72
84
|
"@types/node": "^26.2.0",
|
|
73
85
|
"class-transformer": "^0.5.1",
|
|
74
86
|
"class-validator": "^0.15.1",
|
|
87
|
+
"fastify": "^5.12.5",
|
|
75
88
|
"graphql": "^16.14.2",
|
|
89
|
+
"mercurius": "^16.10.0",
|
|
76
90
|
"reflect-metadata": "^0.2.2",
|
|
77
91
|
"typescript": "^6.0.3",
|
|
78
92
|
"vitest": "^4.1.11"
|
|
79
93
|
},
|
|
80
94
|
"peerDependencies": {
|
|
81
95
|
"@apollo/client": "^4.0.0",
|
|
96
|
+
"@libs-for-dev/nestjs-config-module": "^3.0.0",
|
|
82
97
|
"@nestjs/common": "^11.0.0",
|
|
83
98
|
"@nestjs/graphql": "^13.0.0",
|
|
99
|
+
"@nestjs/mercurius": "^13.0.0",
|
|
84
100
|
"class-transformer": "^0.5.1",
|
|
85
101
|
"class-validator": "^0.15.0",
|
|
86
|
-
"graphql": "^16.0.0"
|
|
102
|
+
"graphql": "^16.0.0",
|
|
103
|
+
"mercurius": "^16.0.0"
|
|
104
|
+
},
|
|
105
|
+
"peerDependenciesMeta": {
|
|
106
|
+
"@libs-for-dev/nestjs-config-module": {
|
|
107
|
+
"optional": true
|
|
108
|
+
},
|
|
109
|
+
"@nestjs/mercurius": {
|
|
110
|
+
"optional": true
|
|
111
|
+
},
|
|
112
|
+
"mercurius": {
|
|
113
|
+
"optional": true
|
|
114
|
+
}
|
|
87
115
|
},
|
|
88
116
|
"engines": {
|
|
89
117
|
"node": ">=24"
|