Skip to content

Commit

Permalink
MVP Readme
Browse files Browse the repository at this point in the history
  • Loading branch information
danieljharvey committed Apr 5, 2020
1 parent 1f05069 commit 0c8edc3
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# GraphQL Codegen for Fast Check

## What?

[GraphQL Code Generator](https://graphql-code-generator.com/) lets you generate
code from a `GraphQL` schema. It is commonly used to create `Typescript`
types to ensure the consuming program agrees with the data it is receiving.

[Fast-check](https://github.com/dubzzz/fast-check) is a Property Testing
framework for `Typescript` / `Javascript`. It allows testing properties of a
program using arbitrarily generated data. `Fast-check` uses `Arbitrary`s to
create data, that is, descriptions of the data we need to create.

Say we have this datatype...

```typescript
// our datatype
interface Person {
name: string;
age: number;
}
```

...the arbitrary would look like:

```typescript
import * as fc from "fast-check";

const personArbitrary = fc.record({
name: fc.string(),
age: fc.integer()
});
```

This can then be used in property tests or as generators to create sample test
data.

## This library

This library is a plugin for `GraphQL Code Generator` that creates `fast-check`
`Arbitrary`s for your schema data types.

## How to use

_ahem_

0 comments on commit 0c8edc3

Please sign in to comment.