- There can be an unlimited number of categories
- Categories can be disabled
- There can be an unlimited number of posts
- Each post can be in several categories
- Each post can have an unlimited number of tags
- Authors can manage their posts
- Administrator can manage all posts and categories
- Guests can view published posts, provided that the post has at least one active category.
- Disabled categories should not be displayed to authors and guests.
mutation {
login(email: "admin@example.com", password: "admin") {
token
user {
id
email
firstname
}
}
}
mutation {
blogCategoryCreate(
input: { title: "Category", slug: "cat", status: ACTIVE }
) {
data {
id
}
}
}
mutation {
blogCategoryUpdate(filter: { id: { eq: 1 } }, input: { status: ACTIVE }) {
data {
id
}
}
}
mutation {
blogPostCreate(
input: {
title: "Post"
content: "Content"
categories: { sync: { id: { in: [1, 2, 3] } } }
tags: { create: [{ title: "tag1" }, { title: "tag2" }] }
}
) {
data {
id
}
}
}
mutation {
blogPostUpdate(
filter: { id: { eq: 3 } }
input: { published_at: "2023-05-23 13:43:32" }
) {
data {
id
}
}
}
query {
blogPosts(filter: {category_ids: [2]}) {
data {
id
title
categories {
id
title
}
tags {
title
}
}
}
}