# graphfront

> Generate a GraphQL schema for any PostgreSQL database using the database schema information

Latest version **0.3.1** (published 2018-08-25) · MIT license · 0 weekly downloads

## Install

```sh
npm install graphfront
pnpm add graphfront
yarn add graphfront
bun add graphfront
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.3.1 |
| Published | 2018-08-25 |
| First published | 2017-03-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 5 |
| Unpacked size | 37.3 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 142 |
| Author | Samer Buna |
| Maintainers | samer |
| Keywords | GraphQL, PostgreSQL, Database, API |

## Links

- npm: https://www.npmjs.com/package/graphfront
- Repository: https://github.com/jscomplete/graphfront
- Homepage: https://github.com/jscomplete/graphfront#readme
- Issues: https://github.com/jscomplete/graphfront/issues
- npm.io page: https://npm.io/package/graphfront

## Dependencies (5)

- [humps](https://npm.io/package/humps.md) ^2.0.1
- [bcrypt](https://npm.io/package/bcrypt.md) ^3.0.0
- [graphql](https://npm.io/package/graphql.md) ^0.13.2
- [pluralize](https://npm.io/package/pluralize.md) ^7.0.0
- [express-graphql](https://npm.io/package/express-graphql.md) ^0.6.12

## Alternatives

- [@libsql/sqlite3](https://npm.io/package/@libsql/sqlite3.md) — 39.8K weekly downloads
- [@fortemi/core](https://npm.io/package/@fortemi/core.md) — 461 weekly downloads
- [cdb-converter](https://npm.io/package/cdb-converter.md) — 341 weekly downloads
- [@uplo/adapter-prisma](https://npm.io/package/@uplo/adapter-prisma.md) — 75 weekly downloads
- [typeorm-aios](https://npm.io/package/typeorm-aios.md) — 30 weekly downloads

## Recent versions

- 0.3.1 (latest) — 2018-08-25
- 0.3.0 — 2018-08-25
- 0.2.12 — 2018-08-25
- 0.2.11 — 2018-08-25
- 0.2.10 — 2018-05-26
- 0.2.9 — 2018-05-26
- 0.2.8 — 2018-03-18
- 0.2.7 — 2017-11-24
- 0.2.6 — 2017-10-28
- 0.2.5 — 2017-10-28
- 0.2.4 — 2017-10-28
- 0.2.3 — 2017-10-28
- 0.2.2 — 2017-09-14
- 0.2.1 — 2017-09-14
- 0.2.0 — 2017-09-14
- … 4 more at https://npm.io/package/graphfront/versions

## README

# Graphfront

Use a PostgreSQL database schema information to generate a GraphQL schema.

This is a work-in-progress project.
It requires a super recent version of Node.js and using it in production is not recommended.


[![Build Status](https://travis-ci.org/jscomplete/graphfront.svg?branch=master)](https://travis-ci.org/jscomplete/graphfront)
[![npm version](https://badge.fury.io/js/graphfront.svg)](https://badge.fury.io/js/graphfront)

## Getting Started

An overview of GraphQL in general is available in the
[README](https://github.com/facebook/graphql/blob/master/README.md) for the
[Specification for GraphQL](https://github.com/facebook/graphql).

### Using Graphfront

Install Graphfront from npm

```sh
npm install --save graphfront
```

Graphfront provides two important capabilities: generating a GraphQL schema, and
exposing an HTTP handler to server requests for that schema.

First, generate a GraphQL schema based on a database schema.

```js
import { generator } from 'graphfront';

const { getSchema } = generator(dbPool, apiKeyValidator);
```

This defines a function that can be invoked to generate a schema.

Or you can use request handler that automatically generates the schema

```js
const graphfront = require('graphfront');

const graphfrontHTTP = graphfront({
  dbPool,
  apiKeyValidator: (apiKey) => apiKey === 'SuperSecretKey'
});

app.use('/my-api', graphfrontHTTP);
```

### Contributing

We actively welcome pull requests, learn how to
[contribute](https://github.com/jscomplete/graphfront/blob/master/CONTRIBUTING.md).

### Changelog

Changes are tracked as [Github releases](https://github.com/jscomplete/graphfront/releases).

### License

graphfront is [MIT licensed](./LICENSE).

---
_Source: https://npm.io/package/graphfront · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
