Build GraphQL for Any Data Source. Declaratively.
A concise well-designed API. Any data source. Any-sized graph.
Sign UpPrivate or Public Backends: A Few Lines of Code to Build a GraphQL API
One command to generate schemas and resolvers
> stepzen import curl
> stepzen import postgresql
> stepzen import graphql
You can quickly build a GraphQL API from REST, SQL, NoSQL, GraphQL, or microservices backends with the stepzen import
command. StepZen introspects the backends and generates the schema. The schema code is concise, intuitive and easily customized as it includes the directives @rest
and @dbquery
or @graphql
depending on your data source.
One command to deploy in seconds
> stepzen start
Your GraphQL API is deployed - up and running, protected and scaled.
One directive to combine graphs
The @materializer
directive combines graphs - taking data from one graph and feeding it into a query/mutation of the other. The same mechanism for building a single graph as for building a federated graph (i.e. a graph-of-graphs).
Data: Your most precious resource
Your data resides in REST, SOAP, SQL, NoSQL, and GraphQL backends. With StepZen, you can build GraphQL declaratively and there's no need to modify your backend data sources.
REST APIs
As REST has been the lingua franca for web APIs for decades, more often than not, your data resides at REST backends. Having helped hundreds of customers with REST APIs, this team has seen its share of weird REST. StepZen helps you leverage REST investments.
Convert REST to GraphQL
Easily convert any REST or XML backends into a graph using the stepzen import curl
and/or the @rest
directive.
- No need to treat backends as “remote schema”
- No need to add code in front of backends to GraphQLize them
- With a few lines of code you have a GraphQL API on your REST backend.
Call REST API using methods & structures you need
StepZen supports all REST methods, and POST body, query parameters, keys, and options are easily auto-generated.
Map responses
With support for JavaScript, jq, field mappings, and filters, you can map all responses to the right GraphQL type structures.
Convert SOAP/XML to GraphQL
By allowing for any body to be created and with a simple XML2JSON transformation, you can handle SOAP/XML as easily as REST APIs.
SQL and NoSQL Databases
The StepZen team has helped build some of the best database technologies: Postgres (Berkeley), Db2 (IBM) and Derby (Informix). We focus on bringing the best practices from the world of databases to GraphQL.
GraphQL on a database backend
A single command and a custom directive lets you quickly convert any database backend into a graph: Run the stepzen import [mysql | postgresql]
command and StepZen introspects the database and generates your schema. Then you can customize it with a few lines of code and the @dbquery directive.
- StepZen prepares the database queries attached to GraphQL queries and ensure best performance and safety
- You choose the queries you attach (defaults are supported)
- StepZen does not permit arbitrarily query-time generated queries, and does not coerce SQL through GraphQL syntax
Your GraphQL runs outside of the database
GraphQL processing differs from database query processing in many ways. With a deep understanding of JSON structures, remote access, early stops, parallel threading, etc., we have built a powerful GraphQL query execution engine in Golang. StepZen does not use an approach that converts GraphQL to a SQL query because
- They are not the best for GraphQL processing
- They add to the load on the database, especially if a runaway query is submitted
Privileges to execute
StepZen executes CRUD against the database using a named-user model.
- The user must be authorized to execute the specific query/CRUD
- Different operations can use different users giving you fine-grained or coarse-grained privileges control, as needed
NoSQL database support
Most NoSQL databases make their data available via an API, often REST or GraphQL. You can use these APIs to create a GraphQL API with StepZen.
The Getting Started wizard lets you get started quickly with NoSQL databases including DataStax Astra, MongoDB Atlas, and HarperDB.
GraphQL Backends
You may deal with GraphQL backends in one of two cases - a data source already has a GraphQL API or independent teams have built their subgraphs and you want to combine them.
Use an existing GraphQL API as a data source
Easily connect an existing GraphQL API into a project using stepzen import graphql
. Extend or customize your schema with the @graphql
directive.
Your existing GraphQL APIs can have been created using different technologies. All possible with a few lines of code: Try it!.
Proxy GraphQL with no mods to the original endpoint
Often the GraphQL endpoint that has the data you need is provided by a third party or is built using a library that is not easy to modify. With StepZen, you can quickly create a GraphQL proxy using stepzen import graphql
and you need to make zero changes to the original backend.
Modify and curate a proxied API
You can delete GraphQL endpoints in a proxy you create. For the rest of the system, it is as if the respective endpoints and the types that they reference do not exist.
The @graphql
directive gives you full control. You can rename fields, and create new fields, just like you would against a REST API.
Assembling GraphQL APIs
StepZen allows developers to reach across teams and organizational boundaries and connect the subgraphs of public and private data sources into a single integrated view. StepZen's @materializer
is the powerful directive that lets you link types and also assemble multiple subgraphs into a supergraph.
Declaratively link types with @materializer
Link types with the @materializer
directive. Only the enclosing type needs to know about the enclosed type (e.g., Customer knows about Order); the reverse is not needed. This leads to simplicity in design.
- The StepZen
import
command (e.g.stepzen import mysql
) produces stitched schemas; and you can add more. - In the few lines of code, you can do the transformations needed to feed data from one type to the other. Say, one type outputs
{“name:“John Doe”}
and the other type needs{“firstName”:”John”, “lastName”:”Doe”}
— it is as simple as chaining a transformation in the@materializer
call.
Protect from unintended access
Linking happens based on the enclosing type passing data to a query/mutation of the enclosed type.
- Access control mechanisms at the query/mutation level for the enclosed type ensure that backends in the enclosed type are as protected when called in a link as they are when called directly.
- This avoids duplication of effort and security holes that can happen in systems that treat internal link resolvers differently than query/mutations.
Build & Federate Graphs in StepZen
Supporting multiple patterns, StepZen gives you choice to implement a solution best for your environment when your use case is combining subgraphs built by independent teams. First, can build and combine Graphs in StepZen:
- Create GraphQL APIs in StepZen, and federated in StepZen using
@materializer
. - Create GraphQL APIs using non-StepZen technology, proxy them and federate them in StepZen
Build Subgraphs in StepZen; Federate in Apollo
Your federation layer may be Apollo Federation. Hand-crafting a GraphQL server to implement each subgraph can be time consuming and error prone so StepZen lets you quickly enable your subgraphs for Apollo Federation.
- Use
@materializer
to connect subgraphs and extend them with the Apollo Federation@key
directive. Easily enable Apollo Federation capabilities like@external
and_service
and_entities
query fields. - Create GraphQL APIs (subgraphs) in StepZen, or proxy APIs that were built using non-StepZen technology, and federate them in Apollo.