agateblue / django-dynamic-preferences

Dynamic global and instance settings for your django project
https://django-dynamic-preferences.readthedocs.org/
BSD 3-Clause "New" or "Revised" License
346 stars 86 forks source link

Add support for Graphene-Django #282

Open Natureshadow opened 2 years ago

Natureshadow commented 2 years ago

In addition to the REST API support, support for GraphQL would be good.

  1. Define queries and mutations for the GraphQL schema in api/schema.py
  2. Re-use the REST API serializers
  3. Make sure the GraphQL queris and mutations use the same permission checks as the REST API viewsets do
  4. Add documentation on how to inject the queries and mutations into the project schema
agateblue commented 2 years ago

I've give it some thoughts and I think it should be done outside of the project: I have no experience with GraphQL and won't be able to test and maintain such a feature properly. As far as I can tell, one could do all the steps you describe in their own project, or in a dedicated, reusable package.

However, even if I'd rather not add direct support for graphql and dependencies in django-dynamic-preferences, we could definitely add a section in the documentation to explain how to do so, e.g with code snippets. I have no issue with reviewing and merging such a contribution, since it will be low maintainance :)

Natureshadow commented 2 years ago

Being a co-maintainer on this package, I was intending to take on the maintenance of this feature. I cannot do much on the whole project currently, but adopting on separate part is feasible.

agateblue commented 2 years ago

If you feel like implementing and maintaining it, it's a different story then. I can't provide much guidance on the GraphQL aspects, but I'm up to review or help with other aspects of your work :)