Created @security
directive which can be set on the Query
type with the following options:
type Query @security(introspection: false, depth: 10, complexity: 100) {
# ...
}
A new @complexity
directive has been created which can be attached to fields to calculate complexity (default calculation provided for relationships):
type User {
# default calculation
posts: [Post!]! @hasMany @complexity
# custom calculation
posts: [Post!]! @hasMany @complexity(resolver: "App\\Http\\GraphQL\\Complexity::userPosts")
}