Neo4j-graphql Autogenerated argument not working

graphql

(Erikmiller) #1

I have created a simple schema for testing. I know neo4j-graphql automatically adds some addiitonal args such as orderBy and filter as well as args for each node property.

Below is a simple object that is part of the schema

type Channel {
    id: ID!
    channelId: String
    channelDays: [ChannelDay] @relation(name: "CHANNEL_DAY", direction: OUT)
}

When I run a query using the "id" arg it return the expected value, but when I run it using the channelId arg nothing is returned.
For example...

query TestQuery{
  Channel(id: "Channel-10002"){
    id
    channelId
  } 
}
###### returns a result
{
  "data": {
    "Channel": [
      {
        "id": "Channel-10002",
        "channelId": "10002"
      }
    ]
  },
  "extensions": {
    "type": "READ_ONLY"
  }
}


########  BUT
query TestQuery{
  Channel(channelId: "10002"){
    id
    channelId
  } 
}
###### returns no results
{
  "data": {
    "Channel": []
  },
  "extensions": {
    "type": "READ_ONLY"
  }
}

Can anyone help me determine what I'm doing wrong?


(William Lyon) #2

I think we chatted about this on Slack and the issue was that in the database channelId is an integer and in the GraphQL schema it is declared as a string? Was that the problem?


(Erikmiller) #3

Yes that was it, thank you very much William.