You are using an unsupported browser. Please update your browser to the latest version on or before July 31, 2020.
close
You are viewing the article in preview mode. It is not live at the moment.
Home > Developer Tools > BenchPrep GraphQL API > Writing Your First Mutation
Writing Your First Mutation
print icon
This article is intended to support our customers using BenchPrep GraphQL API. If you’re interested in leveraging this service, or if you would like to learn more about it, contact your BenchPrep Customer Success Manager today for pricing!

 

In the Writing Your First Query guide you were able to fire up a couple of queries and get Plans whose name contained the keyword “Demo”. Feel free to revisit them to familiarize yourself.

Mutations

You can modify data in GraphQL by writing mutations; creation of a record, for example, is a mutation. As is deletion of a resource, or a change of data on the specific resource. Let's take a look at an example mutation to show you the basics.

Modifying Plans

In this example, our goal is to look up plans and change their name. As a reminder, here is a lookup of the plans with names containing "Demo":

 

Let's use the Sales Team Demo Plan and update its name to Sales Demo Plan. For that, let’s check the documents and find the corresponding planUpdate mutation:


Based on the documents, we will need to call the planUpdate mutation, pass PlanUpdateInput, and request success, errors in return. We can try that first in the playground:


As you can see, that worked as planned. But this is just one simple example of a mutation; so much more is possible with BenchPrep GraphQL API.

 

Remember to check the documentation and schema frequently, and contact our Support team if necessary.

Feedback
0 out of 0 found this helpful

scroll to top icon