Skip to content

Commit eef2841

Browse files
committed
Updated Django docs with latest changes in graphene-python PRs.
Including unmerged PR: graphql-python/graphene-python.org#5
1 parent 8f5a425 commit eef2841

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

docs/authorization.rst

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ with the context argument.
7070
def resolve_my_posts(self, args, context, info):
7171
# context will reference to the Django request
7272
if not context.user.is_authenticated():
73-
return []
73+
return Post.objects.none()
7474
else:
7575
return Post.objects.filter(owner=context.user)
7676
@@ -105,7 +105,6 @@ method to your ``DjangoObjectType``.
105105
except cls._meta.model.DoesNotExist:
106106
return None
107107
108-
if post.published or context.user is post.owner:
108+
if post.published or context.user == post.owner:
109109
return instance
110-
else:
111-
return None
110+
return None

docs/filtering.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ For example:
110110
filter_fields = ['name', 'genus', 'is_domesticated']
111111
# Either a tuple/list of fields upon which ordering is allowed, or
112112
# True to allow filtering on all fields specified in filter_fields
113-
order_by_fields = True
113+
filter_order_by = True
114114
interfaces = (relay.Node, )
115115
116116
You can then control the ordering via the ``orderBy`` argument:
@@ -134,7 +134,7 @@ Custom Filtersets
134134
By default Graphene provides easy access to the most commonly used
135135
features of ``django-filter``. This is done by transparently creating a
136136
``django_filters.FilterSet`` class for you and passing in the values for
137-
``filter_fields`` and ``order_by_fields``.
137+
``filter_fields`` and ``filter_order_by``.
138138

139139
However, you may find this to be insufficient. In these cases you can
140140
create your own ``Filterset`` as follows:

docs/introspection.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ you're ready to use Relay with Graphene GraphQL implementation.
3232
Advanced Usage
3333
--------------
3434

35+
The ``--indent`` option can be used to specify the number of indentation spaces to
36+
be used in the output. Defaults to `None` which displays all data on a single line.
37+
3538
To simplify the command to ``./manage.py graphql_schema``, you can
3639
specify the parameters in your settings.py:
3740

0 commit comments

Comments
 (0)