package resolvers // 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. import ( "context" "fmt" "git.aiterp.net/stufflog/server/graph/graphcore" "git.aiterp.net/stufflog/server/models" ) func (r *issueItemResolver) Issue(ctx context.Context, obj *models.IssueItem) (*models.Issue, error) { return r.Database.Issues().Find(ctx, obj.IssueID) } func (r *issueItemResolver) Item(ctx context.Context, obj *models.IssueItem) (*models.Item, error) { return r.Database.Items().Find(ctx, obj.ItemID) } func (r *issueItemResolver) Remaining(ctx context.Context, obj *models.IssueItem) (int, error) { if obj.Acquired { return 0, nil } // TODO: Use logs return obj.Quantity, nil } // IssueItem returns graphcore.IssueItemResolver implementation. func (r *Resolver) IssueItem() graphcore.IssueItemResolver { return &issueItemResolver{r} } type issueItemResolver struct{ *Resolver } // !!! WARNING !!! // The code below was going to be deleted when updating resolvers. It has been copied here so you have // one last chance to move it out of harms way if you want. There are two reasons this happens: // - When renaming or deleting a resolver the old code will be put in here. You can safely delete // it when you're done. // - You have helper methods in this file. Move them out to keep these resolver files clean. func (r *issueItemResolver) Quanity(ctx context.Context, obj *models.IssueItem) (int, error) { panic(fmt.Errorf("not implemented")) }