Update package dependencies to include security fixes for several dev dependencies
Updated package dependencies to include security fixes for lodash
Bug where different queries can have the same cache key due to identical field sets. Can now be avoided by using different table aliases in your resolver.
Add sqlJoinAlias
option to ConfigureLoader
so users can specify the alias of a given table's join in the SQL query.
Not all types were not being exported properly. This should be addressed.
DecoratorResolverPredict was getting an empty list for requested fields. This was a bug introduced during the refactor of the InfoParser and has been fixed.
graphQLName
option to ConfigureLoader
decorator. Allows consumers to specify the name of a TypeORM
entity field in the GraphQL schema so that it is properly selected if requested.
The GraphQLQueryBuilder#orWhere
method now accepts an instance of Brackets as a parameter. This brings the loader back into parity with the TypeORM SelectQueryBuilder#orWhere
method.
GraphQLQueryBuilder#ejectQueryBuilder
method that accepts a callback which can be used to customize the TypeORM SelectQueryBuilder instance before executing against the database.
Fixed an issue with the loader not being able to load fragments on Union types. Thanks to Nico Britos for providing the fix for the issue.
Internally the loader now uses the graphql-parse-resolve-info package to get the requested selection of fields instead of the home-grown method used before.
Some internal loader type definitions have changed due to the migration to the new info parser. It is for this reason I bumped the package a minor version over just a patch.
Queries are no longer run in a transaction, preventing a transaction error in some dbs. Thanks to Andrey Vasilev for identifying the issue and providing the fix.
Fixed issue with pagination manifesting from internal TypeORM bug in skip/take. Reverted back to using offset/limit
Paginated records with order by conditions could come back in the incorrect order due to an internal TypeORM. A different TypeORM bug prevented the loader from using the suggested skip/take
TypeORM API. That skip/take
bug has been fixed, so the loader is able to switch to skip/take
and address the ordering bug.
The ignore
and requried
options in the ConfigureLoader
decorator now also accept a predicate function in addition to primitive booleans. If given, the predicate function will be called at resolve time of that field during the GraphQL query resolution. For more information, read the documentation
Updated package dependencies and peer dependencies to latest versions
A new context
method to the GraphQLQueryBuilder that receives a user defined context and passes it to the configuration decorator predicates at resolve time. See the documentation.
A new decorator called ConfigureLoader
that allows for more control over how entity fields/relations are resolved by the loader. For the initial version, the decorator allows you to ignore or require fields/embeds/relations during query resolution. This is still experimental and may require some hardening. For more information, see the documentation
GraphQLQueryBuilder#selectFields
. This was always a rather flaky solution to the problem it was trying to solve. With the release of the configuration decorator, I don't plan on supporting or fixing any bugs with this anymore. Once the decorator API is solidified, this will be removed in a 2.0 release.
- Changelog
-
Fixed an issue with table aliases growing too long. The QueryBuilder now generates a hash for any tables that are joined during query resolution. See The Gitlab Issue for more details. Thanks to Kees van Lierop and Roemer Bakker for the fix.
-
The loader now uses the entity metadata to query the primary key column for each relation joined, regardless of whether the field was queried. This is to ensure that custom resolvers can access the parent object with at least the primary key. This renders the
primaryKeyColumn
option inLoaderOptions
obsolete.
primaryKeyColumn
field inLoaderOptions
. See changes for reasoning.
- Issue with the loader not being able to query columns that had a different name from the entity propertyName
- Support for querying fields from embedded entities
- The
GraphQLQueryBuilder#info()
method to support using a path to fetch a nested field as entity root
- Initial full release
- Full refactor of codebase to a query-builder format.
- Created a documentation website