Menu
Strapql LogoStrapql LogoStrapqlDocsBlog
GitHub
๐ŸŒœ
๐ŸŒž
Strapql LogoStrapql LogoStrapql
  • Docs
  • Blog
  • GitHub
  • Introduction
    • What is Strapql ?
  • Queries
    • ๐Ÿ™‹ Me Query
    • ๐Ÿง‘ Retrieve/Fetch a single User
    • ๐Ÿ‘ฅ Retrieve/Fetch all Users
    • ๐Ÿ“ฎ Fetch/Retrieve a single entry in collection type
    • ๐Ÿ“’ Fetch/Retrieve all entries in collection type
    • ๐Ÿ“‚ Get all files
    • ๐Ÿ‘จโ€๐Ÿ’ป Fetch a single role
    • ๐Ÿ‘จโ€๐Ÿ’ป ๐Ÿ‘จโ€๐Ÿ’ผ Fetch all roles
  • Mutations
    • ๐Ÿ”’ Register and Login
    • Create a User
    • ๐Ÿ”„ Update a User
    • โŒ Delete/Remove a User
    • ๐Ÿ†• Create an Entry in a Collection Type
    • ๐Ÿ”„ Update an entry in collection type
    • โŒ Delete/Remove an entry in collection type
    • ๐Ÿ“ค ๐Ÿ–ผ๏ธ Upload a single image
    • ๐Ÿ“ค ๐Ÿ–ผ๏ธ Upload a single image in separate fields

โŒ Delete/Remove a User

A user decided to no longer use my app. How do I remove him/her?

Here is a mutation that might do the task :

mutation deleteUser($input: deleteUserInput) {
deleteUser(input: $input) {
user {
id
createdAt
updatedAt
username
email
provider
confirmed
blocked
role {
name
}
}
}
}

Place the user ID of the user you want to remove as a variable :

{
"input": {
"where": {
"id": "YOUR_USER_ID"
}
}
}
Note : Please carefully control which roles are able to conduct `delete` operation as it is sensitive.
Edit this page
Previous
ยซ ๐Ÿ”„ Update a User
Next
๐Ÿ†• Create an Entry in a Collection Type ยป

Docs

  • Get Started

Community

  • Discord
  • Strapi Forum
  • YouTube
  • Stack Overflow
  • Twitter

More

  • Blog
  • GitHub
Copyright ยฉ 2022 Strapql, Built with โค๏ธ by kevin.