npm.io
1.1.2 • Published 5 years ago

graphback

Licence
Apache-2.0
Version
1.1.2
Deps
6
Size
35 kB
Vulns
0
Weekly
0
Stars
407

Graphback


Auto generate database structure,
GraphQL Resolvers and Queries from GraphQL types

Motivation

Graphback helps you to kickstart your experience with any existing GraphQL implementation by generating backend and client side CRUD layer using your GraphQL data model.

Documentation: https://graphback.dev

Repository: https://github.com/aerogear/graphback/

Usage

graphback provides a programmatic API for the Graphback ecosystem. In most of the cases you can use graphback by utilizing graphback-cli package that will expose all useful commands and cover most of the use cases.

Install with npm:

npm install graphback

Install with yarn:

npm install graphback

buildGraphbackAPI will process your schema and generate a CRUD API with schema, resolvers, services and data sources.

import { buildGraphbackAPI } from 'graphback';
import { createKnexDbProvider } from '@graphback/runtime-knex';
import Knex from 'knex';

const db = Knex({...});

const { typeDefs, resolvers, contextCreator } = buildGraphbackAPI(schema, {
  dataProviderCreator: createKnexDbProvider(db)
});

Up-to-date usage and configuration information is covered in depth over on our website graphhback.dev.