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

feat: handle parent relationship without belongsTo for GraphQL #1055

Merged
merged 4 commits into from
Aug 1, 2023

Conversation

rtpascual
Copy link
Contributor

@rtpascual rtpascual commented Jul 31, 2023

Problem

The link from a child to a parent is always implemented with an id field on the child holding the id of its parent, customers can optionally annotate this field with @belongsTo to make the relationship bidirectional. For forms, we always want to behave as if the relationship is bidirectional, mainly to give us the ability to utilize the autocomplete control to update the parent id.

Solution

Add conditional logic for GraphQL to add bidirectional abilities for forms.

Additional Notes

Also adds a step to our Github actions to upload Cypress videos if Cypress tests fail in order to gather more insight when debugging failing tests.

Links

Ticket

GitHub issue:

Other links

Verification

Manual tests

Automated tests

  • Unit tests added/updated
  • E2E tests added/updated
  • N/A - (provide a reason)
  • deferred - (provide GitHub issue for tracking)

Housekeeping

  • No non-essential console logs
  • All new files contain license notice

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@rtpascual rtpascual force-pushed the without-belongsto branch from 6bdcc45 to 7e955e9 Compare July 31, 2023 18:03
@codecov-commenter
Copy link

codecov-commenter commented Jul 31, 2023

Codecov Report

Merging #1055 (b110e06) into main (e9d0beb) will increase coverage by 0.02%.
The diff coverage is 100.00%.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1055      +/-   ##
==========================================
+ Coverage   93.84%   93.86%   +0.02%     
==========================================
  Files         124      124              
  Lines        5797     5819      +22     
  Branches     1752     1764      +12     
==========================================
+ Hits         5440     5462      +22     
  Misses        339      339              
  Partials       18       18              
Files Changed Coverage Δ
...-react/lib/forms/form-renderer-helper/cta-props.ts 100.00% <100.00%> (ø)
...act/lib/forms/form-renderer-helper/relationship.ts 92.85% <100.00%> (+0.16%) ⬆️
...b/forms/form-renderer-helper/render-array-field.ts 100.00% <100.00%> (ø)
.../codegen-ui-react/lib/forms/react-form-renderer.ts 96.71% <100.00%> (+0.01%) ⬆️
...s/codegen-ui-react/lib/react-component-renderer.ts 100.00% <100.00%> (ø)
packages/codegen-ui-react/lib/utils/graphql.ts 90.24% <100.00%> (+0.24%) ⬆️

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e9d0beb...b110e06. Read the comment docs.

@rtpascual rtpascual marked this pull request as ready for review July 31, 2023 18:10
@rtpascual rtpascual requested a review from a team as a code owner July 31, 2023 18:10
lyonsbp
lyonsbp previously approved these changes Jul 31, 2023
awinberg-aws
awinberg-aws previously approved these changes Jul 31, 2023
@rtpascual rtpascual dismissed stale reviews from awinberg-aws and lyonsbp via c5820ed August 1, 2023 01:45
@rtpascual rtpascual force-pushed the without-belongsto branch 4 times, most recently from def421c to dbec349 Compare August 1, 2023 05:45
@rtpascual rtpascual merged commit af04792 into main Aug 1, 2023
@rtpascual rtpascual deleted the without-belongsto branch August 1, 2023 20:10
@rtpascual rtpascual restored the without-belongsto branch August 1, 2023 20:10
@rtpascual rtpascual deleted the without-belongsto branch August 1, 2023 20:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants