attributes['name'] = $this->getName(); GraphQL::addType($this); GraphQL::addType(new FilterableColumns($type)); } public function getName(): string { return Str::of($this->type->getName()) ->remove('Type') ->append('WhereConditionsInput') ->__toString(); } /** * @return array> */ public function fields(): array { return [ 'field' => [ 'type' => GraphQL::type(new FilterableColumns($this->type)->getName()), ], 'value' => [ 'type' => GraphQL::type('Mixed'), ], 'operator' => [ 'type' => Type::nonNull(GraphQL::type(class_basename(ComparisonOperator::class))), 'defaultValue' => ComparisonOperator::EQ->name, ], 'AND' => [ 'type' => Type::listOf(Type::nonNull(GraphQL::type($this->getName()))), ], 'OR' => [ 'type' => Type::listOf(Type::nonNull(GraphQL::type($this->getName()))), ], ]; } }