Skip to content

Instantly share code, notes, and snippets.

@glennreyes
Last active September 20, 2023 15:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save glennreyes/693293b660caaf67a3f0e5a47f215b2e to your computer and use it in GitHub Desktop.
Save glennreyes/693293b660caaf67a3f0e5a47f215b2e to your computer and use it in GitHub Desktop.
GraphQL Workshop slides snippets
{
"data": {
"viewer": {
"id": "clmrvzzlx000008l6e8a4de9o",
"name": "Glenn",
"posts": [
{
"id": "clmrw16zi000108l619ctafwt",
"message": "I'm excited you're here at the awesome GraphQL Workshop!"
},
{
"id": "clmrw2wcv000208l6gpec5ztj",
"message": "Thanks for joining, see you around!"
}
]
}
}
}
query MyPosts {
viewer {
id
name
posts {
id
message
}
}
}
type Post {
  id: ID!
  message: String!
reactions: Int!
  from: User
}
type User {
  id: ID!
  name: String!
  email: String!
  username: String!
  bio: String
  age: Int
  posts: [Post!]!
}
type Query {
  posts: [Tweet!]!
postsByUsername(username: String!): [Post!]!
userByUsername(username: String!): User!
viewer: User!
}
type Mutation {
  createPost(message: String!): Post
  deletePost(id: ID!): Post
  updatePost(id: ID!): Post
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment