cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

Neo4j-graphql Autogenerated argument not working

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?

2 REPLIES 2

William_Lyon
Graph Fellow

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?

Yes that was it, thank you very much William.

Nodes 2022
Nodes
NODES 2022, Neo4j Online Education Summit

All the sessions of the conference are now available online