type-graphql 2.0.0-beta.4 → 2.0.0-beta.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/README.md +6 -6
- package/package.json +42 -42
- package/build/cjs/decorators/Arg.js +0 -26
- package/build/cjs/decorators/Args.js +0 -16
- package/build/cjs/decorators/ArgsType.js +0 -13
- package/build/cjs/decorators/Authorized.js +0 -20
- package/build/cjs/decorators/Ctx.js +0 -20
- package/build/cjs/decorators/Directive.js +0 -37
- package/build/cjs/decorators/Extensions.js +0 -26
- package/build/cjs/decorators/Field.js +0 -45
- package/build/cjs/decorators/FieldResolver.js +0 -42
- package/build/cjs/decorators/Info.js +0 -19
- package/build/cjs/decorators/InputType.js +0 -16
- package/build/cjs/decorators/InterfaceType.js +0 -19
- package/build/cjs/decorators/Mutation.js +0 -14
- package/build/cjs/decorators/ObjectType.js +0 -19
- package/build/cjs/decorators/Query.js +0 -14
- package/build/cjs/decorators/Resolver.js +0 -20
- package/build/cjs/decorators/Root.js +0 -34
- package/build/cjs/decorators/Subscription.js +0 -25
- package/build/cjs/decorators/UseMiddleware.js +0 -20
- package/build/cjs/decorators/createMethodDecorator.js +0 -8
- package/build/cjs/decorators/createParamDecorator.js +0 -20
- package/build/cjs/decorators/enums.js +0 -13
- package/build/cjs/decorators/index.js +0 -49
- package/build/cjs/decorators/types.js +0 -2
- package/build/cjs/decorators/unions.js +0 -14
- package/build/cjs/errors/CannotDetermineGraphQLTypeError.js +0 -21
- package/build/cjs/errors/ConflictingDefaultValuesError.js +0 -12
- package/build/cjs/errors/GeneratingSchemaError.js +0 -14
- package/build/cjs/errors/InterfaceResolveTypeError.js +0 -11
- package/build/cjs/errors/InvalidDirectiveError.js +0 -10
- package/build/cjs/errors/MissingPubSubError.js +0 -11
- package/build/cjs/errors/MissingSubscriptionTopicsError.js +0 -10
- package/build/cjs/errors/NoExplicitTypeError.js +0 -19
- package/build/cjs/errors/ReflectMetadataMissingError.js +0 -11
- package/build/cjs/errors/SymbolKeysNotSupportedError.js +0 -10
- package/build/cjs/errors/UnionResolveTypeError.js +0 -11
- package/build/cjs/errors/UnmetGraphQLPeerDependencyError.js +0 -12
- package/build/cjs/errors/WrongNullableListOptionError.js +0 -11
- package/build/cjs/errors/graphql/ArgumentValidationError.js +0 -16
- package/build/cjs/errors/graphql/AuthenticationError.js +0 -15
- package/build/cjs/errors/graphql/AuthorizationError.js +0 -15
- package/build/cjs/errors/graphql/index.js +0 -6
- package/build/cjs/errors/index.js +0 -17
- package/build/cjs/helpers/auth-middleware.js +0 -26
- package/build/cjs/helpers/decorators.js +0 -38
- package/build/cjs/helpers/filesystem.js +0 -33
- package/build/cjs/helpers/findType.js +0 -51
- package/build/cjs/helpers/isThrowing.js +0 -13
- package/build/cjs/helpers/params.js +0 -29
- package/build/cjs/helpers/resolver-metadata.js +0 -29
- package/build/cjs/helpers/returnTypes.js +0 -5
- package/build/cjs/helpers/types.js +0 -85
- package/build/cjs/helpers/utils.js +0 -2
- package/build/cjs/index.js +0 -9
- package/build/cjs/metadata/definitions/authorized-metadata.js +0 -2
- package/build/cjs/metadata/definitions/class-metadata.js +0 -2
- package/build/cjs/metadata/definitions/directive-metadata.js +0 -2
- package/build/cjs/metadata/definitions/enum-metadata.js +0 -2
- package/build/cjs/metadata/definitions/extensions-metadata.js +0 -2
- package/build/cjs/metadata/definitions/field-metadata.js +0 -2
- package/build/cjs/metadata/definitions/index.js +0 -13
- package/build/cjs/metadata/definitions/interface-class-metadata.js +0 -2
- package/build/cjs/metadata/definitions/middleware-metadata.js +0 -2
- package/build/cjs/metadata/definitions/object-class-metadata.js +0 -2
- package/build/cjs/metadata/definitions/param-metadata.js +0 -2
- package/build/cjs/metadata/definitions/resolver-metadata.js +0 -2
- package/build/cjs/metadata/definitions/union-metadata.js +0 -2
- package/build/cjs/metadata/getMetadataStorage.js +0 -11
- package/build/cjs/metadata/index.js +0 -5
- package/build/cjs/metadata/metadata-storage.js +0 -266
- package/build/cjs/metadata/utils.js +0 -41
- package/build/cjs/resolvers/convert-args.js +0 -122
- package/build/cjs/resolvers/create.js +0 -81
- package/build/cjs/resolvers/helpers.js +0 -83
- package/build/cjs/resolvers/validate-arg.js +0 -65
- package/build/cjs/scalars/aliases.js +0 -7
- package/build/cjs/scalars/index.js +0 -8
- package/build/cjs/schema/build-context.js +0 -50
- package/build/cjs/schema/definition-node.js +0 -129
- package/build/cjs/schema/schema-generator.js +0 -574
- package/build/cjs/schema/utils.js +0 -39
- package/build/cjs/shim.js +0 -38
- package/build/cjs/typings/Complexity.js +0 -2
- package/build/cjs/typings/ResolverInterface.js +0 -2
- package/build/cjs/typings/SubscribeResolverData.js +0 -2
- package/build/cjs/typings/SubscriptionHandlerData.js +0 -2
- package/build/cjs/typings/TypeResolver.js +0 -2
- package/build/cjs/typings/ValidatorFn.js +0 -2
- package/build/cjs/typings/auth-checker.js +0 -2
- package/build/cjs/typings/index.js +0 -15
- package/build/cjs/typings/legacy-decorators.js +0 -2
- package/build/cjs/typings/middleware.js +0 -2
- package/build/cjs/typings/resolver-data.js +0 -2
- package/build/cjs/typings/resolvers-map.js +0 -2
- package/build/cjs/typings/subscriptions.js +0 -2
- package/build/cjs/typings/utils/ClassType.js +0 -2
- package/build/cjs/typings/utils/Constructor.js +0 -2
- package/build/cjs/typings/utils/Except.js +0 -2
- package/build/cjs/typings/utils/IsEqual.js +0 -2
- package/build/cjs/typings/utils/Maybe.js +0 -2
- package/build/cjs/typings/utils/MaybePromise.js +0 -2
- package/build/cjs/typings/utils/MergeExclusive.js +0 -2
- package/build/cjs/typings/utils/NonEmptyArray.js +0 -2
- package/build/cjs/typings/utils/SetRequired.js +0 -2
- package/build/cjs/typings/utils/Simplify.js +0 -2
- package/build/cjs/typings/utils/index.js +0 -13
- package/build/cjs/utils/buildSchema.js +0 -46
- package/build/cjs/utils/buildTypeDefsAndResolvers.js +0 -21
- package/build/cjs/utils/container.js +0 -37
- package/build/cjs/utils/createResolversMap.js +0 -72
- package/build/cjs/utils/emitSchemaDefinitionFile.js +0 -29
- package/build/cjs/utils/graphql-version.js +0 -14
- package/build/cjs/utils/index.js +0 -17
- package/build/cjs/utils/isPromiseLike.js +0 -7
- package/build/esm/decorators/Arg.js +0 -26
- package/build/esm/decorators/Args.js +0 -16
- package/build/esm/decorators/ArgsType.js +0 -13
- package/build/esm/decorators/Authorized.js +0 -20
- package/build/esm/decorators/Ctx.js +0 -20
- package/build/esm/decorators/Directive.js +0 -37
- package/build/esm/decorators/Extensions.js +0 -26
- package/build/esm/decorators/Field.js +0 -45
- package/build/esm/decorators/FieldResolver.js +0 -42
- package/build/esm/decorators/Info.js +0 -19
- package/build/esm/decorators/InputType.js +0 -16
- package/build/esm/decorators/InterfaceType.js +0 -19
- package/build/esm/decorators/Mutation.js +0 -14
- package/build/esm/decorators/ObjectType.js +0 -19
- package/build/esm/decorators/Query.js +0 -14
- package/build/esm/decorators/Resolver.js +0 -20
- package/build/esm/decorators/Root.js +0 -34
- package/build/esm/decorators/Subscription.js +0 -25
- package/build/esm/decorators/UseMiddleware.js +0 -20
- package/build/esm/decorators/createMethodDecorator.js +0 -8
- package/build/esm/decorators/createParamDecorator.js +0 -20
- package/build/esm/decorators/enums.js +0 -13
- package/build/esm/decorators/index.js +0 -49
- package/build/esm/decorators/types.js +0 -2
- package/build/esm/decorators/unions.js +0 -14
- package/build/esm/errors/CannotDetermineGraphQLTypeError.js +0 -21
- package/build/esm/errors/ConflictingDefaultValuesError.js +0 -12
- package/build/esm/errors/GeneratingSchemaError.js +0 -14
- package/build/esm/errors/InterfaceResolveTypeError.js +0 -11
- package/build/esm/errors/InvalidDirectiveError.js +0 -10
- package/build/esm/errors/MissingPubSubError.js +0 -11
- package/build/esm/errors/MissingSubscriptionTopicsError.js +0 -10
- package/build/esm/errors/NoExplicitTypeError.js +0 -19
- package/build/esm/errors/ReflectMetadataMissingError.js +0 -11
- package/build/esm/errors/SymbolKeysNotSupportedError.js +0 -10
- package/build/esm/errors/UnionResolveTypeError.js +0 -11
- package/build/esm/errors/UnmetGraphQLPeerDependencyError.js +0 -12
- package/build/esm/errors/WrongNullableListOptionError.js +0 -11
- package/build/esm/errors/graphql/ArgumentValidationError.js +0 -16
- package/build/esm/errors/graphql/AuthenticationError.js +0 -15
- package/build/esm/errors/graphql/AuthorizationError.js +0 -15
- package/build/esm/errors/graphql/index.js +0 -6
- package/build/esm/errors/index.js +0 -17
- package/build/esm/helpers/auth-middleware.js +0 -26
- package/build/esm/helpers/decorators.js +0 -38
- package/build/esm/helpers/filesystem.js +0 -33
- package/build/esm/helpers/findType.js +0 -51
- package/build/esm/helpers/isThrowing.js +0 -13
- package/build/esm/helpers/params.js +0 -29
- package/build/esm/helpers/resolver-metadata.js +0 -29
- package/build/esm/helpers/returnTypes.js +0 -5
- package/build/esm/helpers/types.js +0 -85
- package/build/esm/helpers/utils.js +0 -2
- package/build/esm/index.js +0 -9
- package/build/esm/metadata/definitions/authorized-metadata.js +0 -2
- package/build/esm/metadata/definitions/class-metadata.js +0 -2
- package/build/esm/metadata/definitions/directive-metadata.js +0 -2
- package/build/esm/metadata/definitions/enum-metadata.js +0 -2
- package/build/esm/metadata/definitions/extensions-metadata.js +0 -2
- package/build/esm/metadata/definitions/field-metadata.js +0 -2
- package/build/esm/metadata/definitions/index.js +0 -13
- package/build/esm/metadata/definitions/interface-class-metadata.js +0 -2
- package/build/esm/metadata/definitions/middleware-metadata.js +0 -2
- package/build/esm/metadata/definitions/object-class-metadata.js +0 -2
- package/build/esm/metadata/definitions/param-metadata.js +0 -2
- package/build/esm/metadata/definitions/resolver-metadata.js +0 -2
- package/build/esm/metadata/definitions/union-metadata.js +0 -2
- package/build/esm/metadata/getMetadataStorage.js +0 -11
- package/build/esm/metadata/index.js +0 -5
- package/build/esm/metadata/metadata-storage.js +0 -266
- package/build/esm/metadata/utils.js +0 -41
- package/build/esm/package.json +0 -1
- package/build/esm/resolvers/convert-args.js +0 -122
- package/build/esm/resolvers/create.js +0 -81
- package/build/esm/resolvers/helpers.js +0 -83
- package/build/esm/resolvers/validate-arg.js +0 -42
- package/build/esm/scalars/aliases.js +0 -7
- package/build/esm/scalars/index.js +0 -8
- package/build/esm/schema/build-context.js +0 -50
- package/build/esm/schema/definition-node.js +0 -129
- package/build/esm/schema/schema-generator.js +0 -574
- package/build/esm/schema/utils.js +0 -39
- package/build/esm/shim.js +0 -38
- package/build/esm/typings/Complexity.js +0 -2
- package/build/esm/typings/ResolverInterface.js +0 -2
- package/build/esm/typings/SubscribeResolverData.js +0 -2
- package/build/esm/typings/SubscriptionHandlerData.js +0 -2
- package/build/esm/typings/TypeResolver.js +0 -2
- package/build/esm/typings/ValidatorFn.js +0 -2
- package/build/esm/typings/auth-checker.js +0 -2
- package/build/esm/typings/index.js +0 -15
- package/build/esm/typings/legacy-decorators.js +0 -2
- package/build/esm/typings/middleware.js +0 -2
- package/build/esm/typings/resolver-data.js +0 -2
- package/build/esm/typings/resolvers-map.js +0 -2
- package/build/esm/typings/subscriptions.js +0 -2
- package/build/esm/typings/utils/ClassType.js +0 -2
- package/build/esm/typings/utils/Constructor.js +0 -2
- package/build/esm/typings/utils/Except.js +0 -2
- package/build/esm/typings/utils/IsEqual.js +0 -2
- package/build/esm/typings/utils/Maybe.js +0 -2
- package/build/esm/typings/utils/MaybePromise.js +0 -2
- package/build/esm/typings/utils/MergeExclusive.js +0 -2
- package/build/esm/typings/utils/NonEmptyArray.js +0 -2
- package/build/esm/typings/utils/SetRequired.js +0 -2
- package/build/esm/typings/utils/Simplify.js +0 -2
- package/build/esm/typings/utils/index.js +0 -13
- package/build/esm/utils/buildSchema.js +0 -46
- package/build/esm/utils/buildTypeDefsAndResolvers.js +0 -21
- package/build/esm/utils/container.js +0 -37
- package/build/esm/utils/createResolversMap.js +0 -72
- package/build/esm/utils/emitSchemaDefinitionFile.js +0 -29
- package/build/esm/utils/graphql-version.js +0 -14
- package/build/esm/utils/index.js +0 -17
- package/build/esm/utils/isPromiseLike.js +0 -7
- package/build/typings/decorators/Arg.d.ts +0 -5
- package/build/typings/decorators/Args.d.ts +0 -5
- package/build/typings/decorators/ArgsType.d.ts +0 -1
- package/build/typings/decorators/Authorized.d.ts +0 -4
- package/build/typings/decorators/Ctx.d.ts +0 -2
- package/build/typings/decorators/Directive.d.ts +0 -2
- package/build/typings/decorators/Extensions.d.ts +0 -3
- package/build/typings/decorators/Field.d.ts +0 -8
- package/build/typings/decorators/FieldResolver.d.ts +0 -4
- package/build/typings/decorators/Info.d.ts +0 -2
- package/build/typings/decorators/InputType.d.ts +0 -5
- package/build/typings/decorators/InterfaceType.d.ts +0 -11
- package/build/typings/decorators/Mutation.d.ts +0 -4
- package/build/typings/decorators/ObjectType.d.ts +0 -8
- package/build/typings/decorators/Query.d.ts +0 -4
- package/build/typings/decorators/Resolver.d.ts +0 -5
- package/build/typings/decorators/Root.d.ts +0 -2
- package/build/typings/decorators/Subscription.d.ts +0 -14
- package/build/typings/decorators/UseMiddleware.d.ts +0 -4
- package/build/typings/decorators/createMethodDecorator.d.ts +0 -2
- package/build/typings/decorators/createParamDecorator.d.ts +0 -2
- package/build/typings/decorators/enums.d.ts +0 -2
- package/build/typings/decorators/index.d.ts +0 -29
- package/build/typings/decorators/types.d.ts +0 -53
- package/build/typings/decorators/unions.d.ts +0 -9
- package/build/typings/errors/CannotDetermineGraphQLTypeError.d.ts +0 -3
- package/build/typings/errors/ConflictingDefaultValuesError.d.ts +0 -3
- package/build/typings/errors/GeneratingSchemaError.d.ts +0 -5
- package/build/typings/errors/InterfaceResolveTypeError.d.ts +0 -4
- package/build/typings/errors/InvalidDirectiveError.d.ts +0 -3
- package/build/typings/errors/MissingPubSubError.d.ts +0 -3
- package/build/typings/errors/MissingSubscriptionTopicsError.d.ts +0 -3
- package/build/typings/errors/NoExplicitTypeError.d.ts +0 -3
- package/build/typings/errors/ReflectMetadataMissingError.d.ts +0 -3
- package/build/typings/errors/SymbolKeysNotSupportedError.d.ts +0 -3
- package/build/typings/errors/UnionResolveTypeError.d.ts +0 -4
- package/build/typings/errors/UnmetGraphQLPeerDependencyError.d.ts +0 -3
- package/build/typings/errors/WrongNullableListOptionError.d.ts +0 -4
- package/build/typings/errors/graphql/ArgumentValidationError.d.ts +0 -10
- package/build/typings/errors/graphql/AuthenticationError.d.ts +0 -8
- package/build/typings/errors/graphql/AuthorizationError.d.ts +0 -8
- package/build/typings/errors/graphql/index.d.ts +0 -3
- package/build/typings/errors/index.d.ts +0 -14
- package/build/typings/helpers/auth-middleware.d.ts +0 -4
- package/build/typings/helpers/decorators.d.ts +0 -14
- package/build/typings/helpers/filesystem.d.ts +0 -2
- package/build/typings/helpers/findType.d.ts +0 -16
- package/build/typings/helpers/isThrowing.d.ts +0 -1
- package/build/typings/helpers/params.d.ts +0 -11
- package/build/typings/helpers/resolver-metadata.d.ts +0 -3
- package/build/typings/helpers/returnTypes.d.ts +0 -2
- package/build/typings/helpers/types.d.ts +0 -6
- package/build/typings/helpers/utils.d.ts +0 -2
- package/build/typings/index.d.ts +0 -6
- package/build/typings/metadata/definitions/authorized-metadata.d.ts +0 -5
- package/build/typings/metadata/definitions/class-metadata.d.ts +0 -12
- package/build/typings/metadata/definitions/directive-metadata.d.ts +0 -19
- package/build/typings/metadata/definitions/enum-metadata.d.ts +0 -7
- package/build/typings/metadata/definitions/extensions-metadata.d.ts +0 -10
- package/build/typings/metadata/definitions/field-metadata.d.ts +0 -22
- package/build/typings/metadata/definitions/index.d.ts +0 -10
- package/build/typings/metadata/definitions/interface-class-metadata.d.ts +0 -7
- package/build/typings/metadata/definitions/middleware-metadata.d.ts +0 -6
- package/build/typings/metadata/definitions/object-class-metadata.d.ts +0 -4
- package/build/typings/metadata/definitions/param-metadata.d.ts +0 -44
- package/build/typings/metadata/definitions/resolver-metadata.d.ts +0 -43
- package/build/typings/metadata/definitions/union-metadata.d.ts +0 -10
- package/build/typings/metadata/getMetadataStorage.d.ts +0 -5
- package/build/typings/metadata/index.d.ts +0 -1
- package/build/typings/metadata/metadata-storage.d.ts +0 -56
- package/build/typings/metadata/utils.d.ts +0 -6
- package/build/typings/resolvers/convert-args.d.ts +0 -4
- package/build/typings/resolvers/create.d.ts +0 -7
- package/build/typings/resolvers/helpers.d.ts +0 -8
- package/build/typings/resolvers/validate-arg.d.ts +0 -4
- package/build/typings/scalars/aliases.d.ts +0 -3
- package/build/typings/scalars/index.d.ts +0 -2
- package/build/typings/schema/build-context.d.ts +0 -57
- package/build/typings/schema/definition-node.d.ts +0 -8
- package/build/typings/schema/schema-generator.d.ts +0 -45
- package/build/typings/schema/utils.d.ts +0 -3
- package/build/typings/shim.ts +0 -71
- package/build/typings/typings/Complexity.d.ts +0 -2
- package/build/typings/typings/ResolverInterface.d.ts +0 -7
- package/build/typings/typings/SubscribeResolverData.d.ts +0 -8
- package/build/typings/typings/SubscriptionHandlerData.d.ts +0 -8
- package/build/typings/typings/TypeResolver.d.ts +0 -3
- package/build/typings/typings/ValidatorFn.d.ts +0 -13
- package/build/typings/typings/auth-checker.d.ts +0 -8
- package/build/typings/typings/index.d.ts +0 -13
- package/build/typings/typings/legacy-decorators.d.ts +0 -2
- package/build/typings/typings/middleware.d.ts +0 -8
- package/build/typings/typings/resolver-data.d.ts +0 -8
- package/build/typings/typings/resolvers-map.d.ts +0 -11
- package/build/typings/typings/subscriptions.d.ts +0 -10
- package/build/typings/typings/utils/ClassType.d.ts +0 -7
- package/build/typings/typings/utils/Constructor.d.ts +0 -4
- package/build/typings/typings/utils/Except.d.ts +0 -74
- package/build/typings/typings/utils/IsEqual.d.ts +0 -24
- package/build/typings/typings/utils/Maybe.d.ts +0 -1
- package/build/typings/typings/utils/MaybePromise.d.ts +0 -1
- package/build/typings/typings/utils/MergeExclusive.d.ts +0 -36
- package/build/typings/typings/utils/NonEmptyArray.d.ts +0 -1
- package/build/typings/typings/utils/SetRequired.d.ts +0 -26
- package/build/typings/typings/utils/Simplify.d.ts +0 -58
- package/build/typings/typings/utils/index.d.ts +0 -10
- package/build/typings/utils/buildSchema.d.ts +0 -20
- package/build/typings/utils/buildTypeDefsAndResolvers.d.ts +0 -9
- package/build/typings/utils/container.d.ts +0 -13
- package/build/typings/utils/createResolversMap.d.ts +0 -3
- package/build/typings/utils/emitSchemaDefinitionFile.d.ts +0 -7
- package/build/typings/utils/graphql-version.d.ts +0 -2
- package/build/typings/utils/index.d.ts +0 -8
- package/build/typings/utils/isPromiseLike.d.ts +0 -1
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](
|
|
142
|
+
You can also check the [examples folder](https://github.com/MichalLytek/type-graphql/tree/v2.0.0-beta.5/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](
|
|
144
|
+
The [Tests folder](https://github.com/MichalLytek/type-graphql/tree/v2.0.0-beta.5/tests) might also give you some tips on how to get various things done.
|
|
145
145
|
|
|
146
146
|
## Security contact information
|
|
147
147
|
|
|
@@ -177,7 +177,7 @@ It doesn't have a large company that sits behind it - its ongoing development is
|
|
|
177
177
|
|
|
178
178
|
<!-- markdownlint-disable MD033 -->
|
|
179
179
|
|
|
180
|
-
| [<img src="
|
|
180
|
+
| [<img src="https://raw.githubusercontent.com/MichalLytek/type-graphql/v2.0.0-beta.5/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-beta.5/images/lifex.png" width="60" alt="lifeX aps" />](https://www.joinlifex.com) | [<img src="https://raw.githubusercontent.com/MichalLytek/type-graphql/v2.0.0-beta.5/images/instinctools.svg" width="100" alt="instinctools" />](https://instinctools.com/manufacturing) | [<img src="https://raw.githubusercontent.com/MichalLytek/type-graphql/v2.0.0-beta.5/images/vps-server.png" width="125" alt="vps server" />](https://www.vpsserver.com) | [<img src="https://raw.githubusercontent.com/MichalLytek/type-graphql/v2.0.0-beta.5/images/nongamstopbets.png" width="50" alt="NonGamstopBets" />](https://www.nongamstopbets.com/casinos-not-on-gamstop/) | [<img src="https://raw.githubusercontent.com/MichalLytek/type-graphql/v2.0.0-beta.5/images/casinodeps.svg" width="80" alt="CasinoDeps.co.nz" />](https://casinodeps.co.nz/1-dollar-casinos/) |
|
|
181
181
|
| :------------------------------------------------------------------------------------------------------------------: | :--------------------------------------------------------------------------------------: | :--------------------------------------------------------------------------------------------------------------: | :---------------------------------------------------------------------------------------------: | :---------------------------------------------------------------------------------------------------------------------------------: | :-------------------------------------------------------------------------------------------------------------------: |
|
|
182
182
|
| [**Live Graphic Systems**](https://www.ligrsystems.com) | [**LifeX Aps**](https://www.joinlifex.com/) | [**instinctools**](https://instinctools.com/manufacturing) | [**VPS Server**](https://www.vpsserver.com) | [**NonGamstopBets**](https://www.nongamstopbets.com/casinos-not-on-gamstop/) | [**CasinoDeps**](https://casinodeps.co.nz/1-dollar-casinos/) |
|
|
183
183
|
|
|
@@ -191,9 +191,9 @@ It doesn't have a large company that sits behind it - its ongoing development is
|
|
|
191
191
|
|
|
192
192
|
### GitHub Sponsors
|
|
193
193
|
|
|
194
|
-
[](https://github.com/sponsors/TypeGraphQL)
|
|
195
195
|
|
|
196
196
|
## Want to help?
|
|
197
197
|
|
|
198
198
|
Want to file a bug, contribute some code, or improve the documentation? Great! Please read our
|
|
199
|
-
guidelines for [CONTRIBUTING](
|
|
199
|
+
guidelines for [CONTRIBUTING](https://github.com/MichalLytek/type-graphql/tree/v2.0.0-beta.5/CONTRIBUTING.md) and then check out one of our [help-wanted issues](https://github.com/MichalLytek/type-graphql/labels/Help%20Wanted%20%3Asos%3A).
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "type-graphql",
|
|
3
|
-
"version": "2.0.0-beta.
|
|
3
|
+
"version": "2.0.0-beta.5",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Create GraphQL schema and resolvers with TypeScript, using classes and decorators!",
|
|
6
6
|
"keywords": [
|
|
@@ -98,7 +98,7 @@
|
|
|
98
98
|
"peerDependencies": {
|
|
99
99
|
"class-validator": ">=0.14.0",
|
|
100
100
|
"graphql": "^16.8.1",
|
|
101
|
-
"graphql-scalars": "^1.22.
|
|
101
|
+
"graphql-scalars": "^1.22.4"
|
|
102
102
|
},
|
|
103
103
|
"peerDependenciesMeta": {
|
|
104
104
|
"class-validator": {
|
|
@@ -108,78 +108,78 @@
|
|
|
108
108
|
"dependencies": {
|
|
109
109
|
"@graphql-yoga/subscription": "^5.0.0",
|
|
110
110
|
"@types/node": "*",
|
|
111
|
-
"@types/semver": "^7.5.
|
|
111
|
+
"@types/semver": "^7.5.6",
|
|
112
112
|
"graphql-query-complexity": "^0.12.0",
|
|
113
113
|
"semver": "^7.5.4",
|
|
114
|
-
"tslib": "^2.6.
|
|
114
|
+
"tslib": "^2.6.2"
|
|
115
115
|
},
|
|
116
116
|
"devDependencies": {
|
|
117
117
|
"@apollo/cache-control-types": "^1.0.3",
|
|
118
|
-
"@apollo/gateway": "^2.
|
|
119
|
-
"@apollo/server": "^4.
|
|
118
|
+
"@apollo/gateway": "^2.6.2",
|
|
119
|
+
"@apollo/server": "^4.10.0",
|
|
120
120
|
"@apollo/server-plugin-response-cache": "^4.1.3",
|
|
121
|
-
"@apollo/subgraph": "^2.
|
|
122
|
-
"@cspell/dict-node": "^4.0.
|
|
123
|
-
"@cspell/dict-npm": "^5.0.
|
|
124
|
-
"@cspell/dict-shell": "^1.0.
|
|
125
|
-
"@cspell/dict-typescript": "^3.1.
|
|
126
|
-
"@cspell/eslint-plugin": "^
|
|
127
|
-
"@graphql-tools/schema": "^10.0.
|
|
128
|
-
"@graphql-tools/utils": "^10.0.
|
|
121
|
+
"@apollo/subgraph": "^2.6.2",
|
|
122
|
+
"@cspell/dict-node": "^4.0.3",
|
|
123
|
+
"@cspell/dict-npm": "^5.0.14",
|
|
124
|
+
"@cspell/dict-shell": "^1.0.6",
|
|
125
|
+
"@cspell/dict-typescript": "^3.1.2",
|
|
126
|
+
"@cspell/eslint-plugin": "^8.3.2",
|
|
127
|
+
"@graphql-tools/schema": "^10.0.2",
|
|
128
|
+
"@graphql-tools/utils": "^10.0.12",
|
|
129
129
|
"@graphql-yoga/redis-event-target": "^3.0.0",
|
|
130
|
-
"@mikro-orm/core": "^
|
|
131
|
-
"@mikro-orm/postgresql": "^
|
|
130
|
+
"@mikro-orm/core": "^6.0.2",
|
|
131
|
+
"@mikro-orm/postgresql": "^6.0.2",
|
|
132
132
|
"@typegoose/typegoose": "^12.0.0",
|
|
133
|
-
"@types/jest": "^29.5.
|
|
134
|
-
"@types/lodash.merge": "^4.6.
|
|
135
|
-
"@types/node": "^20.8
|
|
136
|
-
"@types/shelljs": "^0.8.
|
|
137
|
-
"@types/yargs": "^17.0.
|
|
138
|
-
"@typescript-eslint/eslint-plugin": "^6.
|
|
139
|
-
"@typescript-eslint/parser": "^6.
|
|
133
|
+
"@types/jest": "^29.5.11",
|
|
134
|
+
"@types/lodash.merge": "^4.6.9",
|
|
135
|
+
"@types/node": "^20.10.8",
|
|
136
|
+
"@types/shelljs": "^0.8.15",
|
|
137
|
+
"@types/yargs": "^17.0.32",
|
|
138
|
+
"@typescript-eslint/eslint-plugin": "^6.18.1",
|
|
139
|
+
"@typescript-eslint/parser": "^6.18.1",
|
|
140
140
|
"class-validator": "^0.14.0",
|
|
141
|
-
"cspell": "^
|
|
141
|
+
"cspell": "^8.3.2",
|
|
142
142
|
"dotenv": "^16.3.1",
|
|
143
|
-
"eslint": "^8.
|
|
143
|
+
"eslint": "^8.56.0",
|
|
144
144
|
"eslint-config-airbnb-base": "^15.0.0",
|
|
145
145
|
"eslint-config-airbnb-typescript": "^17.1.0",
|
|
146
|
-
"eslint-config-prettier": "^9.
|
|
146
|
+
"eslint-config-prettier": "^9.1.0",
|
|
147
147
|
"eslint-import-resolver-typescript": "^3.6.1",
|
|
148
148
|
"eslint-plugin-import": "^2.29.1",
|
|
149
|
-
"eslint-plugin-jest": "^27.6.
|
|
149
|
+
"eslint-plugin-jest": "^27.6.2",
|
|
150
150
|
"eslint-plugin-tsdoc": "^0.2.17",
|
|
151
151
|
"expect": "^29.7.0",
|
|
152
|
-
"glob": "^10.3.
|
|
152
|
+
"glob": "^10.3.10",
|
|
153
153
|
"graphql": "^16.8.1",
|
|
154
|
-
"graphql-scalars": "^1.22.
|
|
154
|
+
"graphql-scalars": "^1.22.4",
|
|
155
155
|
"graphql-tag": "^2.12.6",
|
|
156
|
-
"graphql-yoga": "^5.
|
|
156
|
+
"graphql-yoga": "^5.1.1",
|
|
157
157
|
"husky": "^8.0.3",
|
|
158
158
|
"ioredis": "^5.3.2",
|
|
159
|
-
"jest": "^29.
|
|
159
|
+
"jest": "^29.7.0",
|
|
160
160
|
"joiful": "^3.0.2",
|
|
161
|
-
"lint-staged": "^15.0
|
|
161
|
+
"lint-staged": "^15.2.0",
|
|
162
162
|
"lodash.merge": "^4.6.2",
|
|
163
|
-
"markdownlint": "^0.
|
|
164
|
-
"markdownlint-cli": "^0.
|
|
165
|
-
"mongoose": "^8.0.
|
|
163
|
+
"markdownlint": "^0.33.0",
|
|
164
|
+
"markdownlint-cli": "^0.38.0",
|
|
165
|
+
"mongoose": "^8.0.4",
|
|
166
166
|
"npm-run-all": "^4.1.5",
|
|
167
|
-
"pg": "^8.11.
|
|
168
|
-
"prettier": "^3.
|
|
167
|
+
"pg": "^8.11.3",
|
|
168
|
+
"prettier": "^3.1.1",
|
|
169
169
|
"prettier-plugin-sh": "^0.13.1",
|
|
170
170
|
"reflect-metadata": "^0.1.13",
|
|
171
171
|
"shellcheck": "^2.2.0",
|
|
172
172
|
"shelljs": "^0.8.5",
|
|
173
173
|
"shx": "^0.3.4",
|
|
174
|
-
"sponsorkit": "^0.
|
|
174
|
+
"sponsorkit": "^0.9.1",
|
|
175
175
|
"ts-jest": "^29.1.1",
|
|
176
|
-
"ts-node": "^10.9.
|
|
177
|
-
"ts-patch": "^3.
|
|
176
|
+
"ts-node": "^10.9.2",
|
|
177
|
+
"ts-patch": "^3.1.1",
|
|
178
178
|
"tsconfig-paths": "^4.2.0",
|
|
179
179
|
"tsyringe": "^4.8.0",
|
|
180
180
|
"typedi": "^0.10.0",
|
|
181
|
-
"typeorm": "^0.3.
|
|
182
|
-
"typescript": "^5.
|
|
181
|
+
"typeorm": "^0.3.19",
|
|
182
|
+
"typescript": "^5.3.3",
|
|
183
183
|
"typescript-transform-paths": "^3.4.6",
|
|
184
184
|
"typescript-transformer-esm": "^1.1.0",
|
|
185
185
|
"yargs": "^17.7.2"
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Arg = void 0;
|
|
4
|
-
const decorators_1 = require("../helpers/decorators");
|
|
5
|
-
const params_1 = require("../helpers/params");
|
|
6
|
-
const getMetadataStorage_1 = require("../metadata/getMetadataStorage");
|
|
7
|
-
function Arg(name, returnTypeFuncOrOptions, maybeOptions) {
|
|
8
|
-
return (prototype, propertyKey, parameterIndex) => {
|
|
9
|
-
const { options, returnTypeFunc } = (0, decorators_1.getTypeDecoratorParams)(returnTypeFuncOrOptions, maybeOptions);
|
|
10
|
-
(0, getMetadataStorage_1.getMetadataStorage)().collectHandlerParamMetadata({
|
|
11
|
-
kind: "arg",
|
|
12
|
-
name,
|
|
13
|
-
description: options.description,
|
|
14
|
-
deprecationReason: options.deprecationReason,
|
|
15
|
-
...(0, params_1.getParamInfo)({
|
|
16
|
-
prototype,
|
|
17
|
-
propertyKey,
|
|
18
|
-
parameterIndex,
|
|
19
|
-
returnTypeFunc,
|
|
20
|
-
options,
|
|
21
|
-
argName: name,
|
|
22
|
-
}),
|
|
23
|
-
});
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
exports.Arg = Arg;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Args = void 0;
|
|
4
|
-
const decorators_1 = require("../helpers/decorators");
|
|
5
|
-
const params_1 = require("../helpers/params");
|
|
6
|
-
const getMetadataStorage_1 = require("../metadata/getMetadataStorage");
|
|
7
|
-
function Args(paramTypeFnOrOptions, maybeOptions) {
|
|
8
|
-
const { options, returnTypeFunc } = (0, decorators_1.getTypeDecoratorParams)(paramTypeFnOrOptions, maybeOptions);
|
|
9
|
-
return (prototype, propertyKey, parameterIndex) => {
|
|
10
|
-
(0, getMetadataStorage_1.getMetadataStorage)().collectHandlerParamMetadata({
|
|
11
|
-
kind: "args",
|
|
12
|
-
...(0, params_1.getParamInfo)({ prototype, propertyKey, parameterIndex, returnTypeFunc, options }),
|
|
13
|
-
});
|
|
14
|
-
};
|
|
15
|
-
}
|
|
16
|
-
exports.Args = Args;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ArgsType = void 0;
|
|
4
|
-
const getMetadataStorage_1 = require("../metadata/getMetadataStorage");
|
|
5
|
-
function ArgsType() {
|
|
6
|
-
return target => {
|
|
7
|
-
(0, getMetadataStorage_1.getMetadataStorage)().collectArgsMetadata({
|
|
8
|
-
name: target.name,
|
|
9
|
-
target,
|
|
10
|
-
});
|
|
11
|
-
};
|
|
12
|
-
}
|
|
13
|
-
exports.ArgsType = ArgsType;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Authorized = void 0;
|
|
4
|
-
const errors_1 = require("../errors");
|
|
5
|
-
const decorators_1 = require("../helpers/decorators");
|
|
6
|
-
const getMetadataStorage_1 = require("../metadata/getMetadataStorage");
|
|
7
|
-
function Authorized(...rolesOrRolesArray) {
|
|
8
|
-
const roles = (0, decorators_1.getArrayFromOverloadedRest)(rolesOrRolesArray);
|
|
9
|
-
return (prototype, propertyKey, _descriptor) => {
|
|
10
|
-
if (typeof propertyKey === "symbol") {
|
|
11
|
-
throw new errors_1.SymbolKeysNotSupportedError();
|
|
12
|
-
}
|
|
13
|
-
(0, getMetadataStorage_1.getMetadataStorage)().collectAuthorizedFieldMetadata({
|
|
14
|
-
target: prototype.constructor,
|
|
15
|
-
fieldName: propertyKey,
|
|
16
|
-
roles,
|
|
17
|
-
});
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
exports.Authorized = Authorized;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Ctx = void 0;
|
|
4
|
-
const errors_1 = require("../errors");
|
|
5
|
-
const getMetadataStorage_1 = require("../metadata/getMetadataStorage");
|
|
6
|
-
function Ctx(propertyName) {
|
|
7
|
-
return (prototype, propertyKey, parameterIndex) => {
|
|
8
|
-
if (typeof propertyKey === "symbol") {
|
|
9
|
-
throw new errors_1.SymbolKeysNotSupportedError();
|
|
10
|
-
}
|
|
11
|
-
(0, getMetadataStorage_1.getMetadataStorage)().collectHandlerParamMetadata({
|
|
12
|
-
kind: "context",
|
|
13
|
-
target: prototype.constructor,
|
|
14
|
-
methodName: propertyKey,
|
|
15
|
-
index: parameterIndex,
|
|
16
|
-
propertyName,
|
|
17
|
-
});
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
exports.Ctx = Ctx;
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Directive = void 0;
|
|
4
|
-
const errors_1 = require("../errors");
|
|
5
|
-
const getMetadataStorage_1 = require("../metadata/getMetadataStorage");
|
|
6
|
-
function Directive(nameOrDefinition) {
|
|
7
|
-
return (targetOrPrototype, propertyKey, parameterIndexOrDescriptor) => {
|
|
8
|
-
const directive = { nameOrDefinition, args: {} };
|
|
9
|
-
if (typeof propertyKey === "symbol") {
|
|
10
|
-
throw new errors_1.SymbolKeysNotSupportedError();
|
|
11
|
-
}
|
|
12
|
-
if (propertyKey) {
|
|
13
|
-
if (typeof parameterIndexOrDescriptor === "number") {
|
|
14
|
-
(0, getMetadataStorage_1.getMetadataStorage)().collectDirectiveArgumentMetadata({
|
|
15
|
-
target: targetOrPrototype.constructor,
|
|
16
|
-
fieldName: propertyKey,
|
|
17
|
-
parameterIndex: parameterIndexOrDescriptor,
|
|
18
|
-
directive,
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
else {
|
|
22
|
-
(0, getMetadataStorage_1.getMetadataStorage)().collectDirectiveFieldMetadata({
|
|
23
|
-
target: targetOrPrototype.constructor,
|
|
24
|
-
fieldName: propertyKey,
|
|
25
|
-
directive,
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
else {
|
|
30
|
-
(0, getMetadataStorage_1.getMetadataStorage)().collectDirectiveClassMetadata({
|
|
31
|
-
target: targetOrPrototype,
|
|
32
|
-
directive,
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
exports.Directive = Directive;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Extensions = void 0;
|
|
4
|
-
const errors_1 = require("../errors");
|
|
5
|
-
const getMetadataStorage_1 = require("../metadata/getMetadataStorage");
|
|
6
|
-
function Extensions(extensions) {
|
|
7
|
-
return (targetOrPrototype, propertyKey, _descriptor) => {
|
|
8
|
-
if (typeof propertyKey === "symbol") {
|
|
9
|
-
throw new errors_1.SymbolKeysNotSupportedError();
|
|
10
|
-
}
|
|
11
|
-
if (propertyKey) {
|
|
12
|
-
(0, getMetadataStorage_1.getMetadataStorage)().collectExtensionsFieldMetadata({
|
|
13
|
-
target: targetOrPrototype.constructor,
|
|
14
|
-
fieldName: propertyKey,
|
|
15
|
-
extensions,
|
|
16
|
-
});
|
|
17
|
-
}
|
|
18
|
-
else {
|
|
19
|
-
(0, getMetadataStorage_1.getMetadataStorage)().collectExtensionsClassMetadata({
|
|
20
|
-
target: targetOrPrototype,
|
|
21
|
-
extensions,
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
exports.Extensions = Extensions;
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Field = void 0;
|
|
4
|
-
const errors_1 = require("../errors");
|
|
5
|
-
const decorators_1 = require("../helpers/decorators");
|
|
6
|
-
const findType_1 = require("../helpers/findType");
|
|
7
|
-
const getMetadataStorage_1 = require("../metadata/getMetadataStorage");
|
|
8
|
-
function Field(returnTypeFuncOrOptions, maybeOptions) {
|
|
9
|
-
return (prototype, propertyKey, descriptor) => {
|
|
10
|
-
if (typeof propertyKey === "symbol") {
|
|
11
|
-
throw new errors_1.SymbolKeysNotSupportedError();
|
|
12
|
-
}
|
|
13
|
-
const { options, returnTypeFunc } = (0, decorators_1.getTypeDecoratorParams)(returnTypeFuncOrOptions, maybeOptions);
|
|
14
|
-
const isResolver = Boolean(descriptor);
|
|
15
|
-
const isResolverMethod = Boolean(descriptor && descriptor.value);
|
|
16
|
-
const { getType, typeOptions } = (0, findType_1.findType)({
|
|
17
|
-
metadataKey: isResolverMethod ? "design:returntype" : "design:type",
|
|
18
|
-
prototype,
|
|
19
|
-
propertyKey,
|
|
20
|
-
returnTypeFunc,
|
|
21
|
-
typeOptions: options,
|
|
22
|
-
});
|
|
23
|
-
(0, getMetadataStorage_1.getMetadataStorage)().collectClassFieldMetadata({
|
|
24
|
-
name: propertyKey,
|
|
25
|
-
schemaName: options.name || propertyKey,
|
|
26
|
-
getType,
|
|
27
|
-
typeOptions,
|
|
28
|
-
complexity: options.complexity,
|
|
29
|
-
target: prototype.constructor,
|
|
30
|
-
description: options.description,
|
|
31
|
-
deprecationReason: options.deprecationReason,
|
|
32
|
-
simple: options.simple,
|
|
33
|
-
});
|
|
34
|
-
if (isResolver) {
|
|
35
|
-
(0, getMetadataStorage_1.getMetadataStorage)().collectFieldResolverMetadata({
|
|
36
|
-
kind: "internal",
|
|
37
|
-
methodName: propertyKey,
|
|
38
|
-
schemaName: options.name || propertyKey,
|
|
39
|
-
target: prototype.constructor,
|
|
40
|
-
complexity: options.complexity,
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
exports.Field = Field;
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.FieldResolver = void 0;
|
|
4
|
-
const errors_1 = require("../errors");
|
|
5
|
-
const decorators_1 = require("../helpers/decorators");
|
|
6
|
-
const findType_1 = require("../helpers/findType");
|
|
7
|
-
const getMetadataStorage_1 = require("../metadata/getMetadataStorage");
|
|
8
|
-
function FieldResolver(returnTypeFuncOrOptions, maybeOptions) {
|
|
9
|
-
return (prototype, propertyKey) => {
|
|
10
|
-
if (typeof propertyKey === "symbol") {
|
|
11
|
-
throw new errors_1.SymbolKeysNotSupportedError();
|
|
12
|
-
}
|
|
13
|
-
let getType;
|
|
14
|
-
let typeOptions;
|
|
15
|
-
const { options, returnTypeFunc } = (0, decorators_1.getTypeDecoratorParams)(returnTypeFuncOrOptions, maybeOptions);
|
|
16
|
-
try {
|
|
17
|
-
const typeInfo = (0, findType_1.findType)({
|
|
18
|
-
metadataKey: "design:returntype",
|
|
19
|
-
prototype,
|
|
20
|
-
propertyKey,
|
|
21
|
-
returnTypeFunc,
|
|
22
|
-
typeOptions: options,
|
|
23
|
-
});
|
|
24
|
-
typeOptions = typeInfo.typeOptions;
|
|
25
|
-
getType = typeInfo.getType;
|
|
26
|
-
}
|
|
27
|
-
catch {
|
|
28
|
-
}
|
|
29
|
-
(0, getMetadataStorage_1.getMetadataStorage)().collectFieldResolverMetadata({
|
|
30
|
-
kind: "external",
|
|
31
|
-
methodName: propertyKey,
|
|
32
|
-
schemaName: options.name || propertyKey,
|
|
33
|
-
target: prototype.constructor,
|
|
34
|
-
getType,
|
|
35
|
-
typeOptions,
|
|
36
|
-
complexity: options.complexity,
|
|
37
|
-
description: options.description,
|
|
38
|
-
deprecationReason: options.deprecationReason,
|
|
39
|
-
});
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
|
-
exports.FieldResolver = FieldResolver;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Info = void 0;
|
|
4
|
-
const errors_1 = require("../errors");
|
|
5
|
-
const getMetadataStorage_1 = require("../metadata/getMetadataStorage");
|
|
6
|
-
function Info() {
|
|
7
|
-
return (prototype, propertyKey, parameterIndex) => {
|
|
8
|
-
if (typeof propertyKey === "symbol") {
|
|
9
|
-
throw new errors_1.SymbolKeysNotSupportedError();
|
|
10
|
-
}
|
|
11
|
-
(0, getMetadataStorage_1.getMetadataStorage)().collectHandlerParamMetadata({
|
|
12
|
-
kind: "info",
|
|
13
|
-
target: prototype.constructor,
|
|
14
|
-
methodName: propertyKey,
|
|
15
|
-
index: parameterIndex,
|
|
16
|
-
});
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
exports.Info = Info;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.InputType = void 0;
|
|
4
|
-
const decorators_1 = require("../helpers/decorators");
|
|
5
|
-
const getMetadataStorage_1 = require("../metadata/getMetadataStorage");
|
|
6
|
-
function InputType(nameOrOptions, maybeOptions) {
|
|
7
|
-
const { name, options } = (0, decorators_1.getNameDecoratorParams)(nameOrOptions, maybeOptions);
|
|
8
|
-
return target => {
|
|
9
|
-
(0, getMetadataStorage_1.getMetadataStorage)().collectInputMetadata({
|
|
10
|
-
name: name || target.name,
|
|
11
|
-
target,
|
|
12
|
-
description: options.description,
|
|
13
|
-
});
|
|
14
|
-
};
|
|
15
|
-
}
|
|
16
|
-
exports.InputType = InputType;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.InterfaceType = void 0;
|
|
4
|
-
const decorators_1 = require("../helpers/decorators");
|
|
5
|
-
const getMetadataStorage_1 = require("../metadata/getMetadataStorage");
|
|
6
|
-
function InterfaceType(nameOrOptions, maybeOptions) {
|
|
7
|
-
const { name, options } = (0, decorators_1.getNameDecoratorParams)(nameOrOptions, maybeOptions);
|
|
8
|
-
const interfaceClasses = options.implements && [].concat(options.implements);
|
|
9
|
-
return target => {
|
|
10
|
-
(0, getMetadataStorage_1.getMetadataStorage)().collectInterfaceMetadata({
|
|
11
|
-
name: name || target.name,
|
|
12
|
-
target,
|
|
13
|
-
interfaceClasses,
|
|
14
|
-
autoRegisteringDisabled: options.autoRegisterImplementations === false,
|
|
15
|
-
...options,
|
|
16
|
-
});
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
exports.InterfaceType = InterfaceType;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Mutation = void 0;
|
|
4
|
-
const decorators_1 = require("../helpers/decorators");
|
|
5
|
-
const resolver_metadata_1 = require("../helpers/resolver-metadata");
|
|
6
|
-
const getMetadataStorage_1 = require("../metadata/getMetadataStorage");
|
|
7
|
-
function Mutation(returnTypeFuncOrOptions, maybeOptions) {
|
|
8
|
-
const { options, returnTypeFunc } = (0, decorators_1.getTypeDecoratorParams)(returnTypeFuncOrOptions, maybeOptions);
|
|
9
|
-
return (prototype, methodName) => {
|
|
10
|
-
const metadata = (0, resolver_metadata_1.getResolverMetadata)(prototype, methodName, returnTypeFunc, options);
|
|
11
|
-
(0, getMetadataStorage_1.getMetadataStorage)().collectMutationHandlerMetadata(metadata);
|
|
12
|
-
};
|
|
13
|
-
}
|
|
14
|
-
exports.Mutation = Mutation;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ObjectType = void 0;
|
|
4
|
-
const decorators_1 = require("../helpers/decorators");
|
|
5
|
-
const getMetadataStorage_1 = require("../metadata/getMetadataStorage");
|
|
6
|
-
function ObjectType(nameOrOptions, maybeOptions) {
|
|
7
|
-
const { name, options } = (0, decorators_1.getNameDecoratorParams)(nameOrOptions, maybeOptions);
|
|
8
|
-
const interfaceClasses = options.implements && [].concat(options.implements);
|
|
9
|
-
return target => {
|
|
10
|
-
(0, getMetadataStorage_1.getMetadataStorage)().collectObjectMetadata({
|
|
11
|
-
name: name || target.name,
|
|
12
|
-
target,
|
|
13
|
-
description: options.description,
|
|
14
|
-
interfaceClasses,
|
|
15
|
-
simpleResolvers: options.simpleResolvers,
|
|
16
|
-
});
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
exports.ObjectType = ObjectType;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Query = void 0;
|
|
4
|
-
const decorators_1 = require("../helpers/decorators");
|
|
5
|
-
const resolver_metadata_1 = require("../helpers/resolver-metadata");
|
|
6
|
-
const getMetadataStorage_1 = require("../metadata/getMetadataStorage");
|
|
7
|
-
function Query(returnTypeFuncOrOptions, maybeOptions) {
|
|
8
|
-
const { options, returnTypeFunc } = (0, decorators_1.getTypeDecoratorParams)(returnTypeFuncOrOptions, maybeOptions);
|
|
9
|
-
return (prototype, methodName) => {
|
|
10
|
-
const metadata = (0, resolver_metadata_1.getResolverMetadata)(prototype, methodName, returnTypeFunc, options);
|
|
11
|
-
(0, getMetadataStorage_1.getMetadataStorage)().collectQueryHandlerMetadata(metadata);
|
|
12
|
-
};
|
|
13
|
-
}
|
|
14
|
-
exports.Query = Query;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Resolver = void 0;
|
|
4
|
-
const getMetadataStorage_1 = require("../metadata/getMetadataStorage");
|
|
5
|
-
function Resolver(objectTypeOrTypeFunc) {
|
|
6
|
-
return target => {
|
|
7
|
-
const getObjectType = objectTypeOrTypeFunc
|
|
8
|
-
? objectTypeOrTypeFunc.prototype
|
|
9
|
-
? () => objectTypeOrTypeFunc
|
|
10
|
-
: objectTypeOrTypeFunc
|
|
11
|
-
: () => {
|
|
12
|
-
throw new Error(`No provided object type in '@Resolver' decorator for class '${target.name}!'`);
|
|
13
|
-
};
|
|
14
|
-
(0, getMetadataStorage_1.getMetadataStorage)().collectResolverClassMetadata({
|
|
15
|
-
target,
|
|
16
|
-
getObjectType,
|
|
17
|
-
});
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
exports.Resolver = Resolver;
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Root = void 0;
|
|
4
|
-
const errors_1 = require("../errors");
|
|
5
|
-
const findType_1 = require("../helpers/findType");
|
|
6
|
-
const getMetadataStorage_1 = require("../metadata/getMetadataStorage");
|
|
7
|
-
function Root(propertyName) {
|
|
8
|
-
return (prototype, propertyKey, parameterIndex) => {
|
|
9
|
-
if (typeof propertyKey === "symbol") {
|
|
10
|
-
throw new errors_1.SymbolKeysNotSupportedError();
|
|
11
|
-
}
|
|
12
|
-
let getType;
|
|
13
|
-
try {
|
|
14
|
-
const typeInfo = (0, findType_1.findType)({
|
|
15
|
-
metadataKey: "design:paramtypes",
|
|
16
|
-
prototype,
|
|
17
|
-
propertyKey,
|
|
18
|
-
parameterIndex,
|
|
19
|
-
});
|
|
20
|
-
getType = typeInfo.getType;
|
|
21
|
-
}
|
|
22
|
-
catch {
|
|
23
|
-
}
|
|
24
|
-
(0, getMetadataStorage_1.getMetadataStorage)().collectHandlerParamMetadata({
|
|
25
|
-
kind: "root",
|
|
26
|
-
target: prototype.constructor,
|
|
27
|
-
methodName: propertyKey,
|
|
28
|
-
index: parameterIndex,
|
|
29
|
-
propertyName,
|
|
30
|
-
getType,
|
|
31
|
-
});
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
exports.Root = Root;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Subscription = void 0;
|
|
4
|
-
const errors_1 = require("../errors");
|
|
5
|
-
const decorators_1 = require("../helpers/decorators");
|
|
6
|
-
const resolver_metadata_1 = require("../helpers/resolver-metadata");
|
|
7
|
-
const getMetadataStorage_1 = require("../metadata/getMetadataStorage");
|
|
8
|
-
function Subscription(returnTypeFuncOrOptions, maybeOptions) {
|
|
9
|
-
const params = (0, decorators_1.getTypeDecoratorParams)(returnTypeFuncOrOptions, maybeOptions);
|
|
10
|
-
const options = params.options;
|
|
11
|
-
return (prototype, methodName) => {
|
|
12
|
-
const metadata = (0, resolver_metadata_1.getResolverMetadata)(prototype, methodName, params.returnTypeFunc, options);
|
|
13
|
-
if (Array.isArray(options.topics) && options.topics.length === 0) {
|
|
14
|
-
throw new errors_1.MissingSubscriptionTopicsError(metadata.target, metadata.methodName);
|
|
15
|
-
}
|
|
16
|
-
(0, getMetadataStorage_1.getMetadataStorage)().collectSubscriptionHandlerMetadata({
|
|
17
|
-
...metadata,
|
|
18
|
-
topics: options.topics,
|
|
19
|
-
topicId: options.topicId,
|
|
20
|
-
filter: options.filter,
|
|
21
|
-
subscribe: options.subscribe,
|
|
22
|
-
});
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
exports.Subscription = Subscription;
|