# apollo-test-utils

> [![Greenkeeper badge](https://badges.greenkeeper.io/apollographql/apollo-test-utils.svg)](https://greenkeeper.io/)

Latest version **0.3.2** (published 2017-06-03) · MIT license · 0 weekly downloads

## Install

```sh
npm install apollo-test-utils
pnpm add apollo-test-utils
yarn add apollo-test-utils
bun add apollo-test-utils
```

## 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.3.2 |
| Published | 2017-06-03 |
| First published | 2017-02-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Kamil Kisiela |
| Maintainers | helfer |

## Links

- npm: https://www.npmjs.com/package/apollo-test-utils
- Repository: https://github.com/apollographql/apollo-test-utils
- Homepage: https://github.com/apollostack/apollo-test-utils#readme
- Issues: https://github.com/apollostack/apollo-test-utils/issues
- npm.io page: https://npm.io/package/apollo-test-utils

## Dependencies (3)

- [graphql](https://npm.io/package/graphql.md) ^0.10.0
- [graphql-tag](https://npm.io/package/graphql-tag.md) ^2.0.0
- [graphql-tools](https://npm.io/package/graphql-tools.md) ^1.0.0

## Recent versions

- 0.3.2 (latest) — 2017-06-03
- 0.3.1 — 2017-06-03
- 0.3.0 — 2017-03-31
- 0.2.2 — 2017-03-22
- 0.2.1 — 2017-03-20
- 0.2.0 — 2017-03-10
- 0.1.2 — 2017-03-03
- 0.1.1 — 2017-02-28
- 0.1.0 — 2017-02-28

## README

# apollo-test-utils

[![Greenkeeper badge](https://badges.greenkeeper.io/apollographql/apollo-test-utils.svg)](https://greenkeeper.io/)

This is a very rudimentary package that currently only exports functions for mocking an Apollo Client network interface. Here's an example for how to use it:

```js
  import ApolloClient from 'apollo-client';
  import gql from 'graphql-tag';
  import { makeExecutableSchema, addMockFunctionsToSchema } from 'graphql-tools';
  import { mockNetworkInterfaceWithSchema } from 'apollo-test-utils';

  const typeDefs = `
      type User {
        id: Int
        name: String
      }

      type Query {
        user: User
      }
    `;

  const schema = makeExecutableSchema({ typeDefs });
  addMockFunctionsToSchema({ schema });

  const mockNetworkInterface = mockNetworkInterfaceWithSchema({ schema });

  const client = new ApolloClient({
    networkInterface: mockNetworkInterface,
  });

  client.query({
    query: gql`{ user { name } }`,
  });

```

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