Files
Edu/apps/admin-portal/src/providers/graphql-provider.tsx
SpecialX b3511910d1 feat(admin-portal): 完整实现 admin-portal 管理端微前端
包含 src 全部实现、Dockerfile、配置文件等
2026-07-10 19:09:12 +08:00

17 lines
607 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
"use client";
import { useMemo, type ReactNode } from "react";
import { Provider } from "urql";
import { createGraphQLClient } from "@/lib/graphql-client";
/**
* GraphQL Providerstandalone 模式自建 urql client
*
* 仲裁 ARB-002 / ISSUE-047 §5.4MF 模式复用 Shell 暴露的 GraphQL client 单例
* 开发期 standalone 模式:自建 urql client 指向 /api/admin/graphqlMSW 拦截)
*/
export function GraphQLProvider({ children }: { children: ReactNode }) {
const client = useMemo(() => createGraphQLClient(), []);
return <Provider value={client}>{children}</Provider>;
}