refactor: Co-locate the export graphql queries with their SFCs#2234
Open
refactor: Co-locate the export graphql queries with their SFCs#2234
Conversation
✅ Deploy Preview for pilcrow-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
46c8bde to
fb24505
Compare
Replace typescript/typescript-operations plugins with @graphql-codegen/client-preset. Fragment masking is disabled (Apollo Client has native data masking). This enables colocated fragment/query definitions in Vue SFCs using the generated graphql() function and typed document imports. Generated with LLM assistance
Define component-specific fragments using graphql() in <script> blocks: - avatarImage, avatarBlock, userListBasicItem, userListBasic, userListItem, userList fragments on User type - Colocate GetUsers query in UsersIndex.vue, import GetUsersDocument - Replace broad User/relatedUserFieldsFragment props with narrower component-specific fragment types - Convention: fragment name matches component name (camelCase) Generated with LLM assistance
Documents the data fetching architecture (pages own queries, components define fragments, pure UI has no GraphQL), naming conventions, type guidelines, and the two-script-block pattern for Vue SFCs. Generated with LLM assistance
Separate the export flow into two routes: /export for configuring options (comment types, participant filters) and /export/html for the actual preview/download. This resolves the convention violation where SubmissionExportGenerator was calling queries directly instead of the page owning them. - Create SubmissionExportHtml page owning GetSubmissionExportData query and export comment fragments - Simplify SubmissionExport to options-only (navigates to html page) - Simplify SubmissionExportGenerator to pure renderer (no dialog, no query) - Replace generated GraphQL types with plain ExportCommentBase interface in export components - Remove trashed: WITH from export queries (deleted comments filtered in display, no need to fetch them) Generated with LLM assistance
Colocate GraphQL fragments in export components (ExportContent, ExportInlineComments, ExportOverallComments) on the Submission type. Consolidate ExportComment/ExportCommentList into ExportInlineComments and ExportOverallComments. Add form state persistence via URL query params, auto-download support, and UI improvements to export pages. Generated with LLM assistance
- Add missing @types/validator entry to client yarn.lock - Add language specifier to fenced code block in graphql-client docs Generated with LLM assistance
These pages are being replaced by the admin-tables branch. Generated with LLM assistance
Superseded by admin-tables branch. Generated with LLM assistance
- Inline commentFields/relatedUserFields fragment references into ExportInlineComments and ExportOverallComments, querying only the fields each component actually uses - Remove deleted comment handling from export components - Add seeded submission 113 (ACCEPTED_AS_FINAL) with inline and overall comments for export preview testing - Fix hardcoded submission_id in OverallCommentSeeder.createCommentReply - Update tests to match simplified fragment types Generated with LLM assistance
Generated with LLM assistance
…wSeeder Move submission 113 creation and its comments out of SubmissionSeeder, InlineCommentSeeder, and OverallCommentSeeder into a self-contained ExportPreviewSeeder for better readability. Generated with LLM assistance
779ab85 to
a1ee825
Compare
The convention documentation isn't fully developed yet; removing it from the branch to keep the PR focused on the implementation.
…ragments # Conflicts: # client/yarn.lock
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
client-presetand co-locate GraphQL fragments/queries in Vue SFCs for the export feature/export(options page) and/export/html(preview/download page), so each page owns its own queriesExportComment/ExportCommentListintoExportInlineCommentsandExportOverallCommentscomponentsExportPreviewSeederwith a seeded submission for testingExportParticipantSelector,SubmissionExport,SubmissionExportHtml, andExportInlineComments/ExportOverallCommentsTest plan
ExportParticipantSelectorandSubmissionExportvitest specsSubmissionExportHtmland export comment vitest specs/exportoptions page navigates correctly to/export/html