neo4j / graphql

A GraphQL to Cypher query execution layer for Neo4j and JavaScript GraphQL implementations.
https://neo4j.com/docs/graphql-manual/current/
Apache License 2.0
511 stars 150 forks source link

Sorting vector search results by score without score in selection set results in error #5759

Closed darrellwarde closed 3 weeks ago

darrellwarde commented 3 weeks ago

Type definitions

type Movie
  @vector(
    indexes: [
      {
        indexName: "MovieIndex"
        embeddingProperty: "embedding"
        queryName: "searchMovies"
      }
    ]
  )
  @node {
  title: String!
  released: Int!
}

Test data

No response

Steps to reproduce

The execution of a query such as the following will result in a Cypher syntax error:

query($vector: [Float!]) {
  searchMovies(vector: $vector, sort: { score: DESC } ) {
    edges {
      node {
        title
      }
    }
  }
}

What happened

Error: Variable `var1` not defined (line 10, column 14 (offset: 308))

Expected behaviour

No response

Version

latest

Database version

5.24

Relevant log output

No response

neo4j-team-graphql commented 3 weeks ago

We've been able to confirm this bug using the steps to reproduce that you provided - many thanks @darrellwarde! :pray: We will now prioritise the bug and address it appropriately.