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 *issueResolver) IssueVariants(ctx context.Context, obj *model.Issue, filter *model.IssueVariantFilter, first *int, after *string) (*model.IssueVariantConnection, error) {
	return baseResolver.IssueVariantBaseResolver(r.App, ctx, filter, first, after, &model.NodeParent{
		Parent:     obj,
		ParentName: model.IssueNodeName,
	})
}

func (r *issueResolver) Activities(ctx context.Context, obj *model.Issue, filter *model.ActivityFilter, first *int, after *string) (*model.ActivityConnection, error) {
	return baseResolver.ActivityBaseResolver(r.App, ctx, filter, first, after, &model.NodeParent{
		Parent:     obj,
		ParentName: model.IssueNodeName,
	})
}

func (r *issueResolver) IssueMatches(ctx context.Context, obj *model.Issue, filter *model.IssueMatchFilter, first *int, after *string, orderBy []*model.IssueMatchOrderBy) (*model.IssueMatchConnection, error) {
	return baseResolver.IssueMatchBaseResolver(r.App, ctx, filter, first, after, nil, &model.NodeParent{
		Parent:     obj,
		ParentName: model.IssueNodeName,
	})
}

func (r *issueResolver) ComponentVersions(ctx context.Context, obj *model.Issue, 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.IssueNodeName,
	})
}

func (r *Resolver) Issue() graph.IssueResolver { return &issueResolver{r} }

type issueResolver struct{ *Resolver }
