You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I wasn't sure if I should put this here or on the ra-data-graphql-simple repo. I'm not even sure if this is an actual bug or just me doing something wrong.
What you were expecting:
I was expecting cacheDataProviderProxy's get() to be called when used with graphql. I notice that every Edit performs a get and I want to use the cacheDataProviderProxy to prevent that.
What happened instead:
I've added several logs and none of them are being called. I verified my logs are there in the browser, and they are.
Screenshot collapsed, click to expand.
Steps to reproduce:
Using the default code in the ra-data-graphql-simple readme with the addition of the cacheDataProviderProxy.
Code collapsed, click to expand.
import*asReactfrom'react';import{Component}from'react';importbuildGraphQLProviderfrom'ra-data-graphql-simple';import{Admin,cacheDataProviderProxy}from'react-admin';classAppextendsComponent{constructor(props){super(props);this.state={dataProvider: null};}componentDidMount(){// 👇 This is where I added the `cacheDataProviderProxy()` 👇 buildGraphQLProvider({clientOptions: {uri: 'http://localhost:4000/graphql'}}).then(dataProvider=>this.setState({dataProvider: cacheDataProviderProxy(dataProvider)}));}render(){const{ dataProvider }=this.state;if(!dataProvider){return<div>Loading</div>;}return(<AdmindataProvider={dataProvider}></Admin>);}}exportdefaultApp;
Environment
React-admin version: 3.16.6 (waiting for material-ui fix)
Last version that did not exhibit the issue (if applicable): N/A
React version: 17.0.2
Browser: Chrome
Stack trace (in case of a JS error): N/A
The text was updated successfully, but these errors were encountered:
Sorry I closed that too fast. This is because the graphql dataproviders have not been updated to the new dataProvider format. They still return a single function instead of an object. Flagging this as an enhancement
If nobody picks this up I'll see if I can tackle this next time I work on this project. How hard can it be, right. Sounds like the function is replaced by an object literal where the previous action argument is now the key. Is that correct?
I wasn't sure if I should put this here or on the ra-data-graphql-simple repo. I'm not even sure if this is an actual bug or just me doing something wrong.
What you were expecting:
I was expecting cacheDataProviderProxy's
get()
to be called when used with graphql. I notice that every Edit performs a get and I want to use the cacheDataProviderProxy to prevent that.What happened instead:
I've added several logs and none of them are being called. I verified my logs are there in the browser, and they are.
Screenshot collapsed, click to expand.
Steps to reproduce:
Using the default code in the ra-data-graphql-simple readme with the addition of the cacheDataProviderProxy.
Code collapsed, click to expand.
Environment
The text was updated successfully, but these errors were encountered: