Skip to content
This repository has been archived by the owner on Sep 3, 2021. It is now read-only.

Interface not working in 2.7.0 #289

Closed
michal-trnka opened this issue Aug 15, 2019 · 1 comment
Closed

Interface not working in 2.7.0 #289

michal-trnka opened this issue Aug 15, 2019 · 1 comment

Comments

@michal-trnka
Copy link
Contributor

michal-trnka commented Aug 15, 2019

Hello, I got possible issue with neo4j-graphql-js after upgrade to 2.7.0. This is minimal “non-working” code

schema definition:

interface Location {
  name: String!
  parentLocation: Location
}

type City implements Location{
  name: String!
  parentLocation: Location @relation(name: "CHILD_OF", direction: OUT)
}

type Country implements Location{
  name: String!
  parentLocation: Location @relation(name: "CHILD_OF", direction: OUT)
}

type Company @isAuthenticated {
  name: String!
  locations: [Location!]! @relation(name: "LOCATED_IN", direction: OUT)
}

query:

{
  first: Company(name: "Enerdat-S FZ LLC") {
    name
    locations {
      __typename
      ... on Country {
        name
      }
      ... on City {
        name
      }
    }
  }
}

Problems:
version 2.7.0
TypeError: Cannot read property 'astNode' of undefined at getAdditionalLabels (/MyPath/node_modules/neo4j-graphql-js/dist/utils.js:571:52)

my debugging - interfaceLabel is undefined. It has disappeared from selection.js file between last two commits without a commit removing the line.

It seems like the merge commit: bf3758ba johnymontana <lyonwj@gmail.com> on 2019-08-13 at 00:35 did not merge translate.js correctly. It returned to using interfaceLabel (eg. line 184), but file selections.js is not sending this variable anymore (as changed in f243e650 Laurens Lavaert <llavaert@gmail.com> on 2019-07-06 at 09:26 to allow multiple inline statements)

version 2.6.3
“working” - it takes first inline fragment and uses only it, I though that this problem was addressed in issue#270 and that’s why I upgraded to new one.

michal-trnka added a commit to michal-trnka/neo4j-graphql-js that referenced this issue Aug 16, 2019
Fixed merge commit that did not correctly merge two changes - using
multiple labels on nodes and allowing multiple inline fragments.

Issue number: neo4j-graphql#289
@johnymontana
Copy link
Contributor

I'm closing this as the fix PR was merged and released in v2.7.1, but please reopen if you see this problem again.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants