middleware = array_merge( $this->middleware, [ AuthMutation::class, ResolveBindableArgs::class, ], ); } /** * @return array */ public function attributes(): array { return [ 'name' => $this->name(), 'description' => $this->description(), 'baseType' => $this->baseType(), ]; } abstract public function name(): string; public function description(): string { return ''; } public function getAuthorizationMessage(): string { return $this->response->message() ?? 'Unauthorized'; } /** * The arguments of the mutation. * * @return Argument[] */ abstract public function arguments(): array; public function type(): Type { return GraphQL::type($this->baseType()->name()); } /** * The base return type of the mutation. */ public function baseType(): BaseType|BaseUnion|null { return null; } protected function runHttpMiddlewares(array $middlewares): void { resolve(Pipeline::class) ->send(request()) ->through($middlewares) ->thenReturn(); } }