/snippets

Snippets for securing, transforming, and optimizing GraphQL APIs.

Primary LanguageJavaScriptMIT LicenseMIT


Logo

StepZen Snippets

Welcome! StepZen is a unique and declarative way to build & run any-sized Graph in minutes.

About the project

Code snippets that demonstrate use of custom directives and other techniques in IBM API Connect Essentials (StepZen).

Getting Started

Sign up for a free API Connect Essentials SaaS plan: https://www.ibm.com/account/reg/us-en/signup?formid=urx-52542

Read: understanding API Connect Essentials (StepZen)

Install the StepZen command line interface.

Documentation: https://www.ibm.com/docs/en/api-connect/ace/saas

Snippets

The snippets are generally broken up into functional areas, with each folder covering a specific topic:

Custom Directives

  • @dbquery - Use @dbquery for connecting to databases, including pagination and filtering.
  • @materializer - Use of @materializer to extend types by linking disparate backends into a single unified view.
  • @rest - Connects to REST APIs
    • rest - Use of @rest for connecting to REST endpoints, including pagination.
    • transforms - How to transform REST API responses to match GraphQL types with @rest.
  • @sequence - Use of @sequence to resolve a field from multiple field resolutions, such as multiple backend calls.
  • @sdl
    • executable - How GraphQL executable documents can be registered and used with a schema or endpoint.
  • @supplies

General topics

  • pocs - Techniques that can be used during development of proof of concepts with StepZen.
  • protection - How to protect or expose GraphQL endpoints including field based access rules.
  • reshape - How to reshape GraphQL schema elements.
  • unions - Uses of the GraphQL union type.