Last active
December 3, 2021 06:57
-
-
Save kabece/c3ebb1d03cf6e41a7650f1ae7508fba4 to your computer and use it in GitHub Desktop.
Implementing GraphQL pagination in gqlgen
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
type Message { | |
id: ID! | |
text: String | |
} | |
type MessagesConnection { | |
edges: [MessagesEdge!]! | |
pageInfo: PageInfo! | |
} | |
type MessagesEdge { | |
cursor: ID! | |
node: Message | |
} | |
type PageInfo { | |
startCursor: ID! | |
endCursor: ID! | |
hasNextPage: Boolean | |
} | |
type ChatRoom { | |
id: ID! | |
name: String | |
messagesConnection(first: Int = 20, after: ID): MessagesConnection | |
} | |
type Query { | |
chatRoom(id: ID!): ChatRoom! | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment