Nerdgraph (create/update) pattern

What is the recommended pattern to create/update a syntheticApiMonitor

  • Always do a search
    if not found; do a mutation with syntheticsCreateScriptApiMonitor
    if found do a mutation with syntheticsUpdateScriptApiMonitor

Or
always do a syntheticsCreateScriptApiMonitor, and when error on duplicate name,

  • query the guid (because that is not returned in the monitor part upon an error)
  • update with syntheticsUpdateScriptApiMonitor with Guid

I am kind of looking for a single upsert call. But not sure if this is possble.

I’m new to graphql and nerdgraph, so pardon my ignorance

@mensing I was able to find some resources that could help you work through this process. If these do not help let us know so that we can get a member of our support team to assist further. These should be a good start though!

Writing Synthetic API tests

Nerdgraph Tutorial

That indeed does not help. But I will figure it out. Part of my job description :slight_smile:

@mensing Sorry to hear that those resources were not helpful. Hoping a community member or Relic can offer you further insights. If you do happen to figure this out on your own we would love to hear the solution. Perhaps it could help future members! :slight_smile: