# graphql-tool-utilities

> Common utilities for GraphQL developer tools

Latest version **3.1.1** (published 2024-08-28) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install graphql-tool-utilities
pnpm add graphql-tool-utilities
yarn add graphql-tool-utilities
bun add graphql-tool-utilities
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 3.1.1 |
| Published | 2024-08-28 |
| First published | 2017-05-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=18.12.0 |
| Dependencies | 2 |
| Unpacked size | 9.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1681 |
| Author | Shopify Inc. |
| Maintainers | lemonmade, shopify-dep |

## Links

- npm: https://www.npmjs.com/package/graphql-tool-utilities
- Repository: https://github.com/Shopify/quilt
- Homepage: https://github.com/Shopify/quilt/blob/main/packages/graphql-tool-utilities/README.md
- Issues: https://github.com/Shopify/quilt/issues
- npm.io page: https://npm.io/package/graphql-tool-utilities

## Dependencies (2)

- [graphql](https://npm.io/package/graphql.md) >=14.5.0 <17.0.0
- [apollo-codegen-core](https://npm.io/package/apollo-codegen-core.md) ^0.40.4

## Recent versions

- 3.1.1 (latest) — 2024-08-28
- 0.0.0-snapshot-20240828012157 (snapshot) — 2024-08-28
- 2.1.6-apollo-3-beta.2 (next) — 2022-03-21
- 3.1.0 — 2024-06-10
- 3.0.4 — 2024-05-31
- 0.0.0-snapshot-20240531073328 — 2024-05-31
- 3.0.3 — 2023-03-23
- 3.0.2 — 2023-03-15
- 3.0.1 — 2022-08-24
- 3.0.0 — 2022-05-19
- 2.1.7 — 2022-04-25
- 2.1.6 — 2022-03-09
- 2.1.5 — 2022-02-25
- 2.1.4-export-beta.0 — 2022-02-22
- 2.1.4 — 2022-02-01
- … 43 more at https://npm.io/package/graphql-tool-utilities/versions

## README

# `graphql-tool-utilities`

[![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-tool-utilities.svg)](https://badge.fury.io/js/graphql-tool-utilities.svg)

Common utilities for GraphQL developer tools.

## Installation

```bash
yarn add graphql-tool-utilities
```

## Usage

### AST

#### `compile(schema: GraphQLSchema, document: DocumentNode, options?: CompilerOptions): AST`

Compiles the provided schema and document into an intermediary representation using https://github.com/apollographql/apollo-cli/blob/main/packages/apollo-codegen-core/src/compiler/legacyIR.ts. This intermediate representation makes it easy to navigate through operations and their fields, without having to manually traverse the document and associate fields with the schema manually.

`AST` is our own improvement to the `LegacyCompilerContext` type definitions, but still fully backwards compatible with `LegacyCompilerContext`. See the TypeScript type definition for a detailed description of the returned `AST` type (or see [`LegacyCompilerContext`](https://github.com/apollographql/apollo-cli/blob/main/packages/apollo-codegen-core/src/compiler/legacyIR.ts) inside the [`apollo-codegen-core` module](https://github.com/apollographql/apollo-cli/tree/main/packages/apollo-codegen-core)).

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