In order for the API to identify the user you are logging in as, you must provide a valid email. You can get this from the User table by using npx prisma studio.
mutation {
login(email: "[email protected]")
}
The response will be an auth token that you can add as a header to your requests.
You can use the following requests to test the post functionality.
mutation {
createDraft(input: { content: CONTENT, title: TITLE }) {
id
createdAt
updatedAt
published
title
content
author {
id
name
email
}
}
}
mutation {
deletePost(id: POST_ID_FROM_DB) {
id
createdAt
updatedAt
}
}
mutation {
updatePost(input: { id: POST_ID_FROM_DB, title: TITLE, content: CONTENT }) {
id
createdAt
updatedAt
published
title
content
}
}
mutation {
publish(id: POST_ID_FROM_DB) {
id
published
}
}