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

Using with generates duplicates queries #52

Open
SimonThordal opened this issue May 11, 2022 · 0 comments
Open

Using with generates duplicates queries #52

SimonThordal opened this issue May 11, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@SimonThordal
Copy link

Currently when using with we will execute two queries the first one returning the initial model and the 2nd the initial model and its relations. Example:

Person::with('organization')->find(10) generates:

MATCH (person:Person) WHERE id(person) = 10 RETURN person

and

MATCH (person:Person), (person)-[:MEMBER_OF]->(organization:Organization) WHERE id(person) = 10 RETURN person, organization

There's no reason to execute both of these queries when we could settle for the latter.

@SimonThordal SimonThordal added the enhancement New feature or request label May 11, 2022
@SimonThordal SimonThordal changed the title Using with duplicates queries Using with generates duplicates queries May 11, 2022
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

No branches or pull requests

1 participant