Last active
September 20, 2023 15:20
-
-
Save glennreyes/693293b660caaf67a3f0e5a47f215b2e to your computer and use it in GitHub Desktop.
GraphQL Workshop slides snippets
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
{ | |
"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!" | |
} | |
] | |
} | |
} | |
} |
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
query MyPosts { | |
viewer { | |
id | |
name | |
posts { | |
id | |
message | |
} | |
} | |
} |
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 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