I'm rebuilding a former Django REST API project as a GraphQL one. I now have queries & mutations working properly.
Most of my learning came from looking at existing Graphene-Django & Graphene-Python code samples. There seem to be a lot of inconsistencies amongst them.
In some it was suggested that the GraphQL queries should be placed in
There aren't any conventions yet, since GraphQL is a fairly new alternative method to REST. Thus, "conventions" are created at the moment we speak.
schema is general-defined term you may rename it to
This is my project structure:
django_proj/ manage.py requirements.txt my_app/ __init__.py migrations/ admin.py schema/ __init__.py schema.py # holds the class Query. The GraphQL endpoints, if you like types.py # holds the DjangoObjectType classes inputs.py # holds the graphene.InputObjectType classes (for defining input to a query or mutation) mutations.py # holds the mutations (what else?!)
__init__) could be renamed to
queries.py if you like. There is no much big difference between these two words.