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

Top level interface connection #4821

Merged
merged 11 commits into from
Mar 6, 2024
Merged

Conversation

angrykoala
Copy link
Member

Description

Support for top-level connection query on interfaces. For example:

Typedefs

interface Show {
    title: String!
}

type Movie implements Show {
    title: String!
    cost: Float
}

type Series implements Show {
    title: String!
    episodes: Int
}

Query

query {
    showsConnection(where: { title_CONTAINS: "The Matrix" }) {
        edges {
            node {
                title
                ... on Movie {
                    cost
                }
            }
        }
    }
}

Copy link

changeset-bot bot commented Mar 5, 2024

🦋 Changeset detected

Latest commit: 7fcd0aa

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

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

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

@@ -53,44 +53,11 @@ export class InterfaceEntityAdapter {
this.initConcreteEntities(entity.concreteEntities);
}

public findAttribute(name: string): AttributeAdapter | undefined {
Copy link
Member Author

Choose a reason for hiding this comment

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

This bit here is just reordering some methods in InterfaceEntityAdapter to make it more consistent

@neo4j-team-graphql
Copy link
Collaborator

neo4j-team-graphql commented Mar 5, 2024

Thanks for the Neo4j GraphQL Toolbox updates.

The Neo4j GraphQL Toolbox has now been torn down - reopening this PR will republish it.

@angrykoala angrykoala marked this pull request as ready for review March 5, 2024 17:36
@angrykoala angrykoala force-pushed the top-level-interface-connection branch from 0262c7d to 862a34d Compare March 5, 2024 17:41
@angrykoala angrykoala force-pushed the top-level-interface-connection branch from 862a34d to 579e751 Compare March 5, 2024 17:49
a-alle
a-alle previously approved these changes Mar 6, 2024
Copy link
Contributor

@a-alle a-alle left a comment

Choose a reason for hiding this comment

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

LGTM, maybe some tck tests could be useful?

@neo4j-team-graphql
Copy link
Collaborator

Performance Report

No Performance Changes

Show Full Table
name dbHits old dbHits time (ms) old time (ms) maxRows
aggregations.TopLevelAggregate 3404 3404 33 48 1134
aggregations.TopLevelAggregateWithMultipleFields 6802 6802 45 70 1134
aggregations.NestedAggregation 16544 16544 75 73 2174
aggregations.AggregationWithWhere 11970 11970 47 58 2174
aggregations.AggregationWhereWithinNestedRelationships 22116478 22116478 2018 2175 2008534
aggregations.AggregationWhereWithinNestedConnections 22116478 22116478 2123 2023 2008534
aggregations.NestedCountFromMovieToActors 9701 9701 31 40 2174
aggregations.NestedCountFromActorsToMovie 9928 9928 34 38 2174
aggregations.DeeplyNestedCount 11062184 11062184 2813 2769 2008534
aggregations.InterfacesAggregations 6242 6242 45 47 2080
aggregations.InterfacesAggregationsWithTwoFields 11444 11444 72 82 2080
batch-create.BatchCreate 4200 4200 120 144 600
batch-create.BatchCreateSmall 77 77 92 62 11
connect.createAndConnect 14424 14424 179 282 3003
connections.Connection 14049 14049 77 81 2174
connections.NestedConnection 41068 41068 117 148 4516
create.SimpleMutation 7 7 48 58 1
cypher-directive.TopLevelMutationDirective 1135 1135 57 26 1134
delete.SimpleDelete 19401 19401 228 205 1040
delete.NestedDeleteInUpdate 19165 19165 165 202 2040
2871.NestedRelationshipFilter 23083 23077 92 62 4431
2925.SingleRelationshipFilter 6468 6468 44 44 1040
2925.NestedSingleRelationshipFilter 22891 22891 69 89 2174
2925.SingleRelationshipRequiredFilter 5201 5201 34 39 1040
2925.NestedSingleRelationshipRequiredFilter 9361 9361 53 66 1040
query.SimpleQuery 3121 3121 19 19 1040
query.SimpleQueryWithRelationship 16129 16129 36 44 2174
query.QueryWhere 9676 9676 31 34 2161
query.SimpleQueryWithNestedWhere 9843 9843 45 49 2161
query.Nested 10095502 10095502 7348 7079 2008534
query.NestedWithFilter 10074351 10074351 6934 6866 2004000
query.OrFilterOnRelationships 42814 43498 138 172 1750
query.OrFilterOnRelationshipsAndNested 36073 36973 188 263 1750
query.QueryWithNestedIn 13454 14010 49 55 1245
query.NestedConnectionWhere 9801 9801 57 62 2174
query.DeeplyNestedConnectionWhere 9859 9799 71 84 2174
query.DeeplyNestedWithRelationshipFilters 18764 18686 127 159 1586
query.NestedWithRelationshipSingleFilters 3865 3865 166 168 1134
query.Fulltext 64 64 28 40 16
query.FulltextWithNestedQuery 558 558 39 56 84
sorting-and-cypher.TopLevelSortWithCypher 14059 14059 38 45 2174
sorting-and-cypher.TopLevelConnectionSortWithCypher 14059 14059 61 73 2174
sorting-and-cypher.TopLevelSortWithCypherWithNested 14204 14204 52 58 2174
sorting-and-cypher.TopLevelConnectionSortWithCypherWithNested 14204 14204 105 104 2174
sorting-and-cypher.TopLevelSortWithExpensiveCypher 14933 14922 93 126 2174
sorting-and-cypher.TopLevelConnectionSortWithExpensiveCypher 14404 14404 101 125 2174
sorting.SortMultipleTypes 3498 3498 89 96 1040
sorting.SortMultipleTypesWithCypherWithCypher 14504 14504 99 114 2174
sorting.SortOnNestedFields 14049 14049 45 47 2174
sorting.SortDeeplyNestedFields 43148 43148 75 90 4516
sorting.ConnectionWithSort 3281 3281 86 89 1040
unions.SimpleUnionQuery 321 321 64 57 35
unions.SimpleUnionQueryWithMissingFields 293 293 92 56 35
unions.NestedUnion 410637 410637 250 334 33033
unions.NestedUnionWithMissingFields 384611 384611 256 239 33033
update.NestedUpdate 16143 16143 101 103 2002

Old Schema Generation: 26.154s
Schema Generation: 26.345s
Old Subgraph Schema Generation: 30.524s
Subgraph Schema Generation: 30.297s

@angrykoala angrykoala merged commit be771fb into dev Mar 6, 2024
83 checks passed
@angrykoala angrykoala deleted the top-level-interface-connection branch March 6, 2024 13:34
@github-actions github-actions bot locked and limited conversation to collaborators Mar 6, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
Status: Pull requests
Development

Successfully merging this pull request may close these issues.

3 participants