0.18.0 • Published 2 years ago

@data-eden/mocker v0.18.0

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

@data-eden/mocker

Installation

yarn add @data-eden/codegen @data-eden/mocker

Usage

Utilizing the gql preprocesing from @data-eden/codegen passing that object to the mocker will be all you need along with the schema to start to generate mocks. By default the mocker mocks out required fields only, passing in the fields will override the default mocking strategy as well as mock out optionals if present in the data passed in.

import { gql } from '@data-eden/codegen/gql';

const carTwoFragment = gql`
  fragment carTwo on Car {
    id
    make
  }
`;

const mocker = new Mocker({
  schema,
});

const result = mocker.mock(carTwoFragment, { id: 1234 });
/**
{
  "id": 1234,
  "make": "whose nor",
}
*/
0.17.2

2 years ago

0.16.3

2 years ago

0.17.3

2 years ago

0.17.0

2 years ago

0.18.0

2 years ago

0.17.1

2 years ago

0.16.2

2 years ago

0.16.0

2 years ago

0.16.1

2 years ago

0.14.0

2 years ago

0.13.1

2 years ago

0.15.0

2 years ago

0.13.2

2 years ago

0.13.0

2 years ago

0.12.2

2 years ago

0.12.1

2 years ago

0.12.0

2 years ago

0.11.0

2 years ago

0.10.0

2 years ago