type-graphql

Create GraphQL schema and resolvers with TypeScript, using classes and decorators!

MIT License

Downloads
759K
Stars
7.9K
Committers
88

Bot releases are hidden (Show)

type-graphql - 2.0.0-beta.6 Latest Release

Published by MichalLytek 6 months ago

Fixes

  • allow overriding field resolver method with different name arguments (#1284)
  • allow object type's name argument string contain a double underscore (__) when using buildTypeDefsAndResolvers() (#1309)

Others

  • Breaking Change: update graphql-scalars peer dependency to ^1.22.4
  • properly configure esm build pipeline to publish working esm version of the package
type-graphql - 2.0.0-beta.4

Published by MichalLytek 6 months ago

Features

  • Breaking Change: expose shim as a package entry point type-graphql/shim (and /node_modules/type-graphql/build/typings/shim.ts)
  • Breaking Change: update graphql-js peer dependency to ^16.8.1
  • Breaking Change: use @graphql-yoga instead of graphql-subscriptions as the subscriptions engine
  • Breaking Change: require providing PubSub implementation into buildSchema option when using @Subscription
  • Breaking Change: remove @PubSub in favor of directly importing created PubSub implementation
  • Breaking Change: remove Publisher and PubSubEngine types
  • Breaking Change: rename interface ResolverFilterData into SubscriptionHandlerData and ResolverTopicData into SubscribeResolverData
  • support defining directives on @Field of @Args
  • support defining directives on inline @Arg
  • allow passing custom validation function as validateFn option of @Arg and @Args decorators
  • add support for dynamic topic id function in @Subscription decorator option
type-graphql - 2.0.0-beta.2

Published by MichalLytek over 1 year ago

Features

  • Breaking Change: AuthChecker type is now "function or class" - update to AuthCheckerFn if the function form is needed in the code
  • Breaking Change: update graphql-js peer dependency to ^16.6.0
  • Breaking Change: buildSchemaSync is now also checking the generated schema for errors
  • Breaking Change: validate option of buildSchema is set to false by default - integration with class-validator has to be turned on explicitly
  • Breaking Change: validate option of buildSchema doesn't accept anymore a custom validation function - use validateFn option instead
  • support class-based auth checker, which allows for dependency injection
  • allow defining directives for interface types and theirs fields, with inheritance for object types fields (#744)
  • allow deprecating input fields and args (#794)
  • support disabling inferring default values (#793)
  • support readonly arrays for roles of @Authorized decorator (#935)
  • add sync version of buildTypeDefsAndResolvers function (#803)
  • lift restriction of listing all interfaces from inheritance chain in implements option of @ObjectType decorator (#1425)

Fixes

  • Breaking Change: properly emit types nullability when defaultValue is provided and remove ConflictingDefaultWithNullableError error (#751)
  • allow defining extension on field resolver level for fields also defined as a property of the class (#776)
  • fix throwing error when schema with dynamic default value was built again (#787)
  • fix converting inputs with fields of nested array type (#801)
  • disable broken exposing input types fields under a changed name via @Field({ name: "..." })
  • support overwriting fields of extended types (#1109)
  • properly execute args validation for nullable items array (#1328)

Others

  • Breaking Change: update class-validator peer dependency to >=0.14.0
  • Breaking Change: change build config to ES2019 - drop support for Node.js < 14.5
  • Breaking Change: remove support for loading resolvers by glob paths (resolvers: string[] build schema option)
  • Breaking Change: remove isAbstract legacy decorator option
type-graphql - v1.2.0-rc.1

Published by MichalLytek about 3 years ago

Features

  • Breaking Change: AuthChecker type is now "function or class" - update to AuthCheckerFn if the function form is needed in the code
  • support class-based auth checker, which allows for dependency injection
  • allow defining directives for interface types and theirs fields, with inheritance for object types fields (#744)
  • allow deprecating input fields and args (#794)
  • support disabling inferring default values (#793)
  • support readonly arrays for roles of @Authorized decorator (#935)
  • add sync version of buildTypeDefsAndResolvers function (#803)

Fixes

  • Breaking Change: properly emit types nullability when defaultValue is provided and remove ConflictingDefaultWithNullableError error (#751)
  • allow defining extension on field resolver level for fields also defined as a property of the class (#776)
  • fix throwing error when schema with dynamic default value was built again (#787)
  • fix converting inputs with fields of nested array type (#801)
  • disable broken exposing input types fields under a changed name via @Field({ name: "..." })

Others

  • Breaking Change: update graphql-js peer dependency to ^15.5.0
type-graphql - 1.1.1

Published by MichalLytek almost 4 years ago

Fixes

  • fix crashing when of union's or interface type's resolveType function returns undefined or null (#731)
  • fix crashing when no reflected type available for fields with params decorators (#724)
  • fix not registering object types implementing interface type when interface type is used as object type field type (#736)
  • properly transform nested array of input type classes (#737)
type-graphql - 1.1.0

Published by MichalLytek about 4 years ago

Features

  • allow passing custom validation function as validate option to buildSchema
  • support defining deprecation reason and description of enum members (#714)

Fixes

  • Breaking Change: throw error when wrong type of value provided as arg or input for GraphQLISODateTime and GraphQLTimestamp scalars
  • don't include in schema the fields declared as @FieldResolver when that resolvers classes aren't provided in resolvers array
  • fix grammar in CannotDetermineGraphQLTypeError error message
  • properly inherit extensions from parent class and its fields
type-graphql - 1.0.0

Published by MichalLytek about 4 years ago

Features

  • Breaking Change: emit in schema only types actually used by provided resolvers classes (#415)
  • Breaking Change: update graphql-js peer dependency to ^15.3.0
  • Breaking Change: update graphql-query-complexity dependency to ^0.7.0 and drop support for fieldConfigEstimator (use fieldExtensionsEstimator instead)
  • Breaking Change: introduce sortedSchema option in PrintSchemaOptions and emit sorted schema file by default
  • Breaking Change: make class-validator a peer dependency of version >=0.12.0 that needs to be installed manually (#366)
  • Breaking Change: remove CannotDetermineTypeError and make other error messages more detailed and specific
  • Breaking Change: remove legacy array inference - now explicit array syntax ([Item]) is required
  • update TypeResolver interface to match with GraphQLTypeResolver from graphql-js
  • add basic support for directives with @Directive() decorator (#369)
  • add possibility to tune up the performance and disable auth & middlewares stack for simple field resolvers (#479)
  • optimize resolvers execution paths to speed up a lot basic scenarios (#488)
  • add @Extensions decorator for putting metadata into GraphQL types config (#521)
  • add support for defining arguments and implementing resolvers for interface types fields (#579)
  • add { autoRegisterImplementations: false } option to prevent automatic emitting in schema all the object types that implements used interface type (#595)
  • allow interfaces to implement other interfaces (#602)
  • expose createResolversMap utility that generates apollo-like resolvers object
  • support IoC containers which .get() method returns a Promise of resolver instance
  • update deps to newest major versions (tslib, graphql-query-complexity)

Fixes

  • Breaking Change: stop returning null for GraphQLTimestamp and GraphQLISODateTime scalars when returned value is not a Date instance - now it throws explicit error instead
  • Breaking Change: fix transforming and validating nested inputs and arrays (#462)
  • refactor union types function syntax handling to prevent possible errors with circular refs
  • remove duplicated entries for resolver classes that use inheritance (#499)
  • fix using name option on interface fields (#567)
  • fix not calling authChecker during subscribe phase for subscriptions (#578)
  • fix using shared union type in multiple schemas
  • fix using shared interface type in multiple schemas
  • fix calling field resolver without providing resolver class to buildSchema
  • fix generated TS union type for union type of object type classes extending themselves (#587)
  • fix using shared union and interface types in multiple schemas when resolveType is used
  • properly inherit directives while extending @InputType or @ObjectType classes (#626)
  • skip transforming empty array items into input classes

Others

  • Breaking Change: change build config to ES2018 - drop support for Node.js < 10.3
  • Breaking Change: remove deprecated DepreciationOptions interface
  • Breaking Change: remove deprecated direct array syntax for declaring union types
type-graphql - 1.0.0-rc.3

Published by MichalLytek over 4 years ago

Features

  • Breaking Change: remove legacy array inference - now explicit array syntax ([Item]) is required
  • Breaking Change: update graphql-js peer dependency to ^15.1.0
  • update deps to newest major versions (tslib, graphql-query-complexity)
type-graphql - 1.0.0-rc.2

Published by MichalLytek over 4 years ago

Features

  • expose createResolversMap utility that generates apollo-like resolvers object
  • support IoC containers which .get() method returns a Promise of resolver instance

Fixes

  • properly inherit directives while extending @InputType or @ObjectType classes (#626)
  • skip transforming empty array items into input classes
type-graphql - 1.0.0-rc.1

Published by MichalLytek over 4 years ago

Features

  • Breaking Change: emit in schema only types actually used by provided resolvers classes (#415)
  • Breaking Change: update graphql-js peer dependency to ^15.0.0
  • Breaking Change: update graphql-query-complexity dependency to ^0.5.0 and drop support for fieldConfigEstimator (use fieldExtensionsEstimator instead)
  • Breaking Change: introduce sortedSchema option in PrintSchemaOptions and emit sorted schema file by default
  • Breaking Change: make class-validator a peer dependency of version >=0.12.0 that needs to be installed manually (#366)
  • Breaking Change: remove CannotDetermineTypeError and make other error messages more detailed and specific
  • update TypeResolver interface to match with GraphQLTypeResolver from graphql-js
  • add basic support for directives with @Directive() decorator (#369)
  • add possibility to tune up the performance and disable auth & middlewares stack for simple field resolvers (#479)
  • optimize resolvers execution paths to speed up a lot basic scenarios (#488)
  • add @Extensions decorator for putting metadata into GraphQL types config (#521)
  • add support for defining arguments and implementing resolvers for interface types fields (#579)
  • add { autoRegisterImplementations: false } option to prevent automatic emitting in schema all the object types that implements used interface type (#595)
  • allow interfaces to implement other interfaces (#602)

Fixes

  • Breaking Change: stop returning null for GraphQLTimestamp and GraphQLISODateTime scalars when returned value is not a Date instance - now it throws explicit error instead
  • refactor union types function syntax handling to prevent possible errors with circular refs
  • fix transforming and validating nested inputs and arrays (#462)
  • remove duplicated entries for resolver classes that use inheritance (#499)
  • fix using name option on interface fields (#567)
  • fix not calling authChecker during subscribe phase for subscriptions (#578)
  • fix using shared union type in multiple schemas
  • fix using shared interface type in multiple schemas
  • fix calling field resolver without providing resolver class to buildSchema
  • fix generated TS union type for union type of object type classes extending themselves (#587)
  • fix using shared union and interface types in multiple schemas when resolveType is used

Others

  • Breaking Change: change build config to ES2018 - drop support for Node.js < 10.3
  • Breaking Change: remove deprecated DepreciationOptions interface
  • Breaking Change: remove deprecated direct array syntax for declaring union types
type-graphql - 0.17.6

Published by MichalLytek almost 5 years ago

Fixes

  • fix leaking resolver source code in MissingSubscriptionTopicsError error message (#489)
type-graphql - 0.17.5

Published by MichalLytek about 5 years ago

Features

  • rename DepreciationOptions interface to DeprecationOptions and deprecate the old one
  • update deps to newest minor versions (tslib, semver, graphql-query-complexity and glob)
  • support nested array types (@Field(type => [[Int]])) (#393)
  • deprecate the direct array syntax for union types

Fixes

  • fix errors on circular refs in union types (#364) by adding the function syntax (() => TClassTypes)
type-graphql - 0.17.4

Published by MichalLytek over 5 years ago

Features

  • add support for creating custom parameter decorators (#329)
  • allow to provide custom subscribe function in @Subscription decorator (#328)
type-graphql - 0.17.3

Published by MichalLytek over 5 years ago

Features

  • update packages semver to ^6.0.0 and graphql-subscriptions to ^1.1.0

Fixes

  • fix broken compatibility with newer @types/graphql due to using removed private types (e.g. MaybePromise) (#320)
type-graphql - 0.17.2

Published by MichalLytek over 5 years ago

Features

  • add support for defining resolveType function for interfaces and unions (#319)
  • add support for setting default nullability for fields and return types (#297)
  • add skipCheck option in buildSchema to disable checking the correctness of a schema
  • add postinstall script for printing info on console about supporting the project

Fixes

  • fix generating plain resolvers for queries and mutations (compatibility with Apollo client state)
type-graphql - 0.17.1

Published by MichalLytek over 5 years ago

Features

  • add support for emitting schema file in not existing directory (#269)
  • drop support for Node.js v6 (end of LTS in April 2019)

Fixes

  • fix typings discovery support for WebStorm (#276)
  • allow for returning plain objects when using ObjectTypes that implements InterfaceTypes or extends other classes (#160)
type-graphql - 0.17.0

Published by MichalLytek over 5 years ago

Features

  • Breaking Change: make graphql-js packages a peer dependencies, bump graphql to ^14.1.1 and @types/graphql to ^14.0.7 (#239)
  • Breaking Change: remove useContainer function and allow to register container by buildSchema options (#241)
  • Breaking Change: change the default PrintSchemaOptions option commentDescriptions to false (no more # comments in SDL)
  • add support for passing PrintSchemaOptions in buildSchema.emitSchemaFile (e.g. commentDescriptions: true to restore previous behavior)
  • add buildTypeDefsAndResolvers utils function for generating apollo-like typeDefs and resolvers pair (#233)
  • add support for generic types (#255)

Fixes

  • Breaking Change: remove the formatArgumentValidationError helper as it's not compatible and not needed in new Apollo Server (#258)
  • fix calling return type getter function @Field(type => Foo) before finishing module evaluation (allow for extending circular classes using require)
  • fix nullifying other custom method decorators - call the method on target instance, not the stored reference to original function (#247)
  • fix throwing error when extending non args class in the @ArgsType() class
  • prevent unnecessary conversion of an object that is already an instance of the requested type (avoid constructor side-effects)
type-graphql - 0.16.0

Published by MichalLytek almost 6 years ago

Features

  • add support for default values in schema (#203)
  • add support for lists with nullable items (#211)

Fixes

  • fix browser shim (compatibility with polyfills for decorator support)
type-graphql - 0.15.0

Published by MichalLytek about 6 years ago

Features

  • Breaking Change: upgrade graphql to ^14.0.2, graphql-subscriptions to ^1.0.0 and @types/graphql to ^14.0.2
  • update all other dependencies
  • drop support for Node.js v9
  • add capability to emit the schema definition file (*.gql) as a buildSchema option
  • add emitSchemaDefinitionFile helper function for emitting the schema SDL
type-graphql - 0.14.0

Published by MichalLytek about 6 years ago

Features

  • Breaking Change: change ClassType type and export it in package index
  • Breaking Change: refactor generic createUnionType to remove the 10 types limit (note: requires TypeScript >=3.0.1)
  • add support for subscribing to dynamic topics - based on args/ctx/root (#137)
  • add support for query complexity analysis - integration with graphql-query-complexity (#139)
Package Rankings
Top 0.67% on Npmjs.org
Top 3.73% on Proxy.golang.org
Badges
Extracted from project README
release website codeql discord codecov npm open collective donate donate become a sponsor Members GitHub Sponsors