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

Support for Nested @Embedded #367

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

isaac-mercieca
Copy link

Fixed bug when generating the GraphQL schema for an Embeddable as the system was not taking into consideration having nested representations annotated with Embedded. By enhancing getEmbeddableType under GraphQLJpaSchemaBuilder so that generation is done in a recursive manner the system now supports an infinite amount of nestable classes annotated with Embedded.

Resolved #336

@isaac-mercieca isaac-mercieca marked this pull request as ready for review May 26, 2023 07:55
@igdianov
Copy link
Collaborator

Hi @isaac-mercieca, thanks for the PR! Could you, please, add unit tests to cover the fix?

@codecov
Copy link

codecov bot commented May 30, 2023

Codecov Report

Patch coverage: 58.33% and project coverage change: -0.10 ⚠️

Comparison is base (49cebe5) 76.10% compared to head (49a98c2) 76.01%.

Additional details and impacted files
@@             Coverage Diff              @@
##             master     #367      +/-   ##
============================================
- Coverage     76.10%   76.01%   -0.10%     
- Complexity     1133     1136       +3     
============================================
  Files            75       75              
  Lines          5081     5103      +22     
  Branches        732      732              
============================================
+ Hits           3867     3879      +12     
- Misses          890      899       +9     
- Partials        324      325       +1     
Impacted Files Coverage Δ
...jpa/query/schema/impl/GraphQLJpaSchemaBuilder.java 90.06% <58.33%> (-0.90%) ⬇️

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@igdianov igdianov added the bug label May 30, 2023
@igdianov igdianov self-requested a review June 1, 2023 15:35
@isaac-mercieca
Copy link
Author

@igdianov I have added a test under BooksSchemaBuildTest to validate that the generated GraphQL schema includes a nested embeddable. While this validates the solution from a schema generation perspective which was initially failing, I do not know if an integration test should also be included. Seeing existing tests I noticed a test for EmbeddableIds which was approached differently from the rest.

@igdianov
Copy link
Collaborator

igdianov commented Jun 19, 2023

@isaac-mercieca The schema test looks good. Please, include an integration test with the query using embedded attributes in the where criteria and selection. This will bring the required test coverage threshold to pass codecov checks

Copy link
Collaborator

@igdianov igdianov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to have integration test to cover query execution

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

NPE on nested @Embedded
2 participants