Open haf opened 4 years ago
You need to import all the methods name like this at the top code
import {
CREATE,
DELETE,
DELETE_MANY,
GET_LIST,
GET_MANY,
GET_MANY_REFERENCE,
GET_ONE,
UPDATE,
UPDATE_MANY,
} from 'react-admin';
after the export it like this:
export default buildDataProvider({
client,
buildQuery,
}).then((dataProviderHasura) => ({
getList: (resource, params) => dataProviderHasura(GET_LIST, resource, params),
getOne: (resource, params) => dataProviderHasura(GET_ONE, resource, params),
getMany: (resource, params) => dataProviderHasura(GET_MANY, resource, params),
getManyReference: (resource, params) =>
dataProviderHasura(GET_MANY_REFERENCE, resource, params),
update: (resource, params) => dataProviderHasura(UPDATE, resource, params),
updateMany: (resource, params) =>
dataProviderHasura(UPDATE_MANY, resource, params),
create: (resource, params) => dataProviderHasura(CREATE, resource, params),
delete: (resource, params) => dataProviderHasura(DELETE, resource, params),
deleteMany: (resource, params) =>
dataProviderHasura(DELETE_MANY, resource, params),
}));
The npm package should export all those functions, isn't? because this: ra-data-hasura-graphql/src/*
won't work
@gengue is correct. Currently, there is no way to import these from npm package as src/*
is part of .npmignore
and isn't published to npm at all.
To remedy this, I ended up git cloning src/*
to a local sub dir and import from there instead. This is far from ideal, but it works.
With