package resolver

// This file will be automatically regenerated based on the schema, any resolver implementations
// will be copied through when generating and any unknown code will be moved to the end.
// Code generated by github.com/99designs/gqlgen

import (
	"context"

	"github.com/cloudoperators/heureka/internal/api/graphql/graph"
	"github.com/cloudoperators/heureka/internal/api/graphql/graph/baseResolver"
	"github.com/cloudoperators/heureka/internal/api/graphql/graph/model"
)

// SPDX-FileCopyrightText: 2025 SAP SE or an SAP affiliate company and Greenhouse contributors
// SPDX-License-Identifier: Apache-2.0

func (r *componentResolver) ComponentVersions(ctx context.Context, obj *model.Component, filter *model.ComponentVersionFilter, first *int, after *string, orderBy []*model.ComponentVersionOrderBy) (*model.ComponentVersionConnection, error) {
	return baseResolver.ComponentVersionBaseResolver(r.App, ctx, filter, first, after, orderBy,
		&model.NodeParent{
			Parent:     obj,
			ParentName: model.ComponentNodeName,
		})
}

func (r *Resolver) Component() graph.ComponentResolver { return &componentResolver{r} }

type componentResolver struct{ *Resolver }
