Reputation: 7675
Curious if I constructed and tracked this m2m relationship correctly. Seems strange that every object in those arrays are named "user": {...}
or "pip": {...}
Seems like these both should work
Update with screenshots:
Upvotes: 0
Views: 283
Reputation: 21157
There's currently no automatic way to "hide" the join table from the GraphQL query and response. You need to traverse through the join table to get back the results you want from both directions so you can't avoid it using the default generated API.
It is possible to extend the GraphQL API using SQL Views if you want to try and "flatten" things from the perspective of people consuming this data.
Alternatively, I'd recommend calling the relationship something different to make it obvious that you're navigating through a join table. I'd recommend actually calling the relationship user_pips
instead of pips
as it makes it more clear what you're actually retrieving.
Upvotes: 1