deno.land / x / pothos@release-1713397530 / packages / plugin-scope-auth / util.ts

نووسراو ببینە
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// @ts-nocheckimport { Path, PothosFieldConfig, SchemaTypes } from '../core/index.ts';import type { AuthScopeMap } from './index.ts';export function canCache<Types extends SchemaTypes>(map: AuthScopeMap<Types>): boolean { if (map.$granted) { return false; } return (map.$all ? canCache(map.$all) : true) && (map.$any ? canCache(map.$any) : true);}export function cacheKey(path: Path | undefined) { if (!path) { // Root return "*"; } let key = String(path.key); let current = path.prev; while (current) { key = `${current.key}.${key}`; current = current.prev; } return key;}export function isObjectOrInterface(fieldConfig: PothosFieldConfig<never>) { return ((fieldConfig.graphqlKind === "Interface" || fieldConfig.graphqlKind === "Object") && fieldConfig.kind !== "Query" && fieldConfig.kind !== "Mutation" && fieldConfig.kind !== "Subscription");}
pothos

Version Info

Tagged at
a year ago