@graphql-tools/mock 8.4.2-alpha-c3063363.0 → 8.4.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/index.js +6 -0
  2. package/index.mjs +6 -0
  3. package/package.json +3 -3
package/index.js CHANGED
@@ -708,6 +708,12 @@ function addMocksToSchema({ schema: schema$1, store: maybeStore, mocks, typePoli
708
708
  fieldArgs: args,
709
709
  });
710
710
  }
711
+ if (defaultResolvedValue === undefined) {
712
+ const mockFn = mocks === null || mocks === void 0 ? void 0 : mocks[info.returnType.toString()];
713
+ if (typeof mockFn === 'function') {
714
+ return mockFn(source, args, contex, info);
715
+ }
716
+ }
711
717
  return undefined;
712
718
  };
713
719
  const typeResolver = data => {
package/index.mjs CHANGED
@@ -702,6 +702,12 @@ function addMocksToSchema({ schema, store: maybeStore, mocks, typePolicies, reso
702
702
  fieldArgs: args,
703
703
  });
704
704
  }
705
+ if (defaultResolvedValue === undefined) {
706
+ const mockFn = mocks === null || mocks === void 0 ? void 0 : mocks[info.returnType.toString()];
707
+ if (typeof mockFn === 'function') {
708
+ return mockFn(source, args, contex, info);
709
+ }
710
+ }
705
711
  return undefined;
706
712
  };
707
713
  const typeResolver = data => {
package/package.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "@graphql-tools/mock",
3
- "version": "8.4.2-alpha-c3063363.0",
3
+ "version": "8.4.3",
4
4
  "description": "A set of utils for faster development of GraphQL tools",
5
5
  "sideEffects": false,
6
6
  "peerDependencies": {
7
7
  "graphql": "^14.0.0 || ^15.0.0 || ^16.0.0"
8
8
  },
9
9
  "dependencies": {
10
- "@graphql-tools/schema": "8.3.1-alpha-c3063363.0",
11
- "@graphql-tools/utils": "8.6.0-alpha-c3063363.0",
10
+ "@graphql-tools/schema": "^8.3.1",
11
+ "@graphql-tools/utils": "^8.5.1",
12
12
  "fast-json-stable-stringify": "^2.1.0",
13
13
  "tslib": "~2.3.0"
14
14
  },