Skip to content
This repository has been archived by the owner on Oct 28, 2024. It is now read-only.

Latest commit

 

History

History
73 lines (60 loc) · 1.08 KB

ExampleFlow.md

File metadata and controls

73 lines (60 loc) · 1.08 KB

Example Flow

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.

Login as an existing user
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.

Create a draft post
mutation {
  createDraft(input: { content: CONTENT, title: TITLE }) {
    id
    createdAt
    updatedAt
    published
    title
    content
    author {
      id
      name
      email
    }
  }
}
Delete post
mutation {
  deletePost(id: POST_ID_FROM_DB) {
    id
    createdAt
    updatedAt
  }
}
Update post
mutation {
  updatePost(input: { id: POST_ID_FROM_DB, title: TITLE, content: CONTENT }) {
    id
    createdAt
    updatedAt
    published
    title
    content
  }
}
Publish post
mutation {
  publish(id: POST_ID_FROM_DB) {
    id
    published
  }
}