Last active
November 12, 2019 13:52
-
-
Save erebus1/872dd946ac3c35bff0ed8f5d9f604b75 to your computer and use it in GitHub Desktop.
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
from graphene import ObjectType, Int, List, String, Field, NonNull | |
from graphene_federation import build_schema, extend, external | |
@extend(fields='id') | |
class FileNode(ObjectType): | |
id = external(Int(required=True)) | |
class MessageNode(ObjectType): | |
id = Int(required=True) | |
thread_id = Int(required=True) | |
author_id = Int() | |
files = List(NonNull(FileNode)) | |
body = String(required=True) | |
class Query(ObjectType): | |
message = Field(lambda: MessageNode, id=Int()) | |
schema = build_schema(Query) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment