graphql-safe-guards 1.0.2 β 1.0.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.
- package/CHANGELOG.md +12 -0
- package/README.md +19 -0
- package/package.json +1 -1
- package/test/graphqlSafeGuards.test.ts +0 -28
package/CHANGELOG.md
ADDED
package/README.md
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+

|
|
2
|
+

|
|
3
|
+

|
|
4
|
+

|
|
5
|
+

|
|
6
|
+
|
|
1
7
|
# graphql-safe-guards
|
|
2
8
|
|
|
3
9
|
Protect your GraphQL API with a single import.
|
|
@@ -57,6 +63,8 @@ Internally, this package composes:
|
|
|
57
63
|
- `graphql-safe-depth`
|
|
58
64
|
- `graphql-complexity-validation`
|
|
59
65
|
|
|
66
|
+
The combination is validated through integration tests using native GraphQL validation.
|
|
67
|
+
|
|
60
68
|
---
|
|
61
69
|
|
|
62
70
|
## Supported Frameworks
|
|
@@ -79,6 +87,17 @@ for GraphQL query safety.
|
|
|
79
87
|
|
|
80
88
|
---
|
|
81
89
|
|
|
90
|
+
## πΊοΈ Roadmap
|
|
91
|
+
|
|
92
|
+
### v1.x (current)
|
|
93
|
+
|
|
94
|
+
- β
Combine depth + complexity validation
|
|
95
|
+
- β
Presets support (`strict`, `balanced`, `relaxed`)
|
|
96
|
+
- β
Backward-compatible API
|
|
97
|
+
- β
Integration tests with `graphql-js`
|
|
98
|
+
|
|
99
|
+
> Roadmap items may change based on feedback and real-world usage.
|
|
100
|
+
|
|
82
101
|
## License
|
|
83
102
|
|
|
84
103
|
MIT Β© Mateo Diaz
|
package/package.json
CHANGED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { describe, it, expect } from "vitest";
|
|
2
|
-
import { createSafeGuards } from "../src";
|
|
3
|
-
|
|
4
|
-
describe("createSafeGuards", () => {
|
|
5
|
-
it("uses strict preset", () => {
|
|
6
|
-
const rules = createSafeGuards({ preset: "strict" });
|
|
7
|
-
|
|
8
|
-
expect(rules).toHaveLength(2);
|
|
9
|
-
});
|
|
10
|
-
|
|
11
|
-
it("allows overriding preset values", () => {
|
|
12
|
-
const rules = createSafeGuards({
|
|
13
|
-
preset: "strict",
|
|
14
|
-
depth: 10,
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
expect(rules).toHaveLength(2);
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
it("works without preset (backward compatible)", () => {
|
|
21
|
-
const rules = createSafeGuards({
|
|
22
|
-
depth: 4,
|
|
23
|
-
complexity: 20,
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
expect(rules).toHaveLength(2);
|
|
27
|
-
});
|
|
28
|
-
});
|