Skip to content

Instantly share code, notes, and snippets.

@adambisek
Created December 16, 2017 12:53
Show Gist options
  • Save adambisek/44e01078755076234cf39dd95826a57a to your computer and use it in GitHub Desktop.
Save adambisek/44e01078755076234cf39dd95826a57a to your computer and use it in GitHub Desktop.
import { mockNetworkInterface } from 'react-apollo/test-utils';
const mocks = [
{
request: {
query: ...,
variables: {}
},
result: {
data: {
user: {
id: 1,
name: 'Foo Bar',
}
}
}
}
];
const networkInterface = mockNetworkInterface(...mocks);
const client = new ApolloClient({ networkInterface, addTypename: false });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment