react-admin-amplify icon indicating copy to clipboard operation
react-admin-amplify copied to clipboard

export data and auth providers

Open deniszatsepin opened this issue 4 years ago • 2 comments

Hi guys, thanks for this great extension for ReactAdmin. I want to suggest a small improvement. Currently, it's not possible to extend providers (and we need to have some custom mutations). We have types of DataProvider and AuthProvider but there is no JavaScript exported for these classes. Thank you!

deniszatsepin avatar Nov 10 '21 08:11 deniszatsepin

Hi @deniszatsepin, thanks for the suggestion.

I have a question though: why not using buildAuthProvider and buildDataProvider in order to get the providers and then extend them following react-admin documentation?

MrHertal avatar Nov 14 '21 21:11 MrHertal

Hi @MrHertal, thanks for your response.

I've tried to use buildDataProvider and extend it as a first step, but it didn't work out in my case. I need to have a custom graphql call - approveResource. In buildDataProvider, only a subset of methods is exported and it does not allow access to the DataProvider class itself. So, I can't introduce a new method and call public graphql() of the DataProvider, because I don't have this linked to the DataProvider class instance. Probably there is another way to achieve what I need.

deniszatsepin avatar Nov 15 '21 13:11 deniszatsepin