Skip to content

Releases: Adrinalin4ik/Nestjs-Graphql-Tools

Version 0.7.20

03 Jul 05:55
Compare
Choose a tag to compare
  • Bump deps

Version 0.7.(18 - 19)

13 Jun 05:32
Compare
Choose a tag to compare
  • Vulnurability fixes

Version 0.7.17

05 May 11:59
Compare
Choose a tag to compare
  • Added ability to override decorators' values. This might be useful for unit tests.

Version 0.7.16

18 Apr 14:23
Compare
Choose a tag to compare
  • Removed the necessity of having the second argument in the FilterField decorator.
  • Typeform bumped.

Version 0.7.15

18 Apr 14:03
Compare
Choose a tag to compare
  • Where the condition didn't work properly with null. This patch fixes nulls statements and allows to put nulls in the eq and neq operators.

Example:

{
  users(where: {phone: { neq: null }}) {
    id
    fname
  }
}

This query will generate select * from 'user' where phone is not null.

  • Null operator now works properly.

Version 0.7.14

11 Apr 06:06
Compare
Choose a tag to compare
  • Vulnerabilities fixes
  • Updated typization for helpers

Version 0.7.13

06 Apr 13:14
Compare
Choose a tag to compare
  • Fixes for enums. Before, enums generated nulls in the schema because they don't have names in their objects as most objects have. New approach fetching names of enums from the graphql type storage directly.

Version 0.7.11

05 Apr 09:55
Compare
Choose a tag to compare

This doesn't change API.

  • This change is for a better development experience. Default arguments with name field were removed from the schema. Now, in order to determine the index of filter or sorting argument uses metadata.
  • This change is fixing hasura's remote schema permissions as before it didn't pass validation because of default values with name.
  • Also this change removes unnecessary checks in the resolver. Before, in order to use order_by you have to check if argument is provided. Now you don't need to do that.

Before it was

  @Query(() => [UserObjectType])
  @GraphqlFilter()
  @GraphqlSorting()
  users(
    @Filter(() => [UserObjectType, UserFilterInputType], {sqlAlias: 'u'}) filter: Brackets,
    @Sorting(() => [UserObjectType, UserSortingInputType], { sqlAlias: 'u' }) sorting: SortArgs<UserObjectType>
  ) {
    const qb = this.userRepository.createQueryBuilder('u')
      .leftJoin('task', 't', 't.assignee_id = u.id')
      .where(filter);
      
      if (sorting) { // you have to check if the argument was passed
        qb.orderBy(sorting)
      }

    return qb.getMany()
  }

After

  @Query(() => [UserObjectType])
  @GraphqlFilter()
  @GraphqlSorting()
  users(
    @Filter(() => [UserObjectType, UserFilterInputType], {sqlAlias: 'u'}) filter: Brackets,
    @Sorting(() => [UserObjectType, UserSortingInputType], { sqlAlias: 'u' }) sorting: SortArgs<UserObjectType>
  ) {
    const qb = this.userRepository.createQueryBuilder('u')
      .leftJoin('task', 't', 't.assignee_id = u.id')
      .where(filter)
      .orderBy(sorting)

    return qb.getMany()
  }

Version 0.7.10

21 Feb 02:50
Compare
Choose a tag to compare
  • Updated keywords

Version 0.7.9

21 Feb 02:40
Compare
Choose a tag to compare
  • Before, types are being generated for each field separately, now we've added cache storage where we're storing similar types. This change made generated scheme significantly smaller. From the interface perspective, the name of the where filter property types were changed. Before, it was "${fieldName}_${modelName}_PropertyFilterInputType" now it is "${fieldType}_PropertyFilterInputType"