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

task: Update CYPHER queries to support new subquery format #5407

Open
dgarros opened this issue Jan 9, 2025 · 0 comments
Open

task: Update CYPHER queries to support new subquery format #5407

dgarros opened this issue Jan 9, 2025 · 0 comments
Assignees
Labels
group/backend Issue related to the backend (API Server, Git Agent) type/task Body of work related to an epic

Comments

@dgarros
Copy link
Collaborator

dgarros commented Jan 9, 2025

Component

API Server / GraphQL

Task Description

Since 5.23, Neo4j introduced a new format to pass some variables to a Subquery (CALL), we need to update all our queries the use the new format when we are using Neo4j
As far as I can tell, Memgraph still doesn't support the new format so we need support both for the time being.

It looks like this new format is closer to what GQL support so overall this is a good change for us as it's getting us closer to generate valid GQL queries
Neo4j doc on this feature : https://neo4j.com/docs/cypher-manual/current/subqueries/call-subquery/#variable-scope-clause

before with the WITH p statement inside CALL

MATCH (p:Player)
CALL {
  WITH p
  SET p.rating = random
  RETURN p.name
}

After with the variable passed next to CALL

MATCH (p:Player), (t:Team)
CALL (p) {
  WITH rand() AS random
  SET p.rating = random
  RETURN p.name AS playerName, p.rating AS rating
}

Related to #5241

@dgarros dgarros added group/backend Issue related to the backend (API Server, Git Agent) type/task Body of work related to an epic labels Jan 9, 2025
@dgarros dgarros added this to the Infrahub - 1.2 milestone Jan 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
group/backend Issue related to the backend (API Server, Git Agent) type/task Body of work related to an epic
Projects
None yet
Development

No branches or pull requests

2 participants