We highly recommend that you type out these examples (with your own ID’s) in the API explorer directly.The explorer helps with autocompletion and will help you understand the context of your queries. In addition, the Documentation Explorer on the right side will be your guide to the exact fields for each object.
First - query for a monitor
Here I’m using a monitor that is triggered from the previous example. You can find a monitor by following the example or by using the UI and grabbing the monitor id from the URL. (.../monitors/:``monitor_id).
Patch mutation
Let’s say we want to update the threshold to be higher than the current value, which will clear the monitor. Because our 3 types of monitors (Drift, Performance, and Data Quality) are all different, we have different mutations for each. This is a drift monitor, so we want thepatchDriftMonitor mutation:
- Request
- Response
The template:
monitorId, and threshold. Each field needs a type, and ! denotes that the field is required. Even though monitorId looks like a string, it is a special type in GraphQL which allows further validations.
The actual mutation
() . From looking at the Documentation Explorer, we can tell the shape of the input, which can be nested. Here, we only set a few of the possible fields for this input. monitorId: $monitorId and threshold: $threshold use the input variables defined above, while autoThresholdEnabled: false is hardcoded.
Return the updated value
What’s next?
While we only showed how to make a single change to a monitor, mutations allow you to update or create monitors in bulk. For much more detailed and advanced examples for your use case, please consult our various Colabs.Having trouble? Reach out to us via email support@arize.com or Slack us in the #arize-support channel for more support.