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
508 stars 149 forks source link

Wrong node label for interface type OR condition #2673

Closed Hashdhi closed 1 year ago

Hashdhi commented 1 year ago
interface Production {
    title: String!
    actors: [Actor!]! 
    distribution:[DistributionHouse!]!
}

type Movie implements Production @node(label:"Film"){
    title: String!
    actors: [Actor!]! @relationship(type: "ACTED_IN", direction: IN, properties: "ActedIn")
    runtime: Int!
    distribution:[DistributionHouse!]! @relationship(type: "DISTRIBUTED_BY", direction: IN)
}

type Series implements Production {
    title: String!
    actors: [Actor!]! @relationship(type: "ACTED_IN", direction: IN, properties: "ActedIn")
    episodes: Int!
    distribution:[DistributionHouse!]! @relationship(type: "DISTRIBUTED_BY", direction: IN)
}

interface ActedIn @relationshipProperties {
    role: String!
}

interface Actor {
    name: String!
    actedIn: [Production!]! @relationship(type: "ACTED_IN", direction: OUT, properties: "ActedIn")
}

type MaleActor implements Actor {
    name: String!
    actedIn: [Production!]! @relationship(type: "ACTED_IN", direction: OUT, properties: "ActedIn")
    rating : Int!
}
type FemaleActor implements Actor {
    name: String!
    actedIn: [Production!]! @relationship(type: "ACTED_IN", direction: OUT, properties: "ActedIn")
    age : Int!
}

interface DistributionHouse{
    name:String!
}

type Dishney implements DistributionHouse{
      name:String!
      review:String!
}

type Prime implements DistributionHouse{
      name:String!
      review:String!
}

type Netflix implements DistributionHouse{
      name:String!
      review:String!
}
query {
  movies(
    where: {
      OR: [
        {
          distributionConnection_SOME: {
            node: { **_on: { Netflix: {}** }, name: "" }
          }
        }
      ]
    }
  ) {
    title
  }
}

produced cypher :

MATCH (this:`Film`)
WHERE size([(this1:`**Dishney`**)-[this0:DISTRIBUTED_BY]->(this) WHERE this1.name = $param0 | 1]) > 0
RETURN this { .title } AS this {"param0":""} {}

Though explictly used filter type as Netflix However in the generated cypher used Dishney type .

Liam-Doodson commented 1 year ago

This issue is a duplicate of #2709 which has already been closed