What are Queries & Mutations
There are two basic operations in GraphQL schemas:
- Queries: Requesting data from a data model. An example
Querywould be: checking availability of hotels for a particular date and location
- Mutations: Making changes and carrying out transactions on data in the data model. An example
Mutationwould be: making a booking to reserve a hotel room on a particular date.
Queries ask the system to provide some data, based on specfic parameters. This operation reads values from the server using a GraphQL
Object and returns JSON text as a response.
Queries are interactive. You can use our API Playground to test your queries.
Mutations are methods that change the data on the server. That is, mutations make a physical change to the data. This can include inserting a new object in a database, or deleting, or updating a data record.
Our booking flow can be found here