Global configuration
This is the documentation of the GraphQL Library version 6. For the long-term support (LTS) version 5, refer to GraphQL Library version 5 LTS. |
Through the schema configuration, it is possible to globally disable specific types of operation. To set up operations individually, refer to Type Configuration.
For instance, if you want to disable all top-level aggregation operations at once, the Neo4j GraphQL Library offers this option through schema extensions with @query
:
type Movie @node {
title: String
actors: [Actor!]! @relationship(type: "ACTED_IN", direction: IN)
}
type Actor @node {
name: String
movies: [Movie!]! @relationship(type: "ACTED_IN", direction: OUT)
}
extend schema @query(read: true, aggregate: false)
Query
-
movies
-
moviesAggregate
-
moviesConnection
-
actors
-
actorsAggregate
-
actorsConnection
Invalid schema usage
The same schema configuration directive cannot be applied to both schema and object. Take the following type definitions as example:
type Movie @node {
title: String
actors: [Actor!]! @relationship(type: "ACTED_IN", direction: IN)
}
type Actor @node @query(read: false, aggregate: true) {
name: String
movies: [Movie!]! @relationship(type: "ACTED_IN", direction: OUT)
}
extend schema @query(read: true, aggregate: false)
Such configuration prompts the error "@query directive already defined at the schema location"
.