Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

apollo-test-utils

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

apollo-test-utils - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

6

package.json
{
"name": "apollo-test-utils",
"version": "0.1.0",
"version": "0.1.1",
"description": "",
"author": "Kamil Kisiela <kamil.kisiela@gmail.com>",
"contributors": ["Jonas Helfer <jonas@helfer.email>"],
"contributors": [
"Jonas Helfer <jonas@helfer.email>"
],
"license": "MIT",

@@ -8,0 +10,0 @@ "main": "./dist/src/index.js",

# apollo-test-utils
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 } }`,
});
```
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc