This is a simple GraphQL API that you can play with. Sign up with and email and password (doesn't need to be real, just unique) to access the GraphiQL editor.
I require you to create an account so that any data you create won't interfere with anyone else, it'll all be tied to your account.
For those unfamiliar with the GraphiQL editor, you can see the schema for the data under the Docs pane at the top right.
Below are examples to help get you started. After you get the hang of things try the following.
- Create an Author
- Create another blog on the first author
- Query for the 2 blogs after the second blog on the first author (HINT: You'll first need to query for the cursor of the second blog)
Congrats! You can use GraphQL, checkout the spec to see more about it.
Here are some example queries to try.
query {
me {
email
}
}
query {
me {
authors(first: 1) {
edges {
node {
name
}
}
}
}
}
query {
me {
authors(first: 1) {
edges {
node {
blogs(first: 2) {
edges {
cursor
node {
title
content
}
}
}
}
}
}
}
}
The cursor field on an edge will be a string you can use to paginate forwards after that edge.
query {
me {
authors(first: 1) {
edges {
node {
blogs(first: 2, after: "MQ==") {
edges {
cursor
node {
title
content
}
}
}
}
}
}
}
}
Here are some example mutations to try.
mutation {
addBlog(input: { author_id: 1, title: "New Blog", content: "Wahoo!" }) {
blog {
id
}
}
}
query getBlog($blogID: ID!) {
blog(id: $blogID) {
title
content
}
}
{
"blogID": 1
}