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

Fix 1-1 validation on nested update #5616

Merged
merged 1 commit into from
Oct 7, 2024
Merged

Conversation

angrykoala
Copy link
Member

Description

Nested update operations were not performing the required cardinality validation. This PR copy the validation made in top level (translate-update) into nested update (create-update-and-params)

Copy link

changeset-bot bot commented Oct 2, 2024

🦋 Changeset detected

Latest commit: b7552f8

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@neo4j/graphql Patch
@neo4j/graphql-ogm Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@neo4j-team-graphql
Copy link
Collaborator

neo4j-team-graphql commented Oct 2, 2024

Performance Report

No Performance Changes

Show Full Table
name dbHits old dbHits time (ms) old time (ms) maxRows
aggregations.TopLevelAggregate 3404 3404 41 43 1134
aggregations.TopLevelAggregateWithMultipleFields 6802 6802 52 88 1134
aggregations.NestedAggregation 15407 15407 56 84 2174
aggregations.AggregationWithWhere 10833 10833 42 49 2174
aggregations.AggregationWhereWithinNestedRelationships 20097917 20097917 2024 2066 2008534
aggregations.AggregationWhereWithinNestedConnections 20097917 20097917 2056 2076 2008534
aggregations.NestedCountFromMovieToActors 8603 8603 40 48 2174
aggregations.NestedCountFromActorsToMovie 8791 8791 37 40 2174
aggregations.DeeplyNestedCount 10052335 10052335 2813 2893 2008534
aggregations.InterfacesAggregations 6242 6242 43 48 2080
aggregations.InterfacesAggregationsWithTwoFields 11444 11444 71 98 2080
batch-create.BatchCreate 4200 4200 133 192 600
batch-create.BatchCreateSmall 77 77 96 99 11
connect.createAndConnect 6433 6433 144 173 3003
connections.Connection 12951 12951 58 70 2174
connections.NestedConnection 37705 37705 129 127 4516
create.SimpleMutation 7 7 48 56 1
cypher-directive.TopLevelMutationDirective 1135 1135 30 37 1134
delete.SimpleDelete 19401 19401 769 872 1040
delete.NestedDeleteInUpdate 16844 16844 119 161 2040
2871.NestedRelationshipFilter 19869 19856 96 66 4467
2925.SingleRelationshipFilter 5245 5245 41 45 1040
2925.NestedSingleRelationshipFilter 17641 17641 71 90 2174
2925.SingleRelationshipRequiredFilter 5201 5201 33 40 1040
2925.NestedSingleRelationshipRequiredFilter 9361 9361 55 66 1040
query.SimpleQuery 3121 3121 22 28 1040
query.SimpleQueryWithRelationship 15031 15031 38 43 2174
query.QueryWhere 8594 8594 32 48 2164
query.SimpleQueryWithNestedWhere 8743 8743 44 54 2164
query.Nested 10084891 10084891 7031 9044 2008534
query.NestedWithFilter 10064992 10064992 9094 7134 2004000
query.OrFilterOnRelationships 37363 37169 147 175 2168
query.OrFilterOnRelationshipsAndNested 27439 27603 188 237 2168
query.QueryWithNestedIn 14822 14822 49 63 2074
query.NestedConnectionWhere 8703 8703 53 62 2174
query.DeeplyNestedConnectionWhere 8803 8803 65 91 2174
query.DeeplyNestedWithRelationshipFilters 17489 17489 123 159 1596
query.NestedWithRelationshipSingleFilters 3808 3808 135 177 1134
query.Fulltext 64 64 29 34 16
query.FulltextWithNestedQuery 516 516 40 45 84
sorting-and-cypher.TopLevelSortWithCypher 12961 12961 38 43 2174
sorting-and-cypher.TopLevelConnectionSortWithCypher 12961 12961 66 70 2174
sorting-and-cypher.TopLevelSortWithCypherWithNested 13096 13096 53 59 2174
sorting-and-cypher.TopLevelConnectionSortWithCypherWithNested 13096 13096 92 99 2174
sorting-and-cypher.TopLevelSortWithExpensiveCypher 13700 13700 106 115 2174
sorting-and-cypher.TopLevelConnectionSortWithExpensiveCypher 13266 13266 96 104 2174
sorting.SortMultipleTypes 3436 3436 88 98 1040
sorting.SortMultipleTypesWithCypherWithCypher 13321 13321 96 114 2174
sorting.SortOnNestedFields 12951 12951 40 53 2174
sorting.SortDeeplyNestedFields 39785 39785 82 96 4516
sorting.ConnectionWithSort 3271 3271 72 74 1040
unions.SimpleUnionQuery 321 321 52 65 35
unions.SimpleUnionQueryWithMissingFields 293 293 51 60 35
unions.NestedUnion 309975 309975 254 282 33033
unions.NestedUnionWithMissingFields 283949 283949 259 263 33033
update.NestedUpdate 14137 14137 104 104 2002

Old Schema Generation: 27.231s
Schema Generation: 28.060s
Old Subgraph Schema Generation: 30.975s
Subgraph Schema Generation: 29.254s

@@ -343,6 +343,30 @@ export default function createUpdateAndParams({
}

if (update.connect) {
if (relationField.interface) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this be the case also for unions?

@angrykoala angrykoala force-pushed the fix-validation-on-nested-update branch from 9722366 to b7552f8 Compare October 7, 2024 08:23
@angrykoala angrykoala merged commit ebe9c29 into dev Oct 7, 2024
80 checks passed
@angrykoala angrykoala deleted the fix-validation-on-nested-update branch October 7, 2024 08:30
This was referenced Oct 5, 2024
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.

3 participants