Skip to content

Commit 968f46a

Browse files
committed
Use envelop-native API for adding validation rule
1 parent 16c8aa1 commit 968f46a

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/envelop.ts

+2-5
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,13 @@
11
import type { Plugin } from "@envelop/core";
2-
import { specifiedRules } from "graphql";
32

43
import { depthLimit } from "./index.js";
54
import type { Options } from "./interfaces.js";
65

76
export function useDepthLimit(options: Options): Plugin {
87
const rule = depthLimit(options);
98
return {
10-
onValidate({ params }) {
11-
params.rules = params.rules
12-
? [...params.rules, rule]
13-
: [...specifiedRules, rule];
9+
onValidate({ addValidationRule }) {
10+
addValidationRule(rule);
1411
},
1512
};
1613
}

0 commit comments

Comments
 (0)