Created
August 30, 2017 04:46
-
-
Save brandf/c8b06dae80b0fd994f06838d69f5437f to your computer and use it in GitHub Desktop.
Interface example
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
interface SubjectOfComment { | |
commentedOn: [Comment!]! @relation(name: "SubjectOfComment") | |
} | |
interface ObjectOfComment { | |
comments: [Comment!]! @relation(name: "ObjectOfComment") | |
} | |
type User implements SubjectOfComment, ObjectOfComment { | |
id: ID! | |
name: String! | |
posts: [Post!]! @relation(name: "AuthorPosts") | |
# SubjectOfComment | |
commentedOn: [Comment!]! @relation(name: "SubjectOfComment") | |
# ObjectOfComment | |
comments: [Comment!]! @relation(name: "ObjectOfComment") | |
} | |
type Post implements ObjectOfComment { | |
id: ID! | |
title: String! | |
author: User @relation(name: "AuthorPosts") | |
# ObjectOfComment | |
comments: [Comment!]! @relation(name: "ObjectOfComment") | |
} | |
type Comment { | |
id: ID! | |
text: String! | |
subject: SubjectOfComment @relation(name: "SubjectOfComment") | |
object: ObjectOfComment @relation(name: "ObjectOfComment") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment