Skip to content

Instantly share code, notes, and snippets.

@dbayarchyk
Last active September 22, 2019 09:32
Show Gist options
  • Save dbayarchyk/2b82b2421d7459e441a7e762b30d43b4 to your computer and use it in GitHub Desktop.
Save dbayarchyk/2b82b2421d7459e441a7e762b30d43b4 to your computer and use it in GitHub Desktop.
Improve your GraphQL schema with the Relay Specification - connectionSchema.gql
type Query {
posts(after: String, before: String, first: Int, last: Int): PostConnection!
}
type PostConnection {
edges: [PostEdge!]!
pageInfo: PageInfo!
}
type PostEdge {
cursor: String!
node: Post!
}
type Post {
title: String!
}
type PageInfo {
hasNextPage: Boolean!
hasPreviousPage: Boolean!
startCursor: String
endCursor: String
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment