type-graphql 2.0.0-rc.2 → 2.0.0-rc.4
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/LICENSE +1 -1
- package/README.md +19 -13
- package/build/cjs/decorators/Arg.js +1 -2
- package/build/cjs/decorators/Args.js +1 -2
- package/build/cjs/decorators/ArgsType.js +1 -2
- package/build/cjs/decorators/Authorized.js +1 -2
- package/build/cjs/decorators/Ctx.js +1 -2
- package/build/cjs/decorators/Directive.js +1 -2
- package/build/cjs/decorators/Extensions.js +1 -2
- package/build/cjs/decorators/Field.js +1 -2
- package/build/cjs/decorators/FieldResolver.js +1 -2
- package/build/cjs/decorators/Info.js +1 -2
- package/build/cjs/decorators/InputType.js +1 -2
- package/build/cjs/decorators/InterfaceType.js +1 -2
- package/build/cjs/decorators/Mutation.js +1 -2
- package/build/cjs/decorators/ObjectType.js +1 -2
- package/build/cjs/decorators/Query.js +1 -2
- package/build/cjs/decorators/Resolver.js +1 -2
- package/build/cjs/decorators/Root.js +1 -2
- package/build/cjs/decorators/Subscription.js +1 -2
- package/build/cjs/decorators/UseMiddleware.js +1 -2
- package/build/cjs/decorators/createMethodMiddlewareDecorator.js +1 -2
- package/build/cjs/decorators/createParameterDecorator.js +1 -2
- package/build/cjs/decorators/createResolverClassMiddlewareDecorator.js +1 -2
- package/build/cjs/decorators/enums.js +1 -2
- package/build/cjs/decorators/unions.js +1 -2
- package/build/cjs/helpers/auth-middleware.js +1 -2
- package/build/cjs/helpers/decorators.js +3 -4
- package/build/cjs/helpers/filesystem.js +2 -3
- package/build/cjs/helpers/findType.js +1 -2
- package/build/cjs/helpers/isThrowing.js +1 -2
- package/build/cjs/helpers/params.js +1 -2
- package/build/cjs/helpers/resolver-metadata.js +1 -2
- package/build/cjs/helpers/types.js +11 -6
- package/build/cjs/metadata/getMetadataStorage.js +1 -2
- package/build/cjs/metadata/metadata-storage.js +192 -28
- package/build/cjs/metadata/utils.js +4 -5
- package/build/cjs/resolvers/convert-args.js +2 -3
- package/build/cjs/resolvers/create.js +4 -5
- package/build/cjs/resolvers/helpers.js +3 -4
- package/build/cjs/resolvers/validate-arg.js +1 -2
- package/build/cjs/schema/definition-node.js +6 -7
- package/build/cjs/schema/schema-generator.js +51 -41
- package/build/cjs/schema/utils.js +2 -3
- package/build/cjs/shim.js +3 -3
- package/build/cjs/utils/buildSchema.js +2 -3
- package/build/cjs/utils/buildTypeDefsAndResolvers.js +2 -3
- package/build/cjs/utils/createResolversMap.js +1 -2
- package/build/cjs/utils/emitSchemaDefinitionFile.js +3 -3
- package/build/cjs/utils/graphql-version.js +3 -3
- package/build/cjs/utils/isPromiseLike.js +1 -2
- package/build/esm/helpers/types.js +7 -1
- package/build/esm/metadata/metadata-storage.js +192 -28
- package/build/esm/schema/schema-generator.js +51 -41
- package/build/esm/utils/graphql-version.js +1 -1
- package/build/typings/metadata/metadata-storage.d.ts +14 -0
- package/build/typings/schema/schema-generator.d.ts +5 -5
- package/build/typings/utils/graphql-version.d.ts +1 -1
- package/package.json +65 -65
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<!-- prettier-ignore-start -->
|
|
2
2
|
<!-- markdownlint-disable-next-line MD041 -->
|
|
3
|
-

|
|
4
4
|
<!-- prettier-ignore-end -->
|
|
5
5
|
|
|
6
6
|
# TypeGraphQL
|
|
@@ -139,9 +139,9 @@ If you prefer video tutorials, you can watch [Ben Awad](https://github.com/benaw
|
|
|
139
139
|
|
|
140
140
|
### Examples
|
|
141
141
|
|
|
142
|
-
You can also check the [examples folder](https://github.com/MichalLytek/type-graphql/tree/v2.0.0-rc.
|
|
142
|
+
You can also check the [examples folder](https://github.com/MichalLytek/type-graphql/tree/v2.0.0-rc.4/examples) in this repository for more examples of usage: simple fields resolvers, DI Container support, TypeORM integration, automatic validation, etc.
|
|
143
143
|
|
|
144
|
-
The [Tests folder](https://github.com/MichalLytek/type-graphql/tree/v2.0.0-rc.
|
|
144
|
+
The [Tests folder](https://github.com/MichalLytek/type-graphql/tree/v2.0.0-rc.4/tests) might also give you some tips on how to get various things done.
|
|
145
145
|
|
|
146
146
|
## Security contact information
|
|
147
147
|
|
|
@@ -171,19 +171,25 @@ It doesn't have a large company that sits behind it - its ongoing development is
|
|
|
171
171
|
|
|
172
172
|
### Silver Sponsors 🥈
|
|
173
173
|
|
|
174
|
-
|
|
174
|
+
<!-- markdownlint-disable MD033 -->
|
|
175
|
+
|
|
176
|
+
| [<img src="https://raw.githubusercontent.com/MichalLytek/type-graphql/v2.0.0-rc.4/images/leofame.png" width="250" alt="Leofame" />](https://leofame.com/buy-instagram-followers) |
|
|
177
|
+
| :---------------------------------------------------------------------------------------------------------: |
|
|
178
|
+
| [**Leofame**](https://leofame.com/buy-instagram-followers) |
|
|
175
179
|
|
|
176
180
|
### Bronze Sponsors 🥉
|
|
177
181
|
|
|
178
|
-
|
|
182
|
+
| [<img src="https://raw.githubusercontent.com/MichalLytek/type-graphql/v2.0.0-rc.4/images/live-graphics-system.png" width="55" alt="live graphic systems" />](https://www.ligrsystems.com) | [<img src="https://raw.githubusercontent.com/MichalLytek/type-graphql/v2.0.0-rc.4/images/felix.png" width="60" alt="Felix Technologies" />](https://github.com/joinlifex) | [<img src="https://raw.githubusercontent.com/MichalLytek/type-graphql/v2.0.0-rc.4/images/instinctools.svg" width="100" alt="instinctools" />](https://instinctools.com/manufacturing) |
|
|
183
|
+
| :------------------------------------------------------------------------------------------------------------------: | :--------------------------------------------------------------------------------------------------: | :--------------------------------------------------------------------------------------------------------------: |
|
|
184
|
+
| [**Live Graphic Systems**](https://www.ligrsystems.com) | [**Felix Technologies**](https://github.com/joinlifex/) | [**instinctools**](https://instinctools.com/manufacturing) |
|
|
179
185
|
|
|
180
|
-
| [<img src="https://raw.githubusercontent.com/MichalLytek/type-graphql/v2.0.0-rc.
|
|
181
|
-
|
|
|
182
|
-
|
|
|
186
|
+
| [<img src="https://raw.githubusercontent.com/MichalLytek/type-graphql/v2.0.0-rc.4/images/betwinner.svg" width="100" alt="BetWinner" />](https://guidebook.betwinner.com/) | [<img src="https://raw.githubusercontent.com/MichalLytek/type-graphql/v2.0.0-rc.4/images/logo-buzzv.png" width="70" alt="BuzzVoice" />](https://buzzvoice.com/) | [<img src="https://raw.githubusercontent.com/MichalLytek/type-graphql/v2.0.0-rc.4/images/socialwick-logo.png" width="60" alt="SocialWick" />](https://www.socialwick.com/) | [<img src="https://raw.githubusercontent.com/MichalLytek/type-graphql/v2.0.0-rc.4/images/c19.png" width="40" alt="C19" />](https://www.c19.cl/) | [<img src="https://raw.githubusercontent.com/MichalLytek/type-graphql/v2.0.0-rc.4/images/nove_casino.svg" width="70" alt="Nove Casino" />](https://novecasino.net/) | [<img src="https://raw.githubusercontent.com/MichalLytek/type-graphql/v2.0.0-rc.4/images/play_fortune.png" width="80" alt="Play Fortune" />](https://play-fortune.pl/gry-online/jednoreki-bandyta/) | [<img src="https://raw.githubusercontent.com/MichalLytek/type-graphql/v2.0.0-rc.4/images/moonkasyno.png" width="60" alt="MoonKasyno" />](https://wechoosethemoon.org/kasyna-online/) | [<img src="https://raw.githubusercontent.com/MichalLytek/type-graphql/v2.0.0-rc.4/images/kasyno-online.png" width="50" alt="Kasyno Online" />](https://www.casinobillions.com/pl/) | [<img src="https://raw.githubusercontent.com/MichalLytek/type-graphql/v2.0.0-rc.4/images/fbpostlikes.webp" width="90" alt="FBPostLikes" />](https://www.fbpostlikes.com/) |
|
|
187
|
+
| :--------------------------------------------------------------------------------------------------: | :----------------------------------------------------------------------------------------: | :---------------------------------------------------------------------------------------------------: | :------------------------------------------------------------------------: | :--------------------------------------------------------------------------------------------: | :----------------------------------------------------------------------------------------------------------------------------: | :-------------------------------------------------------------------------------------------------------------: | :-----------------------------------------------------------------------------------------------------------: | :--------------------------------------------------------------------------------------------------: |
|
|
188
|
+
| [**BetWinner**](https://guidebook.betwinner.com/) | [**BuzzVoice**](https://buzzvoice.com/) | [**SocialWick**](https://www.socialwick.com/) | [**C19**](https://www.c19.cl/) | [**Nove Casino**](https://novecasino.net/) | [**Play Fortune**](https://play-fortune.pl/gry-online/jednoreki-bandyta/) | [**MoonKasyno**](https://wechoosethemoon.org/kasyna-online/) | [**Kasyno Online**](https://www.casinobillions.com/pl/) | [**FBPostLikes**](https://www.fbpostlikes.com/) |
|
|
183
189
|
|
|
184
|
-
| [<img src="https://raw.githubusercontent.com/MichalLytek/type-graphql/v2.0.0-rc.
|
|
185
|
-
|
|
|
186
|
-
|
|
|
190
|
+
| [<img src="https://raw.githubusercontent.com/MichalLytek/type-graphql/v2.0.0-rc.4/images/sidesmedia.png" width="40" alt="SidesMedia" />](https://sidesmedia.com/) | [<img src="https://raw.githubusercontent.com/MichalLytek/type-graphql/v2.0.0-rc.4/images/social_followers.png" width="60" alt="Social Followers" />](https://www.socialfollowers.uk/buy-tiktok-followers/) | [<img src="https://raw.githubusercontent.com/MichalLytek/type-graphql/v2.0.0-rc.4/images/ig-comment.png" width="80" alt="IG Comment" />](https://igcomment.com/buy-instagram-comments/) | [<img src="https://raw.githubusercontent.com/MichalLytek/type-graphql/v2.0.0-rc.4/images/twicsy.svg" width="100" alt="Twicsy" />](https://twicsy.com/buy-instagram-followers) | [<img src="https://raw.githubusercontent.com/MichalLytek/type-graphql/v2.0.0-rc.4/images/buzzoid.svg" width="90" alt="Buzzoid" />](https://buzzoid.com/buy-instagram-followers/) | [<img src="https://raw.githubusercontent.com/MichalLytek/type-graphql/v2.0.0-rc.4/images/v4u.png" width="80" alt="Views4You" />](https://views4you.com/) | [<img src="https://raw.githubusercontent.com/MichalLytek/type-graphql/v2.0.0-rc.4/images/payid_pookies.avif" width="50" alt="PayID Pokies" />](https://au.trustpilot.com/review/bestpayidpokies.net) | [<img src="https://raw.githubusercontent.com/MichalLytek/type-graphql/v2.0.0-rc.4/images/fun88.png" width="40" alt="Fun88" />](https://global.fun88.com/) |
|
|
191
|
+
| :------------------------------------------------------------------------------------------: | :-----------------------------------------------------------------------------------------------------------------------------------: | :----------------------------------------------------------------------------------------------------------------: | :------------------------------------------------------------------------------------------------------: | :---------------------------------------------------------------------------------------------------------: | :---------------------------------------------------------------------------------: | :-----------------------------------------------------------------------------------------------------------------------------: | :----------------------------------------------------------------------------------: |
|
|
192
|
+
| [**SidesMedia**](https://sidesmedia.com/) | [**Social Followers**](https://www.socialfollowers.uk/buy-tiktok-followers/) | [**IG Comment**](https://igcomment.com/buy-instagram-comments/) | [**Twicsy**](https://twicsy.com/buy-instagram-followers) | [**Buzzoid**](https://buzzoid.com/buy-instagram-followers/) | [**Views4You**](https://views4you.com/) | [**PayID Pokies**](https://au.trustpilot.com/review/bestpayidpokies.net) | [**Fun88**](https://global.fun88.com/) |
|
|
187
193
|
|
|
188
194
|
<!-- markdownlint-enable MD033 -->
|
|
189
195
|
|
|
@@ -195,7 +201,7 @@ It doesn't have a large company that sits behind it - its ongoing development is
|
|
|
195
201
|
|
|
196
202
|
### GitHub Sponsors
|
|
197
203
|
|
|
198
|
-
[](https://github.com/sponsors/TypeGraphQL)
|
|
199
205
|
|
|
200
206
|
## Community
|
|
201
207
|
|
|
@@ -205,4 +211,4 @@ It doesn't have a large company that sits behind it - its ongoing development is
|
|
|
205
211
|
## Want to help?
|
|
206
212
|
|
|
207
213
|
Want to file a bug, contribute some code, or improve the documentation? Great! Please read our
|
|
208
|
-
guidelines for [CONTRIBUTING](https://github.com/MichalLytek/type-graphql/tree/v2.0.0-rc.
|
|
214
|
+
guidelines for [CONTRIBUTING](https://github.com/MichalLytek/type-graphql/tree/v2.0.0-rc.4/CONTRIBUTING.md) and then check out one of our [help-wanted issues](https://github.com/MichalLytek/type-graphql/labels/Help%20Wanted%20%3Asos%3A).
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Arg =
|
|
3
|
+
exports.Arg = Arg;
|
|
4
4
|
const decorators_1 = require("../helpers/decorators");
|
|
5
5
|
const params_1 = require("../helpers/params");
|
|
6
6
|
const getMetadataStorage_1 = require("../metadata/getMetadataStorage");
|
|
@@ -23,4 +23,3 @@ function Arg(name, returnTypeFuncOrOptions, maybeOptions) {
|
|
|
23
23
|
});
|
|
24
24
|
};
|
|
25
25
|
}
|
|
26
|
-
exports.Arg = Arg;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Args =
|
|
3
|
+
exports.Args = Args;
|
|
4
4
|
const decorators_1 = require("../helpers/decorators");
|
|
5
5
|
const params_1 = require("../helpers/params");
|
|
6
6
|
const getMetadataStorage_1 = require("../metadata/getMetadataStorage");
|
|
@@ -13,4 +13,3 @@ function Args(paramTypeFnOrOptions, maybeOptions) {
|
|
|
13
13
|
});
|
|
14
14
|
};
|
|
15
15
|
}
|
|
16
|
-
exports.Args = Args;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ArgsType =
|
|
3
|
+
exports.ArgsType = ArgsType;
|
|
4
4
|
const getMetadataStorage_1 = require("../metadata/getMetadataStorage");
|
|
5
5
|
function ArgsType() {
|
|
6
6
|
return target => {
|
|
@@ -10,4 +10,3 @@ function ArgsType() {
|
|
|
10
10
|
});
|
|
11
11
|
};
|
|
12
12
|
}
|
|
13
|
-
exports.ArgsType = ArgsType;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Authorized =
|
|
3
|
+
exports.Authorized = Authorized;
|
|
4
4
|
const errors_1 = require("../errors");
|
|
5
5
|
const decorators_1 = require("../helpers/decorators");
|
|
6
6
|
const getMetadataStorage_1 = require("../metadata/getMetadataStorage");
|
|
@@ -24,4 +24,3 @@ function Authorized(...rolesOrRolesArray) {
|
|
|
24
24
|
});
|
|
25
25
|
};
|
|
26
26
|
}
|
|
27
|
-
exports.Authorized = Authorized;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Ctx =
|
|
3
|
+
exports.Ctx = Ctx;
|
|
4
4
|
const errors_1 = require("../errors");
|
|
5
5
|
const getMetadataStorage_1 = require("../metadata/getMetadataStorage");
|
|
6
6
|
function Ctx(propertyName) {
|
|
@@ -17,4 +17,3 @@ function Ctx(propertyName) {
|
|
|
17
17
|
});
|
|
18
18
|
};
|
|
19
19
|
}
|
|
20
|
-
exports.Ctx = Ctx;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Directive =
|
|
3
|
+
exports.Directive = Directive;
|
|
4
4
|
const errors_1 = require("../errors");
|
|
5
5
|
const getMetadataStorage_1 = require("../metadata/getMetadataStorage");
|
|
6
6
|
function Directive(nameOrDefinition) {
|
|
@@ -34,4 +34,3 @@ function Directive(nameOrDefinition) {
|
|
|
34
34
|
}
|
|
35
35
|
};
|
|
36
36
|
}
|
|
37
|
-
exports.Directive = Directive;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Extensions =
|
|
3
|
+
exports.Extensions = Extensions;
|
|
4
4
|
const errors_1 = require("../errors");
|
|
5
5
|
const getMetadataStorage_1 = require("../metadata/getMetadataStorage");
|
|
6
6
|
function Extensions(extensions) {
|
|
@@ -23,4 +23,3 @@ function Extensions(extensions) {
|
|
|
23
23
|
}
|
|
24
24
|
};
|
|
25
25
|
}
|
|
26
|
-
exports.Extensions = Extensions;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Field =
|
|
3
|
+
exports.Field = Field;
|
|
4
4
|
const errors_1 = require("../errors");
|
|
5
5
|
const decorators_1 = require("../helpers/decorators");
|
|
6
6
|
const findType_1 = require("../helpers/findType");
|
|
@@ -42,4 +42,3 @@ function Field(returnTypeFuncOrOptions, maybeOptions) {
|
|
|
42
42
|
}
|
|
43
43
|
};
|
|
44
44
|
}
|
|
45
|
-
exports.Field = Field;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.FieldResolver =
|
|
3
|
+
exports.FieldResolver = FieldResolver;
|
|
4
4
|
const errors_1 = require("../errors");
|
|
5
5
|
const decorators_1 = require("../helpers/decorators");
|
|
6
6
|
const findType_1 = require("../helpers/findType");
|
|
@@ -39,4 +39,3 @@ function FieldResolver(returnTypeFuncOrOptions, maybeOptions) {
|
|
|
39
39
|
});
|
|
40
40
|
};
|
|
41
41
|
}
|
|
42
|
-
exports.FieldResolver = FieldResolver;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Info =
|
|
3
|
+
exports.Info = Info;
|
|
4
4
|
const errors_1 = require("../errors");
|
|
5
5
|
const getMetadataStorage_1 = require("../metadata/getMetadataStorage");
|
|
6
6
|
function Info() {
|
|
@@ -16,4 +16,3 @@ function Info() {
|
|
|
16
16
|
});
|
|
17
17
|
};
|
|
18
18
|
}
|
|
19
|
-
exports.Info = Info;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.InputType =
|
|
3
|
+
exports.InputType = InputType;
|
|
4
4
|
const decorators_1 = require("../helpers/decorators");
|
|
5
5
|
const getMetadataStorage_1 = require("../metadata/getMetadataStorage");
|
|
6
6
|
function InputType(nameOrOptions, maybeOptions) {
|
|
@@ -13,4 +13,3 @@ function InputType(nameOrOptions, maybeOptions) {
|
|
|
13
13
|
});
|
|
14
14
|
};
|
|
15
15
|
}
|
|
16
|
-
exports.InputType = InputType;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.InterfaceType =
|
|
3
|
+
exports.InterfaceType = InterfaceType;
|
|
4
4
|
const decorators_1 = require("../helpers/decorators");
|
|
5
5
|
const getMetadataStorage_1 = require("../metadata/getMetadataStorage");
|
|
6
6
|
function InterfaceType(nameOrOptions, maybeOptions) {
|
|
@@ -16,4 +16,3 @@ function InterfaceType(nameOrOptions, maybeOptions) {
|
|
|
16
16
|
});
|
|
17
17
|
};
|
|
18
18
|
}
|
|
19
|
-
exports.InterfaceType = InterfaceType;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Mutation =
|
|
3
|
+
exports.Mutation = Mutation;
|
|
4
4
|
const decorators_1 = require("../helpers/decorators");
|
|
5
5
|
const resolver_metadata_1 = require("../helpers/resolver-metadata");
|
|
6
6
|
const getMetadataStorage_1 = require("../metadata/getMetadataStorage");
|
|
@@ -11,4 +11,3 @@ function Mutation(returnTypeFuncOrOptions, maybeOptions) {
|
|
|
11
11
|
(0, getMetadataStorage_1.getMetadataStorage)().collectMutationHandlerMetadata(metadata);
|
|
12
12
|
};
|
|
13
13
|
}
|
|
14
|
-
exports.Mutation = Mutation;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ObjectType =
|
|
3
|
+
exports.ObjectType = ObjectType;
|
|
4
4
|
const decorators_1 = require("../helpers/decorators");
|
|
5
5
|
const getMetadataStorage_1 = require("../metadata/getMetadataStorage");
|
|
6
6
|
function ObjectType(nameOrOptions, maybeOptions) {
|
|
@@ -16,4 +16,3 @@ function ObjectType(nameOrOptions, maybeOptions) {
|
|
|
16
16
|
});
|
|
17
17
|
};
|
|
18
18
|
}
|
|
19
|
-
exports.ObjectType = ObjectType;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Query =
|
|
3
|
+
exports.Query = Query;
|
|
4
4
|
const decorators_1 = require("../helpers/decorators");
|
|
5
5
|
const resolver_metadata_1 = require("../helpers/resolver-metadata");
|
|
6
6
|
const getMetadataStorage_1 = require("../metadata/getMetadataStorage");
|
|
@@ -11,4 +11,3 @@ function Query(returnTypeFuncOrOptions, maybeOptions) {
|
|
|
11
11
|
(0, getMetadataStorage_1.getMetadataStorage)().collectQueryHandlerMetadata(metadata);
|
|
12
12
|
};
|
|
13
13
|
}
|
|
14
|
-
exports.Query = Query;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Resolver =
|
|
3
|
+
exports.Resolver = Resolver;
|
|
4
4
|
const getMetadataStorage_1 = require("../metadata/getMetadataStorage");
|
|
5
5
|
function Resolver(objectTypeOrTypeFunc) {
|
|
6
6
|
return target => {
|
|
@@ -17,4 +17,3 @@ function Resolver(objectTypeOrTypeFunc) {
|
|
|
17
17
|
});
|
|
18
18
|
};
|
|
19
19
|
}
|
|
20
|
-
exports.Resolver = Resolver;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Root =
|
|
3
|
+
exports.Root = Root;
|
|
4
4
|
const errors_1 = require("../errors");
|
|
5
5
|
const findType_1 = require("../helpers/findType");
|
|
6
6
|
const getMetadataStorage_1 = require("../metadata/getMetadataStorage");
|
|
@@ -31,4 +31,3 @@ function Root(propertyName) {
|
|
|
31
31
|
});
|
|
32
32
|
};
|
|
33
33
|
}
|
|
34
|
-
exports.Root = Root;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Subscription =
|
|
3
|
+
exports.Subscription = Subscription;
|
|
4
4
|
const errors_1 = require("../errors");
|
|
5
5
|
const decorators_1 = require("../helpers/decorators");
|
|
6
6
|
const resolver_metadata_1 = require("../helpers/resolver-metadata");
|
|
@@ -22,4 +22,3 @@ function Subscription(returnTypeFuncOrOptions, maybeOptions) {
|
|
|
22
22
|
});
|
|
23
23
|
};
|
|
24
24
|
}
|
|
25
|
-
exports.Subscription = Subscription;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.UseMiddleware =
|
|
3
|
+
exports.UseMiddleware = UseMiddleware;
|
|
4
4
|
const errors_1 = require("../errors");
|
|
5
5
|
const decorators_1 = require("../helpers/decorators");
|
|
6
6
|
const getMetadataStorage_1 = require("../metadata/getMetadataStorage");
|
|
@@ -24,4 +24,3 @@ function UseMiddleware(...middlewaresOrMiddlewareArray) {
|
|
|
24
24
|
});
|
|
25
25
|
};
|
|
26
26
|
}
|
|
27
|
-
exports.UseMiddleware = UseMiddleware;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createMethodMiddlewareDecorator =
|
|
3
|
+
exports.createMethodMiddlewareDecorator = createMethodMiddlewareDecorator;
|
|
4
4
|
const UseMiddleware_1 = require("./UseMiddleware");
|
|
5
5
|
function createMethodMiddlewareDecorator(resolver) {
|
|
6
6
|
return (0, UseMiddleware_1.UseMiddleware)(resolver);
|
|
7
7
|
}
|
|
8
|
-
exports.createMethodMiddlewareDecorator = createMethodMiddlewareDecorator;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createParameterDecorator =
|
|
3
|
+
exports.createParameterDecorator = createParameterDecorator;
|
|
4
4
|
const errors_1 = require("../errors");
|
|
5
5
|
const getMetadataStorage_1 = require("../metadata/getMetadataStorage");
|
|
6
6
|
const params_1 = require("../helpers/params");
|
|
@@ -36,4 +36,3 @@ function createParameterDecorator(resolver, paramOptions = {}) {
|
|
|
36
36
|
});
|
|
37
37
|
};
|
|
38
38
|
}
|
|
39
|
-
exports.createParameterDecorator = createParameterDecorator;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createResolverClassMiddlewareDecorator =
|
|
3
|
+
exports.createResolverClassMiddlewareDecorator = createResolverClassMiddlewareDecorator;
|
|
4
4
|
const UseMiddleware_1 = require("./UseMiddleware");
|
|
5
5
|
function createResolverClassMiddlewareDecorator(resolver) {
|
|
6
6
|
return (0, UseMiddleware_1.UseMiddleware)(resolver);
|
|
7
7
|
}
|
|
8
|
-
exports.createResolverClassMiddlewareDecorator = createResolverClassMiddlewareDecorator;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.registerEnumType =
|
|
3
|
+
exports.registerEnumType = registerEnumType;
|
|
4
4
|
const getMetadataStorage_1 = require("../metadata/getMetadataStorage");
|
|
5
5
|
function registerEnumType(enumObj, enumConfig) {
|
|
6
6
|
(0, getMetadataStorage_1.getMetadataStorage)().collectEnumMetadata({
|
|
@@ -10,4 +10,3 @@ function registerEnumType(enumObj, enumConfig) {
|
|
|
10
10
|
valuesConfig: enumConfig.valuesConfig || {},
|
|
11
11
|
});
|
|
12
12
|
}
|
|
13
|
-
exports.registerEnumType = registerEnumType;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createUnionType =
|
|
3
|
+
exports.createUnionType = createUnionType;
|
|
4
4
|
const getMetadataStorage_1 = require("../metadata/getMetadataStorage");
|
|
5
5
|
function createUnionType({ name, description, types, resolveType, }) {
|
|
6
6
|
const unionMetadataSymbol = (0, getMetadataStorage_1.getMetadataStorage)().collectUnionMetadata({
|
|
@@ -11,4 +11,3 @@ function createUnionType({ name, description, types, resolveType, }) {
|
|
|
11
11
|
});
|
|
12
12
|
return unionMetadataSymbol;
|
|
13
13
|
}
|
|
14
|
-
exports.createUnionType = createUnionType;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.AuthMiddleware =
|
|
3
|
+
exports.AuthMiddleware = AuthMiddleware;
|
|
4
4
|
const errors_1 = require("../errors");
|
|
5
5
|
function AuthMiddleware(authChecker, container, authMode, roles) {
|
|
6
6
|
return async (action, next) => {
|
|
@@ -23,4 +23,3 @@ function AuthMiddleware(authChecker, container, authMode, roles) {
|
|
|
23
23
|
return next();
|
|
24
24
|
};
|
|
25
25
|
}
|
|
26
|
-
exports.AuthMiddleware = AuthMiddleware;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.getTypeDecoratorParams = getTypeDecoratorParams;
|
|
4
|
+
exports.getNameDecoratorParams = getNameDecoratorParams;
|
|
5
|
+
exports.getArrayFromOverloadedRest = getArrayFromOverloadedRest;
|
|
4
6
|
function getTypeDecoratorParams(returnTypeFuncOrOptions, maybeOptions) {
|
|
5
7
|
if (typeof returnTypeFuncOrOptions === "function") {
|
|
6
8
|
return {
|
|
@@ -12,7 +14,6 @@ function getTypeDecoratorParams(returnTypeFuncOrOptions, maybeOptions) {
|
|
|
12
14
|
options: returnTypeFuncOrOptions || {},
|
|
13
15
|
};
|
|
14
16
|
}
|
|
15
|
-
exports.getTypeDecoratorParams = getTypeDecoratorParams;
|
|
16
17
|
function getNameDecoratorParams(nameOrOptions, maybeOptions) {
|
|
17
18
|
if (typeof nameOrOptions === "string") {
|
|
18
19
|
return {
|
|
@@ -24,7 +25,6 @@ function getNameDecoratorParams(nameOrOptions, maybeOptions) {
|
|
|
24
25
|
options: nameOrOptions || {},
|
|
25
26
|
};
|
|
26
27
|
}
|
|
27
|
-
exports.getNameDecoratorParams = getNameDecoratorParams;
|
|
28
28
|
function getArrayFromOverloadedRest(overloadedArray) {
|
|
29
29
|
let items;
|
|
30
30
|
if (Array.isArray(overloadedArray[0])) {
|
|
@@ -35,4 +35,3 @@ function getArrayFromOverloadedRest(overloadedArray) {
|
|
|
35
35
|
}
|
|
36
36
|
return items;
|
|
37
37
|
}
|
|
38
|
-
exports.getArrayFromOverloadedRest = getArrayFromOverloadedRest;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.outputFile = outputFile;
|
|
4
|
+
exports.outputFileSync = outputFileSync;
|
|
4
5
|
const tslib_1 = require("tslib");
|
|
5
6
|
const node_fs_1 = tslib_1.__importDefault(require("node:fs"));
|
|
6
7
|
const promises_1 = tslib_1.__importDefault(require("node:fs/promises"));
|
|
@@ -17,7 +18,6 @@ async function outputFile(filePath, fileContent) {
|
|
|
17
18
|
await promises_1.default.writeFile(filePath, fileContent);
|
|
18
19
|
}
|
|
19
20
|
}
|
|
20
|
-
exports.outputFile = outputFile;
|
|
21
21
|
function outputFileSync(filePath, fileContent) {
|
|
22
22
|
try {
|
|
23
23
|
node_fs_1.default.writeFileSync(filePath, fileContent);
|
|
@@ -30,4 +30,3 @@ function outputFileSync(filePath, fileContent) {
|
|
|
30
30
|
node_fs_1.default.writeFileSync(filePath, fileContent);
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
|
-
exports.outputFileSync = outputFileSync;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.findType =
|
|
3
|
+
exports.findType = findType;
|
|
4
4
|
const errors_1 = require("../errors");
|
|
5
5
|
const utils_1 = require("../metadata/utils");
|
|
6
6
|
const returnTypes_1 = require("./returnTypes");
|
|
@@ -50,4 +50,3 @@ function findType({ metadataKey, prototype, propertyKey, parameterIndex, argName
|
|
|
50
50
|
}
|
|
51
51
|
throw new Error("Ops... this should never happen :)");
|
|
52
52
|
}
|
|
53
|
-
exports.findType = findType;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isThrowing =
|
|
3
|
+
exports.isThrowing = isThrowing;
|
|
4
4
|
function isThrowing(fn) {
|
|
5
5
|
try {
|
|
6
6
|
fn();
|
|
@@ -10,4 +10,3 @@ function isThrowing(fn) {
|
|
|
10
10
|
return true;
|
|
11
11
|
}
|
|
12
12
|
}
|
|
13
|
-
exports.isThrowing = isThrowing;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getParamInfo =
|
|
3
|
+
exports.getParamInfo = getParamInfo;
|
|
4
4
|
const errors_1 = require("../errors");
|
|
5
5
|
const findType_1 = require("./findType");
|
|
6
6
|
function getParamInfo({ prototype, propertyKey, parameterIndex, argName, returnTypeFunc, options = {}, }) {
|
|
@@ -26,4 +26,3 @@ function getParamInfo({ prototype, propertyKey, parameterIndex, argName, returnT
|
|
|
26
26
|
validateFn: options.validateFn,
|
|
27
27
|
};
|
|
28
28
|
}
|
|
29
|
-
exports.getParamInfo = getParamInfo;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getResolverMetadata =
|
|
3
|
+
exports.getResolverMetadata = getResolverMetadata;
|
|
4
4
|
const errors_1 = require("../errors");
|
|
5
5
|
const findType_1 = require("./findType");
|
|
6
6
|
function getResolverMetadata(prototype, propertyKey, returnTypeFunc, options = {}) {
|
|
@@ -26,4 +26,3 @@ function getResolverMetadata(prototype, propertyKey, returnTypeFunc, options = {
|
|
|
26
26
|
complexity: options.complexity,
|
|
27
27
|
};
|
|
28
28
|
}
|
|
29
|
-
exports.getResolverMetadata = getResolverMetadata;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.convertTypeIfScalar = convertTypeIfScalar;
|
|
4
|
+
exports.wrapWithTypeOptions = wrapWithTypeOptions;
|
|
5
|
+
exports.convertToType = convertToType;
|
|
6
|
+
exports.getEnumValuesMap = getEnumValuesMap;
|
|
4
7
|
const graphql_1 = require("graphql");
|
|
5
8
|
const errors_1 = require("../errors");
|
|
6
9
|
const scalars_1 = require("../scalars");
|
|
@@ -33,7 +36,6 @@ function convertTypeIfScalar(type) {
|
|
|
33
36
|
return undefined;
|
|
34
37
|
}
|
|
35
38
|
}
|
|
36
|
-
exports.convertTypeIfScalar = convertTypeIfScalar;
|
|
37
39
|
function wrapWithTypeOptions(target, propertyName, type, typeOptions, nullableByDefault) {
|
|
38
40
|
if (!typeOptions.array &&
|
|
39
41
|
(typeOptions.nullable === "items" || typeOptions.nullable === "itemsAndList")) {
|
|
@@ -53,7 +55,6 @@ function wrapWithTypeOptions(target, propertyName, type, typeOptions, nullableBy
|
|
|
53
55
|
}
|
|
54
56
|
return gqlType;
|
|
55
57
|
}
|
|
56
|
-
exports.wrapWithTypeOptions = wrapWithTypeOptions;
|
|
57
58
|
const simpleTypes = [String, Boolean, Number, Date, Array, Promise];
|
|
58
59
|
function convertToType(Target, data) {
|
|
59
60
|
if (data == null) {
|
|
@@ -71,9 +72,14 @@ function convertToType(Target, data) {
|
|
|
71
72
|
if (Array.isArray(data)) {
|
|
72
73
|
return data.map(item => convertToType(Target, item));
|
|
73
74
|
}
|
|
74
|
-
|
|
75
|
+
const instance = new Target();
|
|
76
|
+
for (const key of Object.keys(instance)) {
|
|
77
|
+
if (instance[key] === undefined && !(key in data)) {
|
|
78
|
+
delete instance[key];
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
return Object.assign(instance, data);
|
|
75
82
|
}
|
|
76
|
-
exports.convertToType = convertToType;
|
|
77
83
|
function getEnumValuesMap(enumObject) {
|
|
78
84
|
const enumKeys = Object.keys(enumObject).filter(key => Number.isNaN(parseInt(key, 10)));
|
|
79
85
|
const enumMap = enumKeys.reduce((map, key) => {
|
|
@@ -82,4 +88,3 @@ function getEnumValuesMap(enumObject) {
|
|
|
82
88
|
}, {});
|
|
83
89
|
return enumMap;
|
|
84
90
|
}
|
|
85
|
-
exports.getEnumValuesMap = getEnumValuesMap;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getMetadataStorage =
|
|
3
|
+
exports.getMetadataStorage = getMetadataStorage;
|
|
4
4
|
const metadata_storage_1 = require("./metadata-storage");
|
|
5
5
|
function getMetadataStorage() {
|
|
6
6
|
if (!global.TypeGraphQLMetadataStorage) {
|
|
@@ -8,4 +8,3 @@ function getMetadataStorage() {
|
|
|
8
8
|
}
|
|
9
9
|
return global.TypeGraphQLMetadataStorage;
|
|
10
10
|
}
|
|
11
|
-
exports.getMetadataStorage = getMetadataStorage;
|