Skip to content

Use field and exclude in docs instead deprecated attrs #740

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

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions docs/authorization.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Let's use a simple example model.
Limiting Field Access
---------------------

To limit fields in a GraphQL query simply use the ``only_fields`` meta attribute.
To limit fields in a GraphQL query simply use the ``fields`` meta attribute.

.. code:: python

Expand All @@ -31,10 +31,10 @@ To limit fields in a GraphQL query simply use the ``only_fields`` meta attribute
class PostNode(DjangoObjectType):
class Meta:
model = Post
only_fields = ('title', 'content')
fields = ('title', 'content')
interfaces = (relay.Node, )

conversely you can use ``exclude_fields`` meta attribute.
conversely you can use ``exclude`` meta attribute.

.. code:: python

Expand All @@ -45,7 +45,7 @@ conversely you can use ``exclude_fields`` meta attribute.
class PostNode(DjangoObjectType):
class Meta:
model = Post
exclude_fields = ('published', 'owner')
exclude = ('published', 'owner')
interfaces = (relay.Node, )

Queryset Filtering On Lists
Expand Down Expand Up @@ -133,7 +133,7 @@ method to your ``DjangoObjectType``.
class PostNode(DjangoObjectType):
class Meta:
model = Post
only_fields = ('title', 'content')
fields = ('title', 'content')
interfaces = (relay.Node, )

@classmethod
Expand Down