Type configuration
When representing a Neo4j node, a GraphQL Object Type produces multiple operation fields in the Query
, Mutation
, and Subscription
types.
For example:
type Movie {
title: String
length: Int
}
From these type definitions, the library generates the following operation fields:
Query:
-
movies
-
moviesAggregate
-
moviesConnection
Mutation:
-
createMovies
-
deleteMovies
-
updateMovies
Subscription:
-
movieCreated
-
movieUpdated
-
movieDeleted
.
This page describes how to reduce the operation fields produced using the directives @query
, @mutation
, and @subscription
.
@query
This directive is used to limit the availability of query operations in the library.
Definition
directive @query(read: Boolean! = true, aggregate: Boolean! = false) on OBJECT | SCHEMA
Aggregations are no longer generated by default in the 4.0.0 version of the library. See Updated directives for more information. |
@mutation
@subscription
This directive is used to limit subscription operations in the library.