Skip to main content
The Deno 2 Release Candidate is 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-1677173079/packages/plugin-scope-auth/request-cache.ts";

Constructors

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

Type Parameters

Types extends SchemaTypes

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>>>
optional
scopes: MaybePromise<ScopeLoaderMap<Types>>
treatErrorsAsUnauthorized: boolean
typeCache: Map<string, Map<unknown, MaybePromise<null | AuthFailure>>>
typeGrants: Map<string, Map<unknown, MaybePromise<null>>>

Methods

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

Static Methods

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