Skip to content

Instantly share code, notes, and snippets.

@steveluscher
Last active June 22, 2018 08:05
Show Gist options
  • Save steveluscher/6beca90f058ded646cd37f3a03d2686c to your computer and use it in GitHub Desktop.
Save steveluscher/6beca90f058ded646cd37f3a03d2686c to your computer and use it in GitHub Desktop.
The schema for thebergamo/realworld-graphql
type Article {
author: Profile!
body: String!
comments(first: Int, after: String): CommentsConnection
createdAt: String!
description: String!
favorited: Boolean!
favoritesCount: Int!
slug: String!
tags: [String],
title: String!
updatedAt: String!
}
type ArticleEdge {
cursor: String!
node: Article
}
type ArticlesConnection {
count: Int!
edges: [ArticleEdge]
pageInfo: PageInfo!
}
type Comment {
author: Profile!
article: Article!
body: String!
createdAt: String!
updatedAt: String!
}
type CommentEdge {
cursor: String!
node: Comment
}
type CommentsConnection {
count: Int!
edges: [CommentEdge]
pageInfo: PageInfo!
}
type DeletionStatus {
success: Boolean!
}
type PageInfo {
endCursor: String
hasNextPage: Boolean!
hasPreviousPage: Boolean!
startCursor: String
}
type Profile {
articles(first: Int, after: String): ArticlesConnection
bio: String!
comments(first: Int, after: String): CommentsConnection
favorites(first: Int, after: String): ArticlesConnection
following: Boolean!
image: String
user: User!
}
type User {
email: String!
profile: Profile!
token: String!
username: String!
}
# Input types.
input ArticleChanges {
body: String
description: String
title: String
}
input ArticleInput {
body: String!
description: String!
tags: [String]
title: String!
}
input UserChanges {
bio: String
email: String
image: String
password: String
username: String
}
# Build the schema.
type Query {
article(slug: String!): Article
articles(
first: Int,
after: String,
authoredBy: String
favoritedBy: String
withTag: String
): ArticlesConnection
currentUser: User
feed(first: Int, after: String): ArticlesConnection
profile(username: String!): Profile
tags: [String]
}
type Mutation {
addComment(slug: String!, body: String!): Comment
authenticate(password: String!, email: String!): User
createArticle(input: ArticleInput!)
deleteArticle(slug: String!): DeletionStatus
deleteComment(id: ID!): DeletionStatus
favoriteArticle(slug: String!): Article
followUser(username: String!): Profile
unfollowUser(username: String!): Profile
updateArticle(changes: ArticleChanges!): Article
updateUser(changes: UserChanges!): User
}
schema {
query: Query
mutation: Mutation
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment