resolveBindArguments($type->fields(), false); } /** * The directives of the mutation. * * @return array */ public function directives(): array { return [ 'canModel' => [ 'ability' => 'create', 'model' => Like::class, ], ...parent::directives(), ]; } /** * Get the rules for the create mutation. * * @param array $args * @return array */ public function rules(array $args): array { $type = new LikeType(); return collect($type->fields()) ->filter(fn (Field $field) => $field instanceof CreatableField) ->mapWithKeys(fn (Field&CreatableField $field) => [$field->getColumn() => $field->getCreationRules($args)]) ->toArray(); } /** * The base return type of the mutation. */ public function baseType(): Type { return new LikedUnion(); } /** * The type returned by the field. */ public function getType(): Type { return Type::nonNull($this->baseType()); } }