The Mule Connect 2020 virtual conference is over and we got to see more details on MuleSoft’s vision for GraphQL, and it shows MuleSoft is working aggressively to fill a gap in GraphQL. Let’s review what GraphQL is, its challenges, and how MuleSoft is addressing those challenges.

GraphQL Basics

GraphQL is an API specification for querying data across other APIs. It originated at Facebook in 2012, released as open source in 2015. It allows API clients to tell the API what it wants rather than the API assuming it knows what the client wants. This is particularly useful for APIs that support UIs. A challenge with UIs is that they may need data from many sources. Calling all those sources can make the UI complex. It can also add too much chatter for mobile apps, which are sensitive to bandwidth. We often solve this by aggregating lower level business APIs with a composite view-model API or by using the backend for frontend (BFF) pattern.

This has some problems, though. These APIs are very coupled with the page they support. When you have both a web and mobile UI, you often need to code two flavors of the view-model or BFF APIs. When you want to re-arrange things on the UI, such as to A/B test a new experience, you again need to rewrite these APIs.

With GraphQL, the UI layers tells the GraphQL layer what it needs using a GraphQL specification, and the API returns it. Now you can have one GraphQL API supporting both your mobile and web UIs instead of two view-models or BFFs. Want to AB test moving some field to a different page? Just have the new page request the new field when it needs it; no need to go change the API layer.

#mulesoft #graphql #database #web-development

MuleSoft Hits the Mark with GraphQL
2.15 GEEK