mirror of
https://github.com/graphql-python/graphene-django.git
synced 2025-07-13 17:52:19 +03:00
Update docs to include __all__
option
This commit is contained in:
parent
4c10afba88
commit
5662a040b9
|
@ -63,6 +63,17 @@ Show **only** these fields on the model:
|
||||||
model = Question
|
model = Question
|
||||||
fields = ('id', 'question_text')
|
fields = ('id', 'question_text')
|
||||||
|
|
||||||
|
You can also set the ``fields`` attribute to the special value ``'__all__'`` to indicate that all fields in the model should be used.
|
||||||
|
|
||||||
|
For example:
|
||||||
|
|
||||||
|
.. code:: python
|
||||||
|
|
||||||
|
class QuestionType(DjangoObjectType):
|
||||||
|
class Meta:
|
||||||
|
model = Question
|
||||||
|
fields = '__all__'
|
||||||
|
|
||||||
|
|
||||||
``exclude``
|
``exclude``
|
||||||
~~~~~~~~~~~
|
~~~~~~~~~~~
|
||||||
|
|
Loading…
Reference in New Issue
Block a user