@envelop/validation-cache 4.5.1 → 4.5.3-alpha-62b6e087.0

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.
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@envelop/validation-cache",
3
- "version": "4.5.1",
3
+ "version": "4.5.3-alpha-62b6e087.0",
4
4
  "sideEffects": false,
5
5
  "peerDependencies": {
6
- "@envelop/core": "^2.4.1",
6
+ "@envelop/core": "2.4.3-alpha-62b6e087.0",
7
7
  "graphql": "^14.0.0 || ^15.0.0 || ^16.0.0"
8
8
  },
9
9
  "dependencies": {
@@ -26,7 +26,7 @@
26
26
  "exports": {
27
27
  ".": {
28
28
  "require": {
29
- "types": "./typings/index.d.ts",
29
+ "types": "./typings/index.d.cts",
30
30
  "default": "./cjs/index.js"
31
31
  },
32
32
  "import": {
@@ -40,7 +40,7 @@
40
40
  },
41
41
  "./*": {
42
42
  "require": {
43
- "types": "./typings/*.d.ts",
43
+ "types": "./typings/*.d.cts",
44
44
  "default": "./cjs/*.js"
45
45
  },
46
46
  "import": {
@@ -0,0 +1,24 @@
1
+ import { Plugin } from '@envelop/core';
2
+ import { GraphQLError } from 'graphql';
3
+ export interface ValidationCache {
4
+ /**
5
+ * Get a result from the validation cache.
6
+ */
7
+ get(key: string): readonly GraphQLError[] | undefined;
8
+ /**
9
+ * Set a result to the validation cache.
10
+ */
11
+ set(key: string, value: readonly GraphQLError[]): void;
12
+ /**
13
+ * @deprecated Provide a `reset` implementation instead.
14
+ */
15
+ clear?(): void;
16
+ /**
17
+ * Reset the cache by clearing all entries.
18
+ */
19
+ reset?(): void;
20
+ }
21
+ export declare type ValidationCacheOptions = {
22
+ cache?: ValidationCache;
23
+ };
24
+ export declare const useValidationCache: (pluginOptions?: ValidationCacheOptions) => Plugin;