Skip to content

Commit

Permalink
Deprecate graphql-validate-fixtures
Browse files Browse the repository at this point in the history
  • Loading branch information
jesstelford committed Aug 29, 2024
1 parent f4a501e commit f8dcce9
Show file tree
Hide file tree
Showing 71 changed files with 11 additions and 4,729 deletions.
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ These libraries compose together to help you create performant modern JS apps th

## Usage

The Quilt repo is managed as a monorepo that is composed of 69 npm packages and one Ruby gem.
The Quilt repo is managed as a monorepo that is composed of 68 npm packages and one Ruby gem.
Each package/gem has its own `README.md` and documentation describing usage.

### Package Index
Expand All @@ -38,7 +38,6 @@ Each package/gem has its own `README.md` and documentation describing usage.
| [graphql-tool-utilities](packages/graphql-tool-utilities) | <a href="https://badge.fury.io/js/graphql-tool-utilities"><img src="https://badge.fury.io/js/graphql-tool-utilities.svg" width="200px" /></a> | Common utilities for GraphQL developer tools |
| [graphql-typed](packages/graphql-typed) | <a href="https://badge.fury.io/js/graphql-typed"><img src="https://badge.fury.io/js/graphql-typed.svg" width="200px" /></a> | A more strongly typed version of GraphQL's DocumentNode. |
| [graphql-typescript-definitions](packages/graphql-typescript-definitions) | <a href="https://badge.fury.io/js/graphql-typescript-definitions"><img src="https://badge.fury.io/js/graphql-typescript-definitions.svg" width="200px" /></a> | Generate TypeScript definition files from .graphql documents |
| [graphql-validate-fixtures](packages/graphql-validate-fixtures) | <a href="https://badge.fury.io/js/graphql-validate-fixtures"><img src="https://badge.fury.io/js/graphql-validate-fixtures.svg" width="200px" /></a> | Validates JSON fixtures for GraphQL responses against the associated operations and schema |
| [@shopify/i18n](packages/i18n) | <a href="https://badge.fury.io/js/%40shopify%2Fi18n"><img src="https://badge.fury.io/js/%40shopify%2Fi18n.svg" width="200px" /></a> | Generic i18n-related utilities |
| [@shopify/jest-dom-mocks](packages/jest-dom-mocks) | <a href="https://badge.fury.io/js/%40shopify%2Fjest-dom-mocks"><img src="https://badge.fury.io/js/%40shopify%2Fjest-dom-mocks.svg" width="200px" /></a> | Jest mocking utilities for working with the DOM |
| [@shopify/jest-koa-mocks](packages/jest-koa-mocks) | <a href="https://badge.fury.io/js/%40shopify%2Fjest-koa-mocks"><img src="https://badge.fury.io/js/%40shopify%2Fjest-koa-mocks.svg" width="200px" /></a> | Utilities to easily stub Koa context and cookies |
Expand Down
6 changes: 6 additions & 0 deletions packages/graphql-validate-fixtures/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

⚠️ DEPRECATED

This package has been deprecated and should no longer be used.

For legacy documentation, see [v3.3.0](https://github.com/Shopify/quilt/blob/graphql-validate-fixtures%403.3.0/packages/graphql-validate-fixtures/README.md).

## 3.3.1

### Patch Changes
Expand Down
56 changes: 3 additions & 53 deletions packages/graphql-validate-fixtures/README.md
Original file line number Diff line number Diff line change
@@ -1,57 +1,7 @@
# `graphql-validate-fixtures`

[![Build Status](https://github.com/Shopify/quilt/workflows/Node-CI/badge.svg?branch=main)](https://github.com/Shopify/quilt/actions?query=workflow%3ANode-CI)
[![Build Status](https://github.com/Shopify/quilt/workflows/Ruby-CI/badge.svg?branch=main)](https://github.com/Shopify/quilt/actions?query=workflow%3ARuby-CI)
[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](LICENSE.md) [![npm version](https://badge.fury.io/js/graphql-validate-fixtures.svg)](https://badge.fury.io/js/graphql-validate-fixtures.svg)
⚠️ DEPRECATED

Validates JSON fixtures for GraphQL responses against the associated operations and schema.
This package has been deprecated and should no longer be used.

## Installation

```bash
yarn add graphql-validate-fixtures
```

## Usage

In order to associate a fixture with a GraphQL query or mutation in your app, you must follow one of these conventions:

- Your fixtures are in a directory with a name matching that of the associated GraphQL operation
- Your fixtures have a key called `@operation` at the top level, which has a string value that is the name of the associated operation

Once this is done, you can validate your fixtures using the CLI or Node.js API.

### Operation

On startup this tool performs the following actions:

- Loads all schemas
- Discovers all operations belonging to each schema
- Discovers all fixtures and infers operation names as described [above](#Usage)
- Validates fixtures against the operation with a matching name
- Reports operation not found error if no schema matches
- Reports ambiguous operation name error if more than one schema matches

### Configuration

This tool reads schema information from a [`graphql-config` config file](https://the-guild.dev/graphql/config/docs/user/usage) in the project root.

### CLI

```sh
# Must provide a list of fixtures as the first argument
yarn run graphql-validate-fixtures 'src/**/fixtures/**/*.graphql.json'
```

### Node

```js
const {evaluateFixtures} = require('graphql-validate-fixtures');
evaluateFixtures({
fixturePaths: ['test/fixtures/one.json', 'test/fixtures/two.json'],
}).then((results) => {
// See the TypeScript definition file for more details on the
// structure of the `results`
results.forEach((result) => console.log(result));
});
```
For legacy documentation, see [v3.3.0](https://github.com/Shopify/quilt/blob/graphql-validate-fixtures%403.3.0/packages/graphql-validate-fixtures/README.md).

This file was deleted.

56 changes: 0 additions & 56 deletions packages/graphql-validate-fixtures/package.json

This file was deleted.

7 changes: 0 additions & 7 deletions packages/graphql-validate-fixtures/rollup.config.mjs

This file was deleted.

104 changes: 0 additions & 104 deletions packages/graphql-validate-fixtures/src/cli.ts

This file was deleted.

Loading

0 comments on commit f8dcce9

Please sign in to comment.