@tinkerstack/graphql-annotation 0.0.1 → 0.0.2
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/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @tinkerstack/graphql-annotation@0.0.
|
|
2
|
+
> @tinkerstack/graphql-annotation@0.0.2 build C:\Users\mori\Documents\Work\tinkerstack\packages\graphql-annotation
|
|
3
3
|
> tsup
|
|
4
4
|
|
|
5
5
|
[34mCLI[39m Building entry: src/index.ts
|
|
@@ -10,11 +10,11 @@
|
|
|
10
10
|
[34mCLI[39m Cleaning output folder
|
|
11
11
|
[34mESM[39m Build start
|
|
12
12
|
[34mCJS[39m Build start
|
|
13
|
-
[32mCJS[39m [1mdist\index.js [22m[32m21.
|
|
14
|
-
[32mCJS[39m ⚡️ Build success in
|
|
15
|
-
[32mESM[39m [1mdist\index.mjs [22m[32m19.
|
|
16
|
-
[32mESM[39m ⚡️ Build success in
|
|
13
|
+
[32mCJS[39m [1mdist\index.js [22m[32m21.17 KB[39m
|
|
14
|
+
[32mCJS[39m ⚡️ Build success in 645ms
|
|
15
|
+
[32mESM[39m [1mdist\index.mjs [22m[32m19.24 KB[39m
|
|
16
|
+
[32mESM[39m ⚡️ Build success in 646ms
|
|
17
17
|
[34mDTS[39m Build start
|
|
18
|
-
[32mDTS[39m ⚡️ Build success in
|
|
18
|
+
[32mDTS[39m ⚡️ Build success in 2927ms
|
|
19
19
|
[32mDTS[39m [1mdist\index.d.mts [22m[32m2.89 KB[39m
|
|
20
20
|
[32mDTS[39m [1mdist\index.d.ts [22m[32m2.89 KB[39m
|
package/dist/index.js
CHANGED
|
@@ -67,7 +67,11 @@ function Annotate(name, opts) {
|
|
|
67
67
|
const paramIndex = descriptorOrParameterIndex;
|
|
68
68
|
const paramName = opts?.parameter;
|
|
69
69
|
if (!paramName) throw new Error(`Unable to apply annotation "${annotationName}". Parameter name not specified.`);
|
|
70
|
-
(0, import_graphql.Args)(
|
|
70
|
+
(0, import_graphql.Args)({
|
|
71
|
+
name: paramName,
|
|
72
|
+
type: opts?.type,
|
|
73
|
+
description: opts?.description
|
|
74
|
+
})(target, propertyKey, paramIndex);
|
|
71
75
|
_updateAnnotation(target.constructor, (meta) => ({
|
|
72
76
|
...meta,
|
|
73
77
|
[`${annotationName}@${paramIndex}`]: {
|
package/dist/index.mjs
CHANGED
|
@@ -38,7 +38,11 @@ function Annotate(name, opts) {
|
|
|
38
38
|
const paramIndex = descriptorOrParameterIndex;
|
|
39
39
|
const paramName = opts?.parameter;
|
|
40
40
|
if (!paramName) throw new Error(`Unable to apply annotation "${annotationName}". Parameter name not specified.`);
|
|
41
|
-
Args(
|
|
41
|
+
Args({
|
|
42
|
+
name: paramName,
|
|
43
|
+
type: opts?.type,
|
|
44
|
+
description: opts?.description
|
|
45
|
+
})(target, propertyKey, paramIndex);
|
|
42
46
|
_updateAnnotation(target.constructor, (meta) => ({
|
|
43
47
|
...meta,
|
|
44
48
|
[`${annotationName}@${paramIndex}`]: {
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SetMetadata } from "@nestjs/common";
|
|
2
|
-
import { Args } from "@nestjs/graphql";
|
|
2
|
+
import { Args, ArgsOptions } from "@nestjs/graphql";
|
|
3
3
|
import "reflect-metadata";
|
|
4
4
|
import {
|
|
5
5
|
ANNOTATION_METADATA,
|
|
@@ -42,7 +42,12 @@ export function Annotate(
|
|
|
42
42
|
*/
|
|
43
43
|
export function Annotate(
|
|
44
44
|
name: string,
|
|
45
|
-
opts?: {
|
|
45
|
+
opts?: {
|
|
46
|
+
data?: Record<string, any>;
|
|
47
|
+
parameter?: string;
|
|
48
|
+
description?: string;
|
|
49
|
+
type?: () => any;
|
|
50
|
+
},
|
|
46
51
|
): MethodDecorator & ParameterDecorator {
|
|
47
52
|
const annotationName = name;
|
|
48
53
|
const annotationData = opts?.data;
|
|
@@ -79,7 +84,11 @@ export function Annotate(
|
|
|
79
84
|
`Unable to apply annotation "${annotationName}". Parameter name not specified.`,
|
|
80
85
|
);
|
|
81
86
|
|
|
82
|
-
Args(
|
|
87
|
+
Args({
|
|
88
|
+
name: paramName,
|
|
89
|
+
type: opts?.type,
|
|
90
|
+
description: opts?.description,
|
|
91
|
+
})(target, propertyKey, paramIndex);
|
|
83
92
|
_updateAnnotation(
|
|
84
93
|
target.constructor,
|
|
85
94
|
(meta) => ({
|