0

Recently salesforce has announced the GraphQL capabilities. Just wanted to understand the below differences w.r.t existing composite graph api. GraphQL - it can return any complex relatioship datastructure. Also in general we can perform post operation as well using graphQL.

Then in that case, what would be the use of composite graph api.

1 Answer 1

3

First of all, the GraphQL capabilities are implied to be read-only; the blog post states:

GraphQL is a standard query language for APIs and a runtime for fulfilling those queries with your data.

While you can shape the resource in almost any way you want to, you can't write data to the database with this. So, one immediately obvious benefit is being able to save data in the Composite Graph API.

Second, just because you have a shiny new API, even if it completely replicates an older API, doesn't mean you immediately throw the old API out and require everyone to use the new one. Existing clients have to continue being supported for a while yet.

Third, it's very limited in what it currently supports. The blog post goes on to say:

In the Summer ’22 release, the Salesforce GraphQL schema will initially allow you to query your UI API exposed sObjects. In the future, we hope to add additional resources from the UI API family, such as Object Info or Layout, as well as resources from other API families at Salesforce. If you would like a particular resource to be added to the schema, please let us know via IdeaExchange.

So, in other words, you still need the Composite Graph API for many types of resources you'd like to access.

Mind you, GraphQL is going to make so many apps perform much better in key areas, such as UI rendering, but it in no way obsoletes the Composite Graph API, nor does it specifically aim to in this release. It's not even clear that GraphQL specifications allow for DML operation, as it is a "query language," so while it may revolutionize retrieval of data, it might never be used for actual data manipulation.

1
  • Thanks for your explanation @sfdcfox. But in general graphQL provides the data manipulation capabilities, but in salesforce it would be readonly. Commented Apr 10, 2022 at 11:41

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.