name ?? Str::camel($this->column); } public function getColumn(): string { return $this->column; } public function description(): string { return ''; } /** * @return Argument[] */ public function arguments(): array { return []; } public function type(): Type { $baseType = $this->baseType(); $type = $baseType instanceof BaseType || $baseType instanceof BaseUnion ? GraphQL::type($baseType->name()) : $baseType; if (! $this->nullable) { return Type::nonNull($type); } return $type; } public function deprecate(string $reason): static { $this->deprecationReason = $reason; return $this; } /** * @return Type|BaseType */ abstract public function baseType(); public function resolve($root, array $args, $context, ResolveInfo $resolveInfo): mixed { return Arr::get($root, $this->column); } }