-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Creating user successfully, now need to protect the routes
- Loading branch information
1 parent
d9d8c2b
commit 7fff6cc
Showing
7 changed files
with
34 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
from django.contrib import admin | ||
from account.models import User | ||
from django.contrib.auth.admin import UserAdmin | ||
|
||
# Register your models here. | ||
admin.site.register(User) | ||
# admin.site.register(User, UserAdmin) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import graphene | ||
from graphene_django import DjangoObjectType | ||
from .queryTypes import GetUserType | ||
from ..models import User | ||
|
||
class Query(graphene.ObjectType): | ||
users = graphene.List(GetUserType) | ||
question_by_id = graphene.Field(GetUserType, id=graphene.String()) | ||
|
||
def resolve_users(root, info, **kwargs): | ||
return User.objects.all() | ||
|
||
def resolve_user_by_id(root, info, id): | ||
return User.objects.get(pk=id) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters