concept @relation in category graphql

appears as: @relation
Fullstack GraphQL Applications With GRANDstack

This is an excerpt from Manning's book Fullstack GraphQL Applications With GRANDstack.

@relation GraphQL Schema Directive

In the property graph model used by Neo4j, every relationship has a direction and type. To represent this in GraphQL, we make use of GraphQL schema directives, specifically the @relation schema directive. A directive is like an annotation in our GraphQL type definitions. It is an identifier preceded by the @ character, which may then optionally contain a list of named arguments. Schema directives are GraphQL’s built-in extension mechanism, indicating some custom logic on the server.

When defining relationship fields using the @relation directive, the name argument indicates the relationship type stored in Neo4j and the direction argument indicates the relationship direction.