The prevalence of GraphQL has grown immensely over the years as organizations look to find more efficient ways to access and navigate their tech stacks. With so many different approaches to how GraphQL can be used, it can often be difficult to find the right solution for your organization.
To demystify your search for the right solution, we will explore how MuleSoft’s GraphQL solution, Anypoint DataGraph, makes GraphQL easy to use and adopt for any enterprise.
How MuleSoft’s approach to GraphQL stands out
Let’s take a look at why Anypoint DataGraph stands out from a functional point of view. We’ll compare Anypoint DataGraph with other commercially available tools in four core scenarios: setup, build, deployment, and operation.
For this comparison, we premises a scenario demonstrating a typical GraphQL use case below:
Target application: GraphQL API federating REST APIs
Scenario: A fictional company manages their sales order information by using at least three data sources:
- A relational database that stores inventory information
- Product master files which are exported from a legacy system
- An order management system
All of these data sources are also accessible via SOAP and we introduce RESTful web APIs in front of them to abstract their access. To view or manage detailed order information, you need to federate this data from RESTful web APIs. This is where GraphQL comes into play. The GraphQL API federates those data and exposes the data in GraphQL interface so that any applications regardless of programming languages or underlying technologies can access it. The consumer applications can dynamically request the data which they really need.
Alternatives to MuleSoft
There are a number of alternatives in the market. We’ve picked the following for comparison as it is one of the most prevalent ways other than MuleSoft.
- GraphQL Framework: GraphQL.js
- GraphQL Implementation Pgm Language: Node.JS
- GraphQL Running Platform: Heroku
What we compare
We conduct phasic comparisons of how Anypoint DataGraph differs from alternatives when developing GraphQL APIs. As mentioned earlier, we will focus on the following four phases:
- Platform setup
- Building GraphQL APIs
- Deployment
- Operation
Comparison between other commercially available tools vs. Anypoint DataGraph
We’ll dive into each of the four features in detail below, but here’s a handy chart to see the base-level comparisons between other commercially available tools and Anypoint DataGraph.
Feature | Other Commercially Available Tools | Anypoint DataGraph |
Platform setup | Pre-requisite infrastructure, tooling, skills and knowledge required leading to increased time and cost. | Offers fully-managed capabilities with easy platform setup offering a low barrier to entry. |
Build GraphQL APIs | GraphQL framework skills on top of programming skills are needed. Then you have to code it by yourself. Difficulty in securing appropriate engineers and increased time and cost could lead to a delivery gap. | No programming skills and framework skills are needed. GraphQL modules are automatically generated after setup in the GUI window is completed. Potentially fill in the delivery gap. |
Deployment | Deploy modules by yourself. | Anypoint DataGraph automatically deploys modules. |
Operation | You may have to utilize multiple tools: one for GraphQL APIs and one for underlining APIs. | All operations and monitoring work can be done with a single tool, Anypoint Platform. |
1. Platform setup
Other commercially available tools: There’s normally an extensive preparation process before using other commercially available GraphQL tools. This process can be time intensive and require in-depth knowledge or the need of a GraphQL specialist to achieve.
These are some of the typical steps to follow before you can start GraphQL API builds:
- Configuration of API Catalogs: Listing APIs to be federated to have GraphQL architects/developers learn and evaluate them. This is beneficial for GraphQL architects/developers and API consumers.
- Examples: AWS API Gateway, Azure API Gateway, Apigee, IBM API Connect
- Configuration of GraphQL schema management tools: API schema management is one of the keys to success for maximizing the value of APIs from both API consumers and providers perspective. As we do it for RESTful APIs, GraphQL schema should also be managed.
- Examples: Apollo Studio, Dgraph, Hubburu
- Configuration of building tools: To develop GraphQL API implementation, you need to set up npm server installation etc on top of IDE setup itself.
- Examples: Visual Studio Code, IntelliJ, Komodo
- Configuration of running platform: Subscribe Heroku and set it up to run GraphQL API implementations. We exemplified Heroku but it can be any IaaS or PaaS which can run built GraphQL APIs.
- Examples: AWS Lambda, Azure Functions, Google Cloud Functions
Anypoint DataGraph: Anypoint DataGraph offers fully-managed capabilities for choosing APIs to federate, designing and managing Schema, building GraphQL APIs and operating GraphQL APIs. It frees you up from all tasks listed for alternatives. By simply choosing DataGraph from the main menu, or the “Unify and consume” button on top of Anypoint Platform console, you are navigated to a ready-made, full-fledged GraphQL development and operating environment.
2. Build GraphQL APIs
Now, we’ll discuss building GraphQL APIs and the steps it involves.
Discover APIs to be federated
Other commercially available tools: Discovering the correct APIs to use in the process can be a challenge. You start by identifying the APIs that you think will work for your project. It’s important to properly evaluate them to ensure they will meet your requirements. Choosing the wrong APIs can be costly and time-consuming to fix later on.
Once you’ve found the correct APIs, you may need to rely on documents or people who have knowledge of the APIs to find the information you need. If you’re not using an API catalog that provides a testing client, you’ll also need to test the APIs on your own. Finally, you’ll also need to make sure to keep track of important information such as endpoint URLs, paths, and parameters so you can easily consume them later.
Anypoint DataGraph: Since Anypoint DataGraph is integrated with Anypoint Platform, one of the leading integration platforms in the market, users get access to its managed API catalog. This means you can simply choose the target APIs within Anypoint DataGraph GUI setup window and learn about the details of APIs in the catalog by clicking “View in Exchange”. Anypoint DataGraph will automatically grab their endpoint URL and paths so you don’t have to note or remember anything. Not only does this save you time, but it also avoids the risk of human error.
Write schema definition
As you write RAML/OAS to define schemes when creating REST APIs, you need to define GraphQL schema in some ways. A widely used specification for GraphQL is GraphQL SDL (schema definition language).
Other commercially available tools: With most other tools in the market, you will have to write the GraphQL SDL from scratch and deploy it onto your GraphQL schema management tool. This requires you to have a clear understanding of its syntax, which could be a challenge based on your organization’s GraphQL maturity level. Here is an example of GraphQL SDL:
type Todo { id: ID! name: String! description: String dueDate: Date!} type Query { todo(id: ID!): Todo allTodos: [Todo!]!} type Mutation { addTodo(name: String!, description: String): Todo! removeTodo(id: ID!): Todo!} |
Anypoint DataGraph: With Anypoint DataGraph you can simply skip this operation as the scheme definition is automatically generated when you set up API federation on GUI-based windows.
Implement GraphQL API logic
Just like REST APIs, you do have to implement application logic onto GraphQL APIs; send a query to underlining APIs to retrieve data, how you merge retrieved data; change field names to make them conformant with schema definition etc.
Other commercially available tools: With most other GraphQL tools, you need to code that logic in Node.JS. The developers have to master not only Node.JS itself, but also GraphQL frameworks, such as GraphQL.js in this case. This learning cost could be significant on top of building cost.
Anypoint DataGraph: With Anypoint DataGraph, you are freed from writing program codes for this. You simply configure the logic through a GUI-based window and the application modules are automatically generated.
3. Deployment
Other commercially available tools: You have to procure and set up a platform where you will run the GraphQL APIs. In this comparison, we exemplify Heroku, one of the most widely used PaaS in the market. Even though layers under middleware are managed by vendors, you still need to configure at some extent in order to run the APIs. For example, choosing the right runtime, associating SCMs to port the source code to Heroku.
Anypoint DataGraph: No setup is needed. Application modules are automatically generated once GraphQL configuration is done, then they are automatically deployed onto our managed cloud platform called CloudHub. You can also scale the runtime based on APIs expected load.
4. Operation
Other commercially available tools: When operating GraphQL APIs federating REST APIs, you have to leverage at least two tools: Monitor and logging tool for GraphQL APIs (Schema management tools and Heroku) and monitor and logging tool for underlining APIs (AWS, Azure, GCP, etc. based on where you run underlining APIs).
On top of this, you may have to tweak GraphQL API logic should you need to send usage metrics and logging. In case the implementation omits those logics when a trouble is observed in production, you need to tweak the app and reproduce the issue. This could make your troubleshooting operations inefficient, thereby, longer MTTR.
Anypoint DataGraph: As both GraphQL APIs and underlining APIs are managed under Anypoint Platform, all monitoring operations can be completed within Anypoint Platform. This could lead to your MTTR being shortened.
For example, you can overview the complete performance from following window and find out the bottlenecks so that you can drill down and identify the cause quickly:
Conclusion
The following diagram illustrates the summary of the comparison we made in the previous section. Anypoint DataGraph handles a number of processes that would normally need to be planned for or thought out before starting a project. This leads to less time sped, more agility, reduced time-to-market, and cost savings.
Those automated modes also provide a positive impact on the quality and resilience of your GraphQL APIs. The more human intervention is circumvented, the more human error risk is averted. These benefits lead companies/organizations to choose Anypoint DataGraph in the mean of building/operating GraphQL APIs.