GraphQL Injection: Mutations

GraphQLExploitation

From PayloadsAllTheThings by Swissky and contributors, under the MIT licence. Shown as written; the title and classification are ours. Licences. Its authors can have this tip removed by writing to abuse@bugbountytips.org.

A mutation is an operation used to change data on the server (create, update, or delete something). Mutations work like function, you can use them to interact with the GraphQL endpoint.

javascript
mutation{
  signIn(login:"Admin", password:"secretp@ssw0rd"){
      token
    }
}

mutation{
  addUser(id:"1", name:"Dan Abramov", email:"dan@dan.com") {
    id
    name
    email
  }
}

Warning: Mutations usually won't work with GET. graphql/graphql-over-http, issue #123

Comments

No comments yet.