GraphQL PoC: production-readiness improvements (frontend)#8250
Open
galvana wants to merge 1 commit into
Open
Conversation
- Drop @defer; use separate DashboardAgentBriefing query - Update endpoint to /api/v1/plus/graphql - Scope ApolloProvider inside ProtectedRoute - Regenerate types (no @defer fragments) - Remove custom /graphql rewrite (covered by /api/v1/* rule) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
Dependency Review✅ No vulnerabilities found.Scanned Files
|
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.
Summary
Production-readiness improvements on top of the GraphQL PoC (#8232), paired with ethyca/fidesplus#3628 (backend).
Changes:
@deferdirective --agentBriefingis now a separateDashboardAgentBriefingquery/graphqlto/api/v1/plus/graphqlApolloProviderinsideProtectedRoute(no Apollo client for unauthenticated pages)/graphqlrewrite innext.config.js(covered by existing/api/v1/*rule)@deferfragments, no@streamdirectives)Why drop @defer?
@deferrequiresgraphql-core>=3.3.0a9on the backend -- an alpha prerelease with no stability guarantees. The separateDashboardAgentBriefingquery achieves the same UX: the dashboard paints immediately fromDashboardOverview, and the slow LLM-backed briefing arrives independently without blocking. The network cost is one additional small request vs. multipart streaming -- negligible.Why scope ApolloProvider?
The original PoC wraps the entire app tree (including login pages) in
DashboardGraphqlProvider. This creates an Apollo client instance for every visitor before authentication. Moving it insideProtectedRoutemeans:Research note: is Apollo the right client?
For read-only views with no mutations, Apollo's normalized cache provides little value -- there are no writes to propagate. The complexity tax of cache management (
cache.modify,cache.evict, partial cache hits) may not be worth it. Worth evaluating whether RTK Query with a GraphQL fetcher, or TanStack Query, would be simpler for this use case.Source: TanStack Query vs SWR vs Apollo 2026, Apollo Client Cache docs
Paired backend
ethyca/fidesplus#3628
Test plan
npm run dev:mock-graphqlrenders dashboard with mocked datanpm run graphql:generateproduces clean types from updated schemanpx tsc --noEmit)🤖 Generated with Claude Code