# @rootbeer/zero

> Mock your GraphQL API with AI generated faked data... zero config

Latest version **0.1.7** (published 2023-07-28) · MIT license · 0 weekly downloads

## Install

```sh
npm install @rootbeer/zero
pnpm add @rootbeer/zero
yarn add @rootbeer/zero
bun add @rootbeer/zero
```

Provides the command `zero`.

## Health

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

Positive: has types; no vulnerabilities; high quality score.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.7 |
| Published | 2023-07-28 |
| First published | 2023-06-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 10 |
| Unpacked size | 1011.9 KB |
| Known vulnerabilities | 0 (+7 in 4 direct dependencies) |
| Install scripts | no |
| GitHub stars | 41 |
| Author | Rootbeer Computer Inc. |
| Maintainers | evanmays |

## Links

- npm: https://www.npmjs.com/package/@rootbeer/zero
- Repository: https://github.com/RootbeerComputer/zero
- Homepage: https://github.com/RootbeerComputer/zero#readme
- Issues: https://github.com/RootbeerComputer/zero/issues
- npm.io page: https://npm.io/package/@rootbeer/zero

## Dependencies (10)

- [cors](https://npm.io/package/cors.md) 2.8.5
- [open](https://npm.io/package/open.md) 8.0.5
- [chalk](https://npm.io/package/chalk.md) 4.1.0
- [yargs](https://npm.io/package/yargs.md) 15.3.1
- [moment](https://npm.io/package/moment.md) 2.29.1
- [express](https://npm.io/package/express.md) 4.17.1
- [graphql](https://npm.io/package/graphql.md) 15.7.2
- [node-fetch](https://npm.io/package/node-fetch.md) 2.6.1
- [body-parser](https://npm.io/package/body-parser.md) 1.19.0
- [express-graphql](https://npm.io/package/express-graphql.md) 0.12.0

## Recent versions

- 0.1.7 (latest) — 2023-07-28
- 0.1.5 — 2023-07-24
- 0.1.4 — 2023-07-20
- 0.1.3 — 2023-07-20
- 0.1.2 — 2023-07-20
- 0.1.1 — 2023-07-18
- 0.1.0 — 2023-07-18
- 0.0.9 — 2023-07-07
- 0.0.8 — 2023-06-29
- 0.0.7 — 2023-06-29
- 0.0.6 — 2023-06-27
- 0.0.5 — 2023-06-27
- 0.0.4 — 2023-06-20
- 0.0.3 — 2023-06-20
- 0.0.2 — 2023-06-20
- … 1 more at https://npm.io/package/@rootbeer/zero/versions

## README

<div align="center">
:rotating_light: Experimental :warning: <a href="https://www.loom.com/share/abad2cdf325e4e0b9addea1e14406166?sid=484ab008-e9ae-4681-be93-ec419d9eec90">[Demo Video]</a> 
</div>

# GraphQL Zero

<div align="center">
  
[![Discord](https://img.shields.io/discord/1122949106558570648)](https://discord.gg/3ASBTJWgGS)

</div>

Mock your GraphQL API with generative AI fake data... zero config. Powered by LLMs that look at your schema and populate a "parallel universe" of fake data so you can prototype and test your frontend w/o implementing the backend or manually entering a bunch of data.

Use for your next prototyping session, product demo, or QA bug bash!

Example schemas are provided in the `examples` folder

```
npm install -g @rootbeer/zero
zero schema.graphql
```

Then swap out the URL in your frontend code with

```
http://localhost:9000
```

Note: We don't support persisted queries yet

To proxy to a real graphql server. Write your SDL file with extended types then use this command.

```
zero extended_schema.graphql --extend https://spacex-production.up.railway.app
```

## Motivation

We live in modern times, why poke around in a 100 tabs trying to populate data for your app?

Zero is unlike anything you've seen before
- It's zero config. No faker! No annotating your SDL! No directives!
- It's static. static consistent data: it feels as if its real. you can play around with your app, not just stuck on one page with a chunk of lorem ipsum
- :soon: It's dynamic. AI generated business logic, so you can query and MUTATE. Inspired by [Backend GPT](https://github.com/RootbeerComputer/backend-GPT)
- It's incremental. Mock your entire API to completely separate from prod, or extend an existing API with proxying `zero schema.graphql --extend https://existing-server.com/graphql`

Credit: This repo is a hard fork of [graphql-faker](https://github.com/graphql-kit/graphql-faker)

## Features

Releasing super early and unpolished. There's a 20% chance this works with your GraphQL schema. If it fails, try an easier schema :flushed: If it still fails, make an issue!

- [x] Optionally proxy an existing GraphQL API to extend it with faked data
- [x] Runs as local graphql server
- [x] queries (using heuristics for arguments)
- [ ] persisted queries
- [ ] field arguments for leaf fields (using heuristics)
- [ ] custom scalars (starting with popular standards)
- [ ] directives (starting with popular standards)
- [ ] mutations (including file uploads and auth)
- [ ] subscriptions
- [x] pagination

## How it works

This CLI tool sends our server an introspection AST of your GraphQL SDL (including docstrings). Our server runs fancy AI algorithms to create a blob of mock data, which gets sent back to the CLI tool. From then on, all queries are executed locally on your machine. We mock at the GraphQL level so it's data source agnostic and client agnostic (Apollo, iOS, Java, etc).

## Contribute

All PRs will be reviewed within 24 hours!

I'd especially appreciate bugfixes, examples, tests, federation support, quality of life improvements, and render/heroku/docker build things!

For bigger contributions, we have a [GitHub Project](https://github.com/orgs/RootbeerComputer/projects/2)

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