Skip to content
Snippets Groups Projects
Commit a624539e authored by Albert Feghaly's avatar Albert Feghaly
Browse files

Add my_profile graphql query field

parent 734eb75c
No related branches found
No related tags found
2 merge requests!106Dev,!104Resolve "Need an option for Profiles to only return user info"
...@@ -89,11 +89,18 @@ class Query(graphene.ObjectType): ...@@ -89,11 +89,18 @@ class Query(graphene.ObjectType):
in_id_list=graphene.List(graphene.String) in_id_list=graphene.List(graphene.String)
) )
datasets = graphene.List(DataSetType, in_id_list=graphene.List(graphene.String)) datasets = graphene.List(DataSetType, in_id_list=graphene.List(graphene.String))
lab = graphene.Field(LabType, name=graphene.String(), dbid=graphene.ID()) lab = graphene.Field(
LabType,
name=graphene.String(),
dbid=graphene.ID()
)
labs = graphene.List( labs = graphene.List(
LabType, LabType,
in_name_list=graphene.List(graphene.String) in_name_list=graphene.List(graphene.String)
) )
my_profile = graphene.Field(
ProfileType
)
profiles = graphene.List( profiles = graphene.List(
ProfileType, ProfileType,
in_email_list=graphene.List(graphene.String) in_email_list=graphene.List(graphene.String)
...@@ -190,6 +197,9 @@ class Query(graphene.ObjectType): ...@@ -190,6 +197,9 @@ class Query(graphene.ObjectType):
return qs.distinct() return qs.distinct()
def resolve_my_profile(self, info, **kwargs):
return Profile.objects.get(user__email=info.context.user.email)
def resolve_profiles(self, info, **kwargs): def resolve_profiles(self, info, **kwargs):
email_list = kwargs.get('in_email_list') email_list = kwargs.get('in_email_list')
qs = Profile.objects.all() qs = Profile.objects.all()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment