Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/pothos/packages/plugin-scope-auth/request-cache.ts>default

Pothos GraphQL is library for creating GraphQL schemas in typescript using a strongly typed code first approach
Go to Latest
class default
import { default } from "https://deno.land/x/pothos@release-1686440053/packages/plugin-scope-auth/request-cache.ts";

Constructors

new
default(builder: PothosSchemaTypes.SchemaBuilder<Types>, context: Types["Context"])

Properties

builder
optional
cacheKey: (value: unknown) => unknown
context
grantCache: Map<string, Set<string>>
mapCache: Map<{ }, MaybePromise<null | AuthFailure>>
scopeCache: Map<keyof Types["AuthScopes"], Map<unknown, MaybePromise<AuthFailure | null>>>
treatErrorsAsUnauthorized: boolean
typeCache: Map<string, Map<unknown, MaybePromise<null | AuthFailure>>>
typeGrants: Map<string, Map<unknown, MaybePromise<null>>>

Methods

evaluateScopeLoader<T extends keyof Types["AuthScopes"]>(
name: T,
arg: Types["AuthScopes"][T],
)
evaluateScopeMapWithScopes(
unnamed 0: AuthScopeMap<Types>,
info: GraphQLResolveInfo | undefined,
forAll: boolean,
): MaybePromise<null | AuthFailure>
evaluateTypeScopeFunction(
authScopes: TypeAuthScopesFunction<Types, unknown>,
type: string,
parent: unknown,
)
grantTypeScopes(
type: string,
parent: unknown,
path: Path | undefined,
cb: () => MaybePromise<readonly string[]>,
)
saveGrantedScopes(scopes: readonly string[], path: Path | undefined)
testGrantedScopes(scope: string, path: Path)

Static Methods

fromContext<T extends SchemaTypes>(context: T["Context"], builder: PothosSchemaTypes.SchemaBuilder<T>): RequestCache<T>