-
Notifications
You must be signed in to change notification settings - Fork 11
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
Docs or instructions to deal with Many to many fields #51
Comments
Similar to the deletion, I created manytomany resolver helpers. Again, this is stuff lacking testing and documentation on how to use (and possibly proprietary code) so it hasn't been added to the project. The good part is this makes adding a new set of m2m relationships easy. The bad part is there's a bunch of undocumented dependencies like adding a mixin to a model and making sure specific properties are set on said model to make the magic work. This works just fine in practice, but is problematic as heck when onboarding a new dev.
Note that this stuff requires a mixin on the models as well:
With some reference implementations:
|
Neat I think something like this would be good to put in, especially if users of the library is writing less code than Strawberry. Maybe it would be useful to lay out something like the class based views in Django to load in mixins for the Query and mutations that are optional for users. I am willing to add docs if you know what format it needs to be in. I did some of the docs for graphene early on but I don't use github all the time so I might have issues on Pull request. I guess the layout for docs should be something like this:
|
If you want to put together the skeleton of this stuff, I'm happy to share the examples from Lexria's codebase in the docs... just not employed there any longer and don't have the time/will to productionize that for everyone. |
@maxmorlocke Ok I will start working on some .rst files I did a PR for the docs for types it needs some work |
Pull request |
@maxmorlocke ok I added 3 Pull request one for permissions, types, and queries. They are all .rst files I accidentally saved a markdown version as an rst but it is fixed now. |
Thanks, they should all be merged. |
Are there any examples of how to deal with Manytomany fields?
Do I have to write a query to prefetch choice fields when updating the fields?
The text was updated successfully, but these errors were encountered: