Introduction to GraphQL

GraphQL is being added to Bluescape’s developer toolbox as an additional way to access Bluescape APIs, alongside the traditional REST methods.

What is GraphQL?

GraphQL is described as a query language for APIs. This means that it is platform and language independent which makes it easy to incorporate into any existing framework. GraphQL allows for the creation of complex queries which affords the user greater control of the requests that they make in order to combine functionality from several APIs, while also specifying exactly what data they would like to receive back.

For example, a simple and fairly common use case might be to query a workspace in order to retrieve both the owner of the workspace, along with all the IDs of all elements within that workspace. Previously, this would have to have been accomplished by calling two separate APIs, GET workspace/{workspaceId} and GET workspace/{workspaceId}/elements and then parse out the necessary information from the two responses. With GraphQL, developers are able to combine these two calls into a single query, while also being returned only the properties that they are interested in, reducing or even removing the amount of parsing required. To learn more about GraphQL, please see their documentation at graphql.org/learn/.

For more information on what you can do with GraphQL in Bluescape, please review our Getting Started pages in the Guides section, starting with the Basic GraphQL Requests guide.

Where to Next?

Not what you were looking for? Reply below or Search the community and discover more Bluescape.