feat: BFF GraphQL ゲートウェイ導入 + PureScript クライアント移行 + 旧 REST 層削除 - #2
Merged
Conversation
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
… module, and auth context
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
…ypes Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
…lient bundle graphql v17's exports map appends .mjs to subpaths like graphql/language/visitor.mjs, producing visitor.mjs.mjs which esbuild cannot resolve. @urql/core (transitive dep of purescript-graphql-client) imports these subpaths, breaking the browser bundle. v16 has real .mjs files at the expected paths. This unblocks spago bundle --platform browser, the dev server, and all frontend development. - graphql: ^17.0.2 → ^16 (resolves v16.14.2) - No other dependencies changed - Generated graphql types (src/Generated/) are identical under v16 introspection - T8's DIRECTIVE_DEFINITION filter in sync-graphql.ts is a harmless no-op under v16
Format src/App/Api/GraphQL.purs and src/Generated/Schema/Gql/Enum/ModerationType.purs with purs-tidy 0.11.1. Add a post-generation purs-tidy format-in-place step to sync-graphql.ts so every regeneration of src/Generated/ produces tidy files. Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概要
フロントエンドと BFF 間のデータ通信を GraphQL に一本化。BFF (index.ts + bff/) に graphql-yoga による
/graphqlエンドポイントを新設し、PureScript クライアントはスキーマから自動生成した型で型安全にクエリする構成へ移行しました。旧 REST プロキシ・モック REST API・OpenAPI codegen は削除しています。Emumet バックエンド本体には手を付けていません。主な変更
bff/):schema.graphql(SDL、唯一の真実源) /schema.ts/session.ts(SessionAdapter DI、seal/unseal・refresh) /context.ts(認証コンテキスト) /emumet/{client,real,mock}.ts(バッチ契約クライアント + Real REST 実装 + ステートフル Mock) /loaders.ts(DataLoader、リクエスト単位メモ化) /resolvers.ts/server.ts(yoga ハンドラ、WeakMap + onResponse で Set-Cookie)src/App/Api/GraphQL.purs(graphql-client クエリ層 7 関数) +GraphQL/Types.purs(アプリ所有の安定 DTO + Tristate) +src/Generated/(SDL からの型自動生成、bun scripts/sync-graphql.tsで再生成)/auth/*は REST のまま (login/session/logout/OAuth 回帰確認済み)。/graphqlは認証済みセッションのみ EmumetClient を注入、未認証はextensions.code: UNAUTHENTICATEDsrc/App/Api/Emumet/、/api/*プロキシ、handleMockApi、scripts/{fetch-openapi,generate-api,sync-api}.ts、openapi/(-2653 行)検証
spago buildexit 0 /bun test51 pass /bunx tsc --noEmitexit 0 / browser・server バンドル exit 0/api/*廃止確認 → 新規アカウント初回プロフィール保存 (upsert POST 経路)備考
graphqlは v16 に固定 (v17 の exports map が @urql/core のサブパス import と非互換でブラウザバンドルが壊れるため)@graphql-tools/mock等は意図的に不採用 (ステートフル要件のため手書き Mock)