Skip to content

Instantly share code, notes, and snippets.

@nderkach
Last active November 26, 2017 11:09
Show Gist options
  • Save nderkach/b460af54ef238b9435ca708e174d5e86 to your computer and use it in GitHub Desktop.
Save nderkach/b460af54ef238b9435ca708e174d5e86 to your computer and use it in GitHub Desktop.
Graphene schema for Airbnb reviews
from graphene import ObjectType, String, Boolean, ID, Field, Int
class User(ObjectType):
first_name = String()
has_profile_pic = Boolean()
id = ID()
picture_url = String()
smart_name = String()
thumbnail_url = String()
class Listing(ObjectType):
id = ID()
name = String()
class Review(ObjectType):
author = Field(User)
author_id = ID()
can_be_edited = Boolean()
comments = String()
created_at = String()
id = Int()
language = String()
listing = Field(Listing)
listing_id = ID()
recipient = Field(User)
recipient_id = ID()
response = String()
role = String()
user_flag = Boolean()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment