Support for the updated sobjects API in Salesforce

Oct 16th, 2020view comments

Use the new updatedSobjects field to keep track of the latest updates to your Salesforce data. Salesforce allows you to make requests for a range within the last 30 days.

The example below gets the last two leads that were updated or created this month:

query UpdatedLeadsQuery {
  salesforce {
    updatedSobjects(
      start: "2020-10-01T00:00:00+00:00"
      end: "2020-10-16T00:00:00+00:00"      
    ) {
      leads(last: 2) {
        latestDateCovered
        ids
        nodes {
          id
          name
          createdDate
        }
      }
    }
  }
}

Keep the Salesforce rate-limits in mind when you use this new field. The query will only use up one of your API calls if you only request the ids field. If you only request top-level fields for the objects through the nodes field (e.g. node.name), OneGraph will make one additional API request for every 500 objects. If you request nested fields (e.g. node.account.name), OneGraph will use up at least one API request per node.

Up to 600,000 nodes could be returned in a single query, so it's best to use the first or last arg to limit the number of API requests.

OneGraph also supports GraphQL subscriptions for Salesforce. Learn more about subscriptions in the docs.