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

graphql-mock

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

graphql-mock - npm Package Compare versions

Comparing version 0.1.0 to 0.2.0

2

package.json
{
"name": "graphql-mock",
"version": "0.1.0",
"version": "0.2.0",
"description": "GraphQL endpoint mockery library for testing",

@@ -5,0 +5,0 @@ "files": [

@@ -32,2 +32,3 @@ # GraphQL Client Side Mocking

// optional mocks
const mocks = {

@@ -37,3 +38,8 @@ ... // your regular apollo mocks

export default new GraphQLMock(schema, mocks);
// optional resolvers
const resolvers = {
... // graphql resolvers
};
export default new GraphQLMock(schema, mocks, resolvers);
```

@@ -92,3 +98,19 @@

## Using Existing Schema
If you have your own schema, for example to use custom resolvers, you pass a schema
instance into the `GraphqlMock` constructor:
```js
const typeDefs = `
`;
const resolvers = {
// ...
};
const schema = makeExecutableSchema({ typeDefs });
const mock = new GraphqlMock(schema);
```
## API & Stuff

@@ -95,0 +117,0 @@

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