@envelop/generic-auth 4.4.0-alpha-20220815073159-82280bf2 → 4.4.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/README.md +2 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -61,6 +61,7 @@ const validateUser: ValidateUserFn<UserType> = params => {
|
|
|
61
61
|
// This method is being triggered in different flows, based on the mode you chose to implement.
|
|
62
62
|
|
|
63
63
|
// If you are using the `protect-auth-directive` mode, you'll also get 2 additional parameters: the resolver parameters as object and the DirectiveNode of the auth directive.
|
|
64
|
+
// In `protect-auth-directive` mode, this function will always get called and you can use these parameters to check if the field has the `@auth` or `@skipAuth` directive
|
|
64
65
|
|
|
65
66
|
if (!user) {
|
|
66
67
|
throw new Error(`Unauthenticated!`)
|
|
@@ -106,7 +107,7 @@ const getEnveloped = envelop({
|
|
|
106
107
|
|
|
107
108
|
> By default, we assume that you have the GraphQL directive definition as part of your GraphQL schema (`directive @skipAuth on FIELD_DEFINITION`).
|
|
108
109
|
|
|
109
|
-
Then, in your GraphQL schema SDL, you can add `@skipAuth` directive to your fields, and the `validateUser` will not get called while resolving that specific field:
|
|
110
|
+
Then, in your GraphQL schema SDL, you can add `@skipAuth` directive to your fields, and the default `validateUser` function will not get called while resolving that specific field:
|
|
110
111
|
|
|
111
112
|
```graphql
|
|
112
113
|
type Query {
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@envelop/generic-auth",
|
|
3
|
-
"version": "4.4.0
|
|
3
|
+
"version": "4.4.0",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"peerDependencies": {
|
|
6
|
-
"@envelop/core": "2.5.0
|
|
6
|
+
"@envelop/core": "^2.5.0",
|
|
7
7
|
"graphql": "^14.0.0 || ^15.0.0 || ^16.0.0"
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
|
-
"@envelop/extended-validation": "1.8.0
|
|
10
|
+
"@envelop/extended-validation": "^1.8.0"
|
|
11
11
|
},
|
|
12
12
|
"repository": {
|
|
13
13
|
"type": "git",
|