Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proposal for using Fragments with GraphQL queries #876

Closed
wants to merge 5 commits into from

Conversation

howard-e
Copy link
Contributor

Continued discussion from #863 (comment):

@howard-e said:

I noticed quite some time ago, a LOT of the query params are often repeated. So much so that params are often missed in data update PRs, so I'm proposing to start writing the various individual component queries.js files as a construction of these repeated fragments.

... It's already cut down TestRun/queries.js by a significant amount ... I'm happy to revert and make this more of a concentrated task by itself.

@alflennik said:

I'm down with this. Most fields don't impact query performance so it's totally fine to just query all of them every time. For fields that do impact performance, like tests on TestPlanVersions and testResults on TestPlanRuns, I think it should be divided into two fragments to make accidentally tanking your performance less likely to happen. Something like TEST_PLAN_RUN_FIELDS and TEST_PLAN_RUN_TEST_RESULTS_FIELDS.

I think fields like renderableContent might be preferable to leave off, since they're extremely verbose and "specialty" for specific use cases. If it's there where it's not needed it will definitely make debugging responses harder.

We can manually add them where they're needed.

@howard-e howard-e added the enhancement New feature or request label Dec 14, 2023
@howard-e howard-e changed the base branch from main to development April 4, 2024 22:24
# Conflicts:
#	client/components/CandidateReview/CandidateTestPlanRun/queries.js
#	client/components/Reports/queries.js
#	client/components/TestRun/queries.js
@howard-e howard-e closed this Jul 9, 2024
stalgiag pushed a commit that referenced this pull request Jul 31, 2024
* Move AssignTesterDropdown

* Removed original components/TestQueue and revised tests

* Additional removal of files

* Rename TestQueue2 -> TestQueue

* Address TODOs on removing Test Queue v1 vs v2 conditionals

* wip: Use standardized gql fragments in queries.js files; to supersede #876

* Remove unnecessary TODO

* Update fragments

* Additional fragments

* Verify tests

* Separate into multiple files

* Reorder

* Verify tests

* Verify tests

* Fix

* Move data dependent test from DataManagement.test.jsx to DataManagement.e2e.test.js

* Trim remaining DataManagementPage mock significantly (cannot fully remove as there's an issue with testing the loading element in 'e2e' test)

* Reuse fragment in DataManagement query

* Add supportedByAutomation to AtVersionFields

* Update ManageTestQueue/queries.js

* Update TestPlanReportStatusDialog/queries

* Update UserSettings/queries.js and update UserSettings tests and fix resolver

* Update TestRun/queries.js and TestRun/index.jsx

* Formatting

* Add TestRun.e2e.test.js and remove outdated TestRun.test.jsx

* Remove App.test.jsx since covered by smokeTest.e2e.test.js and remove enzyme dependencies

* Include TODO on additional TestRun tests

* Update AssignTesterDropdown/queries.js

* Revert

* Use fragments with /report

* Use fragments for TestPlanVersions Page

* Use fragments with /test-review

* Add test stubs for TestPlanVersions and TestReview

* Use fragments for AssignTesterDropdown

* Reorganizing

* Use fragments with CandidateReview

* Use fragments with CandidateTestPlanRun

* Remove TODOs

* Remove now unnecessary duplication of AtVersion.supportedByAutomation calls

* Update snapshots
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants