3 ms·
FWIW, Salesforce actually did make a GraphQL API: https://developer.salesforce.com/docs/platform/graphql/overview https://developer.salesforce.com/docs/platform
by solardev 3y ago
FWIW, Salesforce actually did make a GraphQL API: https://developer.salesforce.com/docs/platform/graphql/overview https://developer.salesforce.com/docs/platform/graphql/overv...
If you're a small company where the FE and BE can work together to make the REST API function exactly how you want, it's not really a big deal. But in B2C or B2B situations where the API provider isn't working alongside the end-users, GraphQL gives the consumers WAY more freedom to choose what they want to fetch -- and no more. That query language is amazing for that use case.
I've used it to work with the Nvidia GeForce Now API, for example, which has thousands of games and dozens of parameters (which store do you want it from, whether you want images, titles, how you want it sorted and filtered, whatever). I wanted a list of all game IDs on Steam, and that is a single query in GraphQL rather than several blocks of back-and-forth REST queries plus more client-side filtering. https://ighor.medium.com/i-unlocked-nvidia-geforce-now-and-stumbled-upon-pirates-dc48a3f8ff7 https://ighor.medium.com/i-unlocked-nvidia-geforce-now-and-s...
Similarly, with headless CMSes like DatoCMS or Hygraph, it gives you a central place to put all your content but then consume it however you like across different frontends (web, native, syndication, whatever) with powerful and customized queries. https://www.datocms.com/docs/content-delivery-api/filtering-records https://www.datocms.com/docs/content-delivery-api/filtering-... https://hygraph.com/docs/api-reference/content-api/filtering https://hygraph.com/docs/api-reference/content-api/filtering