We have changed the behaviour of the ‘upsert’ mutation in the GraphQL API. We made this change in response to feedback from developers and customers. You can learn more about the Skedulo GraphQL in the developer guide and the API reference.

Please note: The upsert GraphQL mutation is only available on the Skedulo Pulse Platform.


What is an upsert operation?
The word "upsert" is a portmanteau of the words "update" and "insert". It describes a database operation that looks for a record using a key field. If the record exists, it updates it. If not, it inserts a new one.
Upsert operations are particularly useful when integrating data from a source to a destination system. They are useful when you only care that a record is present in the destination system, not how it got there - whether through an insert or an update.


Previous behaviour
Before this release, if an upsert resulted in an update operation, any optional fields not specified in the request would reset to their default, usually ‘null’.

Let's look at an example using the Tags object, which I've added a custom field called "ExternalID" to.

If I had a record where:

  • Name = "Test tag"
  • Type = "Skill"
  • ExternalId = "12345"

And I issued the following GraphQL mutation to upsert the record:

mutation {
  schema {
    upsertTags(
      keyField: "ExternalId",
      input: {
        ExternalId: "12345"
        Name: "Test tag - updated"
      }
    )
  }
}


The record would become:

  • Name = "Test tag - updated"
  • Type = NULL
  • ExternalId = "12345"

The "Type" field reverts to its default value, in this case NULL.


New behaviour
After this release, optional fields not specified in the request will remain unchanged. The record would look like:

  • Name = "Test tag - updated"
  • Type = "Skill"
  • ExternalId = "12345"


Questions?
If you have concerns about this change to behaviour please contact Skedulo Support by logging a case at https://support.skedulo.com/