sofa

sofa

  • Documentation
  • Github

›Introduction

Introduction

  • Getting Started

Essentials

  • Queries
  • Mutations
  • Subscription

Recipes

  • OpenAPI (Swagger)

API

  • Nested data and Models
  • Using context
  • Using objects instead of IDs
  • Custom execute phase
  • Error Handling
  • Customize endpoint's HTTP Method

Getting Started

An open source library you install on your GraphQL server to create a fully RESTful and configurable API gateway.

  • Don’t choose between REST and GraphQL
  • Get most of the benefits of GraphQL on the backend and frontend, while using and exposing REST
  • Support all your existing clients with REST while improving your backend stack with GraphQL
  • Create custom, perfectly client-aligned REST endpoints for your frontend simply by naming a route and attaching a query
  • In the other way around (REST to GraphQL) you won’t get the best of both worlds. Instead just less powerful, harder-to-maintain server implementations with a some of the benefits of GraphQL. It can be a good and fast start for a migration though.
  • Fully generated documentation that is always up-to-date
  • GraphQL Subscriptions as Webhooks

Installation

Install Sofa using yarn:

yarn add sofa-api

Or npm:

npm install sofa-api

Usage

import { useSofa } from 'sofa-api';
import express from 'express';

const app = express();

app.use('/api', useSofa({ schema }));

// GET  /api/messages
// POST /api/add-message
Last updated on 4/12/2022 by Kamil Kisiela
Queries →
sofa
Twitter·Medium·Github
Copyright © 2022 The Guild