Releases: Adrinalin4ik/Nestjs-Graphql-Tools
Releases · Adrinalin4ik/Nestjs-Graphql-Tools
Version 0.7.20
- Bump deps
Version 0.7.(18 - 19)
- Vulnurability fixes
Version 0.7.17
- Added ability to override decorators' values. This might be useful for unit tests.
Version 0.7.16
- Removed the necessity of having the second argument in the FilterField decorator.
- Typeform bumped.
Version 0.7.15
- Where the condition didn't work properly with null. This patch fixes nulls statements and allows to put nulls in the
eq
andneq
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
- Vulnerabilities fixes
- Updated typization for helpers
Version 0.7.13
- 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
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
- Updated keywords
Version 0.7.9
- 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"