GraphSQL —Native GraphQL support for the Salesforce platform
Build more efficient Salesforce integrations with our new free API extension
GraphQL is an open-source database query and manipulation language, developed by the GraphQL Foundation. At it’s core a GraphQL query let’s you specify exactly what data is required, and in the structure and format that you want back.
With our new package, GraphSQL, you can add GraphQL support to Salesforce, allowing your integrations to be more efficient by being able to get data from several objects in a single request!
What are GraphQL Queries
To give you an example, let’s take the following Salesforce SOQL query:
SELECT Id, Name FROM Account LIMIT 10
In GraphQL this becomes
This JSON-like structure is the format all GraphQL queries use, and one of the benefits of this is that you get back data from GraphQL in the exact same format.
This might not seem more useful right now, but let’s say you have a more complex scenario and you want to get all the Opportunities and Contacts for a specific Account, plus all the Tasks related to those contacts.
In SOQL you’d have to run multiple queries as you wouldn’t be able to nest that many relationships, but in GraphQL you can do it in a single request:
You can see we’ve simply nested each of the child objects as a separate JSON-like object, with all the fields. This would retrieve us all the data we need in one request!
(If you want to test it out, you can head over to the Test Drive, open the GraphSQL Playground tab, and copy in this query!)
GraphQL for Salesforce
In Salesforce, if you wanted to get the data in the example above, you’d need to do multiple requests to the REST API, and there are limits on the number of API calls you can make a day. If we had GraphQL support, we could avoid this problem and make integrations more efficient by getting all this related data in a single request.
Enter GraphSQL — our new free package that extends the Salesforce REST API to include a new REST endpoint in your org, where you can send any standard GraphQL query, and using only one REST API call, get data from several objects back.
To make things even easier, the package also adds a playground into Salesforce, which is a page where you can test out different GraphQL queries without writing any code.
This makes it really easy to test out your queries on the platform before then adding them into your third party integrations.
Get started today for free
GraphSQL is free to use and publicly available on the AppExchange!
(If you want to use GraphSQL in a scratch org, the Package Id is 04t4J000001O4O1)
We’ve also got a Test Drive available so you can go and use the playground without having to install anything.
We’re always improving our free products and trying to make them as useful as possible for the Salesforce ecosystem, so we’d love to hear your feedback on it. You can reach out to us below or through our feedback form.
At Appitek, our aim is to help make your job easier, by creating simple but effective Salesforce applications that make you more efficient at what you do.
Appitek is a registered Salesforce ISV partner.
Salesforce and Salesforce Lightning are registered trademarks of Salesforce.com