반응형
# What is Mutation
*Query* describes all the read actions of data. However, Mutation performs data change.
Example:
```
mutation burnItDown {
deleteAllData
}
```
Example:
```
mutation createSong {
addSong(title: "No Scrubs", numberOne: true, performerName:"TLC"){
id
title
numberOne
}
}
```
addSong() adds data in parenthesis into the database.
following {} specifies which fields to retrieve if mutation returns an object.
반응형
'프론트엔드' 카테고리의 다른 글
8. GraphQL Introspection (0) | 2019.12.26 |
---|---|
7. GraphQL Subscription (0) | 2019.12.26 |
5. GraphQL Interface (0) | 2019.12.26 |
4. GraphQL Union (0) | 2019.12.26 |
3. GraphQL Fragments (0) | 2019.12.26 |