ra-data-hasura patch for get_many_reference (#1419)

* fix get_many_reference definition

* update package version

* update changelog and github url
This commit is contained in:
Praveen Durairaj 2019-01-20 10:25:45 +05:30 committed by Shahidh K Muhammed
parent 2022091391
commit 964645cbb1
3 changed files with 15 additions and 8 deletions

View File

@ -0,0 +1,7 @@
## 0.0.2 (January 20, 2019)
### Bug Fix: GET_MANY_REFERENCE definition
## 0.0.1 (January 19, 2019)
### Add support for hasura data provider

View File

@ -1,6 +1,6 @@
{
"name": "ra-data-hasura",
"version": "0.0.1",
"version": "0.0.2",
"description": "react-admin data provider for Hasura GraphQL Engine",
"main": "lib/ra-data-hasura.min.js",
"scripts": {
@ -24,7 +24,7 @@
"bugs": {
"url": "https://github.com/hasura/graphql-engine/issues"
},
"homepage": "https://github.com/hasura/graphql-engine",
"homepage": "https://github.com/hasura/graphql-engine/tree/master/community/tools/ra-data-hasura",
"devDependencies": {
"@babel/cli": "^7.0.0-beta.51",
"@babel/core": "^7.0.0-beta.51",

View File

@ -103,12 +103,12 @@ export default (serverEndpoint, headers) => {
const finalManyQuery = cloneQuery(selectQuery);
const finalManyCountQuery = cloneQuery(countQuery);
finalSelectQuery.args.table = resource;
finalSelectQuery.args.limit = params.pagination.perPage;
finalSelectQuery.args.offset = (params.pagination.page * params.pagination.perPage) - params.pagination.perPage;
finalSelectQuery.args.where = { [params.target]: params.id };
finalSelectQuery.args.order_by = {column: params.sort.field, type: params.sort.order.toLowerCase()};
finalCountQuery.args.table = resource;
finalManyQuery.args.table = resource;
finalManyQuery.args.limit = params.pagination.perPage;
finalManyQuery.args.offset = (params.pagination.page * params.pagination.perPage) - params.pagination.perPage;
finalManyQuery.args.where = { [params.target]: params.id };
finalManyQuery.args.order_by = {column: params.sort.field, type: params.sort.order.toLowerCase()};
finalManyCountQuery.args.table = resource;
finalQuery = cloneQuery(bulkQuery);
finalQuery.args.push(finalManyQuery);
finalQuery.args.push(finalManyCountQuery);