diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-02-14 11:52:56 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-02-14 11:53:08 +0900 |
| commit | 2889b562e64993482bd13fd806af8ed0865bab8b (patch) | |
| tree | 39400ac4d994fb33d2c544e7d4b9d98f8ecbd86a /frontend/src/services | |
| parent | e216c3bc97994b4172d15d52b46d5f6b75f35ea4 (diff) | |
| download | feedaka-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/services')
| -rw-r--r-- | frontend/src/services/api-client.ts | 6 | ||||
| -rw-r--r-- | frontend/src/services/graphql-client.ts | 10 |
2 files changed, 6 insertions, 10 deletions
diff --git a/frontend/src/services/api-client.ts b/frontend/src/services/api-client.ts new file mode 100644 index 0000000..c1ee475 --- /dev/null +++ b/frontend/src/services/api-client.ts @@ -0,0 +1,6 @@ +import createClient from "openapi-fetch"; +import type { paths } from "../api/generated"; + +export const api = createClient<paths>({ + credentials: "include", +}); diff --git a/frontend/src/services/graphql-client.ts b/frontend/src/services/graphql-client.ts deleted file mode 100644 index 4b2532a..0000000 --- a/frontend/src/services/graphql-client.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { Client, cacheExchange, fetchExchange } from "urql"; - -export const client = new Client({ - url: "/graphql", - exchanges: [cacheExchange, fetchExchange], - fetchOptions: { - // Include cookies for session management - credentials: "include", - }, -}); |
