mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-08-16 00:21:55 +02:00
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Co-authored-by: Gregory Schier <gschier1990@gmail.com>
19 lines
735 B
TypeScript
19 lines
735 B
TypeScript
import { useKeyValue } from "./useKeyValue";
|
|
|
|
// The file a request's GraphQL schema is loaded from, or null when the schema
|
|
// comes from an introspection request.
|
|
//
|
|
// This is the *source*, not the schema. The introspection row it produces is a
|
|
// cache that expires on its own; this outlives it and regenerates it, the same
|
|
// way gRPC keeps its proto file list separate from a reflection result.
|
|
export function graphqlSchemaFileArgs(requestId: string | null) {
|
|
return {
|
|
namespace: "global" as const,
|
|
key: ["graphql_schema_file", requestId ?? "n/a"],
|
|
};
|
|
}
|
|
|
|
export function useGraphQLSchemaFile(requestId: string | null) {
|
|
return useKeyValue<string | null>({ ...graphqlSchemaFileArgs(requestId), fallback: null });
|
|
}
|