aboutsummaryrefslogtreecommitdiffhomepage
path: root/frontend/src/graphql/generated/fragment-masking.ts
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-02-14 11:52:56 +0900
committernsfisis <nsfisis@gmail.com>2026-02-14 11:53:08 +0900
commit2889b562e64993482bd13fd806af8ed0865bab8b (patch)
tree39400ac4d994fb33d2c544e7d4b9d98f8ecbd86a /frontend/src/graphql/generated/fragment-masking.ts
parente216c3bc97994b4172d15d52b46d5f6b75f35ea4 (diff)
downloadfeedaka-2889b562e64993482bd13fd806af8ed0865bab8b.tar.gz
feedaka-2889b562e64993482bd13fd806af8ed0865bab8b.tar.zst
feedaka-2889b562e64993482bd13fd806af8ed0865bab8b.zip
refactor: migrate API from GraphQL to REST (TypeSpec/OpenAPI)
Replace the entire GraphQL stack (gqlgen, urql, graphql-codegen) with a TypeSpec → OpenAPI 3.x pipeline using oapi-codegen for Go server stubs and openapi-fetch + openapi-typescript for the frontend client. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Diffstat (limited to 'frontend/src/graphql/generated/fragment-masking.ts')
-rw-r--r--frontend/src/graphql/generated/fragment-masking.ts87
1 files changed, 0 insertions, 87 deletions
diff --git a/frontend/src/graphql/generated/fragment-masking.ts b/frontend/src/graphql/generated/fragment-masking.ts
deleted file mode 100644
index 743a364..0000000
--- a/frontend/src/graphql/generated/fragment-masking.ts
+++ /dev/null
@@ -1,87 +0,0 @@
-/* eslint-disable */
-import type { ResultOf, DocumentTypeDecoration, TypedDocumentNode } from '@graphql-typed-document-node/core';
-import type { FragmentDefinitionNode } from 'graphql';
-import type { Incremental } from './graphql';
-
-
-export type FragmentType<TDocumentType extends DocumentTypeDecoration<any, any>> = TDocumentType extends DocumentTypeDecoration<
- infer TType,
- any
->
- ? [TType] extends [{ ' $fragmentName'?: infer TKey }]
- ? TKey extends string
- ? { ' $fragmentRefs'?: { [key in TKey]: TType } }
- : never
- : never
- : never;
-
-// return non-nullable if `fragmentType` is non-nullable
-export function useFragment<TType>(
- _documentNode: DocumentTypeDecoration<TType, any>,
- fragmentType: FragmentType<DocumentTypeDecoration<TType, any>>
-): TType;
-// return nullable if `fragmentType` is undefined
-export function useFragment<TType>(
- _documentNode: DocumentTypeDecoration<TType, any>,
- fragmentType: FragmentType<DocumentTypeDecoration<TType, any>> | undefined
-): TType | undefined;
-// return nullable if `fragmentType` is nullable
-export function useFragment<TType>(
- _documentNode: DocumentTypeDecoration<TType, any>,
- fragmentType: FragmentType<DocumentTypeDecoration<TType, any>> | null
-): TType | null;
-// return nullable if `fragmentType` is nullable or undefined
-export function useFragment<TType>(
- _documentNode: DocumentTypeDecoration<TType, any>,
- fragmentType: FragmentType<DocumentTypeDecoration<TType, any>> | null | undefined
-): TType | null | undefined;
-// return array of non-nullable if `fragmentType` is array of non-nullable
-export function useFragment<TType>(
- _documentNode: DocumentTypeDecoration<TType, any>,
- fragmentType: Array<FragmentType<DocumentTypeDecoration<TType, any>>>
-): Array<TType>;
-// return array of nullable if `fragmentType` is array of nullable
-export function useFragment<TType>(
- _documentNode: DocumentTypeDecoration<TType, any>,
- fragmentType: Array<FragmentType<DocumentTypeDecoration<TType, any>>> | null | undefined
-): Array<TType> | null | undefined;
-// return readonly array of non-nullable if `fragmentType` is array of non-nullable
-export function useFragment<TType>(
- _documentNode: DocumentTypeDecoration<TType, any>,
- fragmentType: ReadonlyArray<FragmentType<DocumentTypeDecoration<TType, any>>>
-): ReadonlyArray<TType>;
-// return readonly array of nullable if `fragmentType` is array of nullable
-export function useFragment<TType>(
- _documentNode: DocumentTypeDecoration<TType, any>,
- fragmentType: ReadonlyArray<FragmentType<DocumentTypeDecoration<TType, any>>> | null | undefined
-): ReadonlyArray<TType> | null | undefined;
-export function useFragment<TType>(
- _documentNode: DocumentTypeDecoration<TType, any>,
- fragmentType: FragmentType<DocumentTypeDecoration<TType, any>> | Array<FragmentType<DocumentTypeDecoration<TType, any>>> | ReadonlyArray<FragmentType<DocumentTypeDecoration<TType, any>>> | null | undefined
-): TType | Array<TType> | ReadonlyArray<TType> | null | undefined {
- return fragmentType as any;
-}
-
-
-export function makeFragmentData<
- F extends DocumentTypeDecoration<any, any>,
- FT extends ResultOf<F>
->(data: FT, _fragment: F): FragmentType<F> {
- return data as FragmentType<F>;
-}
-export function isFragmentReady<TQuery, TFrag>(
- queryNode: DocumentTypeDecoration<TQuery, any>,
- fragmentNode: TypedDocumentNode<TFrag>,
- data: FragmentType<TypedDocumentNode<Incremental<TFrag>, any>> | null | undefined
-): data is FragmentType<typeof fragmentNode> {
- const deferredFields = (queryNode as { __meta__?: { deferredFields: Record<string, (keyof TFrag)[]> } }).__meta__
- ?.deferredFields;
-
- if (!deferredFields) return true;
-
- const fragDef = fragmentNode.definitions[0] as FragmentDefinitionNode | undefined;
- const fragName = fragDef?.name?.value;
-
- const fields = (fragName && deferredFields[fragName]) || [];
- return fields.length > 0 && fields.every(field => data && field in data);
-}