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 does not provide _id field for internal id

The former library neo4j-graphql-js did provide the internal neo4j-ID (of an object) as the graphql field _id.

The current library @neo4j/graphql seems to not provide it anymore.

Is it somehow possible get the old behaviour?

1 REPLY 1

William_Lyon
Graph Fellow

The _id field was not added because internal node ids shouldn't really be referenced in external systems as node ids can be reclaimed after nodes are deleted and isn't really a unique id. More explanation in the docs here: https://neo4j.com/docs/graphql-manual/current/guides/migration-guide/type-definitions/#_id_2

 

You might consider the id directive which will autogenerate uuids at creation to ensure a unique id for each node: https://neo4j.com/docs/graphql-manual/current/type-definitions/autogeneration/#type-definitions-auto...