graphql icon indicating copy to clipboard operation
graphql copied to clipboard

Allow @exclude-Directive on relation fields

Open Andy2003 opened this issue 3 years ago • 0 comments

Currently there is no way to exclude some operations on relation fields.

I would suggest allowing the use of the @exclude directive at the field level for relations as well, so that you can configure the following:

type Actor @exclude(operations: [CONNECT]) {
  name: String
}

type Movie {
  title: String
  actors: [Actor] @relationship(type: "ACTED_IN", direction: IN) @exclude(operations: [DELETE, DISCONNECT])
}

With the example above, no connect, delete and disconnect operations are allowed for the Movie::actors field

The available operations for @exclude would be extended by CONNECT and DISCONNECT

Andy2003 avatar Jan 21 '22 19:01 Andy2003