@envelop/generic-auth 4.3.1 → 5.0.0-alpha-fc40ee4.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 +3 -3
- package/cjs/index.js +1 -1
- package/esm/index.js +1 -1
- package/package.json +4 -4
- package/typings/index.d.ts +1 -1
package/README.md
CHANGED
|
@@ -123,7 +123,7 @@ type Query {
|
|
|
123
123
|
##### Allow unauthenticated access for specific fields using a field extension
|
|
124
124
|
|
|
125
125
|
```typescript
|
|
126
|
-
import { GraphQLObjectType, GraphQLInt } from 'graphql'
|
|
126
|
+
import { GraphQLObjectType, GraphQLInt } from '@graphql-tools/graphql'
|
|
127
127
|
|
|
128
128
|
const GraphQLQueryType = new GraphQLObjectType({
|
|
129
129
|
name: 'Query',
|
|
@@ -237,7 +237,7 @@ type Query {
|
|
|
237
237
|
##### Protect a field using a field extension
|
|
238
238
|
|
|
239
239
|
```typescript
|
|
240
|
-
import { GraphQLObjectType, GraphQLInt } from 'graphql'
|
|
240
|
+
import { GraphQLObjectType, GraphQLInt } from '@graphql-tools/graphql'
|
|
241
241
|
|
|
242
242
|
const GraphQLQueryType = new GraphQLObjectType({
|
|
243
243
|
name: 'Query',
|
|
@@ -260,7 +260,7 @@ const GraphQLQueryType = new GraphQLObjectType({
|
|
|
260
260
|
You can also specify a custom `validateUser` function and get access to a handy object while using the `protect-all` and `protect-granular` mode:
|
|
261
261
|
|
|
262
262
|
```ts
|
|
263
|
-
import { GraphQLError } from 'graphql'
|
|
263
|
+
import { GraphQLError } from '@graphql-tools/graphql'
|
|
264
264
|
import { ValidateUserFn } from '@envelop/generic-auth'
|
|
265
265
|
|
|
266
266
|
const validateUser: ValidateUserFn<UserType> = async ({ user }) => {
|
package/cjs/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.useGenericAuth = exports.defaultProtectSingleValidateFn = exports.defaultProtectAllValidateFn = exports.SKIP_AUTH_DIRECTIVE_SDL = exports.DIRECTIVE_SDL = exports.UnauthenticatedError = void 0;
|
|
4
|
-
const graphql_1 = require("graphql");
|
|
4
|
+
const graphql_1 = require("@graphql-tools/graphql");
|
|
5
5
|
const extended_validation_1 = require("@envelop/extended-validation");
|
|
6
6
|
class UnauthenticatedError extends graphql_1.GraphQLError {
|
|
7
7
|
}
|
package/esm/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getNamedType, GraphQLError, isInterfaceType, isIntrospectionType, isObjectType, isUnionType, } from 'graphql';
|
|
1
|
+
import { getNamedType, GraphQLError, isInterfaceType, isIntrospectionType, isObjectType, isUnionType, } from '@graphql-tools/graphql';
|
|
2
2
|
import { useExtendedValidation } from '@envelop/extended-validation';
|
|
3
3
|
export class UnauthenticatedError extends GraphQLError {
|
|
4
4
|
}
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@envelop/generic-auth",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.0.0-alpha-fc40ee4.0",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"peerDependencies": {
|
|
6
|
-
"@envelop/core": "
|
|
7
|
-
"graphql": "
|
|
6
|
+
"@envelop/core": "3.0.0-alpha-fc40ee4.0",
|
|
7
|
+
"@graphql-tools/graphql": "0.1.0-alpha-33fb2950.0"
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
|
-
"@envelop/extended-validation": "
|
|
10
|
+
"@envelop/extended-validation": "2.0.0-alpha-fc40ee4.0"
|
|
11
11
|
},
|
|
12
12
|
"repository": {
|
|
13
13
|
"type": "git",
|
package/typings/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DefaultContext, Maybe, Plugin, PromiseOrValue } from '@envelop/core';
|
|
2
|
-
import { DirectiveNode, FieldNode, GraphQLError, GraphQLObjectType } from 'graphql';
|
|
2
|
+
import { DirectiveNode, FieldNode, GraphQLError, GraphQLObjectType } from '@graphql-tools/graphql';
|
|
3
3
|
export declare class UnauthenticatedError extends GraphQLError {
|
|
4
4
|
}
|
|
5
5
|
export declare type ResolveUserFn<UserType, ContextType = DefaultContext> = (context: ContextType) => PromiseOrValue<Maybe<UserType>>;
|