Perform mutations
Mutation queries make changes somewhere i.e., in performing a task, or updating a record.
Mutating operations are defined in Taxi using the write
modifier:
service FlightsService {
write operation bookFlight(BookingRequest):BookingConfirmation
write operation sendFlightManifest(Manifest):ManifestConfirmation
}
Mutating operations are excluded from being invoked during a query (i.e., anything with a find {}
or stream {}
directive.)
Instead, they are invoked using a call
directive.
find { Passengers[] }
call FlightsService::sendFlightManifest
In this example, a list of Passengers
is fetched, and converted into a Manifest
to call the sendFlightManifest
operation
of the FlightsService
.
Consult the docs for the relevant data source to learn more.