Skip to content

Instantly share code, notes, and snippets.

@devinus
Last active August 13, 2021 04:43
Show Gist options
  • Save devinus/7982f76bec8c04b17bdb07c5e14b3781 to your computer and use it in GitHub Desktop.
Save devinus/7982f76bec8c04b17bdb07c5e14b3781 to your computer and use it in GitHub Desktop.
type User {
username: String! @search(by: [hash]) @id
dateCreated: DateTime!
posts: [Post!]! @hasInverse(field: user)
comments: [Comment!]! @hasInverse(field: user)
}
type Post {
id: ID!
user: User!
dateCreated: DateTime!
datePublished: DateTime
title: String! @search(by: [term])
body: String! @search(by: [fulltext])
comments: [Comment!]! @hasInverse(field: post)
}
type Comment {
id: ID!
user: User!
post: Post!
dateCreated: DateTime!
datePublished: DateTime
body: String! @search(by: [fulltext])
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment