-
Notifications
You must be signed in to change notification settings - Fork 32
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
Support many-to-many in a simple way? #119
Comments
I don't have any plans to implement this due to the level of effort required. Sorry! If anyone wants to take a shot at it, these three files contain most of the necessary logic: |
@mattbretl my company would be willing to pay to get this feature done (as open sourced of course👍), is this a possibility? |
I have a data model that definitely involve many-to-many relations. We used to use Prisma and many-to-many relations used to be fairly straightforward, just like one-to-many or one-to-one relations basically. Now with Graphile we have to add one "layer" of nesting in query fields arguments every time we have many-to-many relations, while one-to-many or one-to-one relations are fine on the other hand. Basically in Prisma, 1-1, 1-m, and m-m were treated the same way. In Graphile, 1-1 an 1-m are treated that same way, but m-m are treated in their own different way (with 1 level of nesting in query parameters). That additional level of nesting is not present on selection sets, thanks to the many-to-many plugin. So it strikes me as odd that the plugin solves half the problem (selection sets) while leaving the other half open (mutations and query parameters) The end result in our API is something some internally already start to call "nesting hell": This is the API we used to have and that we wished we could get with a plugin: |
Right now this plugin does not support many-to-many relations simply. You have to go through the relation table in GraphQL query, which is not ideal, or at least not consistent with the behaviour of Prisma that we are migrating away from.
The many-to-many plugin ( https://github.com/graphile-contrib/pg-many-to-many ) support this, but only in GraphQL selection sets, not in query arguments.
Is there any way or plan to support the simplification of many-to-many filters in this plugin?
The text was updated successfully, but these errors were encountered: