Skip to content
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

V0.4 #31

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open

V0.4 #31

Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions docs/settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,9 @@ default:
}
```

### USER_NODE_EXCLUDE_FIELDS
### USER_NODE_FIELDS

default: `#!python ["password", "is_superuser"]`
default: `#!python ["email", "username", "last_login", "isStaff", "isActive", "archieved", "verified", "secondary_email"]`

---

Expand Down
2 changes: 1 addition & 1 deletion graphql_auth/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class UserNode(DjangoObjectType):
class Meta:
model = get_user_model()
filter_fields = app_settings.USER_NODE_FILTER_FIELDS
exclude = app_settings.USER_NODE_EXCLUDE_FIELDS
fields = app_settings.USER_NODE_FIELDS
interfaces = (graphene.relay.Node,)
skip_registry = True

Expand Down
11 changes: 10 additions & 1 deletion graphql_auth/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,16 @@
"EMAIL_TEMPLATE_SECONDARY_EMAIL_ACTIVATION": "email/activation_email.html",
"EMAIL_TEMPLATE_PASSWORD_RESET": "email/password_reset_email.html",
# query stuff
"USER_NODE_EXCLUDE_FIELDS": ["password", "is_superuser"],
"USER_NODE_FIELDS": [
"email",
"username",
"last_login",
"isStaff",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we looking for Django field names or Node field names here? The list is inconsistent.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are the fields we want to be available in the user node.

Copy link
Collaborator

@ulgens ulgens May 25, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean, some of the fields have underscore and others are camel case.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right, I didn't see that. Should be with underscore.

"isActive",
"archieved",
"verified",
"secondary_email",
],
"USER_NODE_FILTER_FIELDS": {
"email": ["exact"],
"username": ["exact", "icontains", "istartswith"],
Expand Down