Skip to content

Instantly share code, notes, and snippets.

@seandearnaley
Last active February 21, 2020 11:08
Show Gist options
  • Save seandearnaley/a0dff33a23bf707493dffa4881ff4fb8 to your computer and use it in GitHub Desktop.
Save seandearnaley/a0dff33a23bf707493dffa4881ff4fb8 to your computer and use it in GitHub Desktop.
Card.graphql Connection Types (Server)
interface Node {
id: ID!
created: DateTime!
updated: DateTime
}
type Card implements Node {
id: ID!
number: Int
label: String
description: String
created: DateTime!
updated: DateTime
categories: [Category!]!
}
type CardConnection {
pageInfo: PageInfo!
edges: [CardEdge!]!
}
type CardEdge {
cursor: String!
node: Card!
}
input CardInput {
number: Int
label: String
description: String
categoryId: ID
}
type CardsUpdatedResponse {
success: Boolean!
message: String!
card: Card!
}
type PageInfo {
hasNextPage: Boolean!
hasPreviousPage: Boolean!
startCursor: String
endCursor: String
totalCount: Int
}
enum DirectionEnum {
ASC
DESC
}
type Query {
cards(first: Int, last: Int, after: String, before: String, orderByColumn: String, orderByDirection: DirectionEnum, categoryId: ID): CardConnection!
card(id: ID): Card!
categories(cardIds: String, orderByColumn: String, orderByDirection: DirectionEnum): [Category!]!
category(id: ID): Category!
node(id: ID): Node!
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment