Skip to content

Commit

Permalink
activity: Add __init__.py file and news cover in API
Browse files Browse the repository at this point in the history
  • Loading branch information
harshithpabbati committed Jun 19, 2020
1 parent 7134512 commit 3a97787
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
Empty file added activity/__init__.py
Empty file.
4 changes: 4 additions & 0 deletions activity/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ class NewsObj(graphene.ObjectType):
tags = graphene.List(TagObj)
pinned = graphene.Boolean()
description = graphene.String(required=True)
cover = graphene.String(required=True)

def resolve_title(self, info):
return self['title']
Expand All @@ -56,6 +57,9 @@ def resolve_tags(self):
name=F('tags__name'),
).filter(id=self['id'])

def resolve_cover(self, info):
return self['cover']


class Query(graphene.ObjectType):
news = graphene.List(NewsObj, slug=graphene.String())
Expand Down

0 comments on commit 3a97787

Please sign in to comment.