Skip to content

Commit

Permalink
Step 5.1: Update Schema with Relay Cursor Connection
Browse files Browse the repository at this point in the history
  • Loading branch information
srtucker22 authored and Simon Tucker committed Aug 26, 2018
1 parent e803b26 commit 1c76ffc
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion server/data/schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,27 @@ export const typeDefs = gql`
# declare custom scalars
scalar Date
type MessageConnection {
edges: [MessageEdge]
pageInfo: PageInfo!
}
type MessageEdge {
cursor: String!
node: Message!
}
type PageInfo {
hasNextPage: Boolean!
hasPreviousPage: Boolean!
}
# a group chat entity
type Group {
id: Int! # unique id for the group
name: String # name of the group
users: [User]! # users in the group
messages: [Message] # messages sent to the group
messages(first: Int, after: String, last: Int, before: String): MessageConnection # messages sent to the group
}
# a user -- keep type really simple for now
Expand Down

0 comments on commit 1c76ffc

Please sign in to comment.