-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ReferenceManyField implementation #29
Comments
Hi there! Is this to support many-to-many relationships? |
@lapidus for a simple and slow example you could
make sure to also export the many_to_many Resource, btw. you can export an array
|
Thanks, great! Will try when I get past the initial hurdle of "buildHasuraProvider". It's giving me a bit of a hard time ... 😅 |
Hm, can't get it to work exactly. If I am trying to display topics for blog posts and the "bridge table" looks like this, what should I do? Thx! blog_post_topic Also, why do I need to export those Resources and where? I basically just want to add the many-to-many items in my listing view and edit view. |
In my example above I am rendering a query which would look like
the dataProvider will load the glueing part, and then the corresponding label / topic.. |
Thanks for all the help, now it works with the display! Do you by any chance have experience with the AutoComplete? From a topic edit view, I can get it to display my articles. But I can't:
My current implementation looks something like this:
|
I am looking a fix for this because but we shouldn't use it the ReferenceManyField + RefenceField on that way, it makes a tons of request for a data grid. something like this:
|
Great! Thanks! Might also simplify this? |
The solution is described in the documentation: https://github.com/Steams/ra-data-hasura-graphql#example-query-related-entities But those functions aren't exported in the library :( |
Hi @Steams
Just got started with this project. Looks great till now. Many thanks :).
I came to a point where I used a ReferenceManyField in list view. This component fetches a list of referenced records by reverse lookup of the current record.id in other resource (dataProvider.getManyReference()).
Looking at the n/w calls, it seems like the implementation is making 1 call for each (current) record in the list. I think it can be collapsed to a single call by using the 'in' operator.
Can you kindly take a look?
Thanks
The text was updated successfully, but these errors were encountered: