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

x/pothos/packages/plugin-scope-auth/index.ts>RequestCache

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

Constructors

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

Properties

builder
optional
cacheKey: (value: unknown) => unknown
context
defaultStrategy: "all" | "any"
grantCache: Map<string, Set<string>>
mapCache: Map<{ }, MaybePromise<AuthFailure | null>>
scopeCache: Map<keyof Types["AuthScopes"], Map<unknown, MaybePromise<AuthFailure | null>>>
treatErrorsAsUnauthorized: boolean
typeCache: Map<string, Map<unknown, MaybePromise<AuthFailure | null>>>
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<AuthFailure | null>
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

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