The Renovate branches changed go.mod and package.json without go.sum or package-lock.json, so this tidies the module graph, regenerates the gqlgen code for v0.17.98 and refreshes the lockfile. katex stays on 0.16: @mdit/plugin-katex renders with its own katex ^0.16 and Markdown.vue loads only the stylesheet from the top-level package, so 0.19's CSS would no longer match the rendered HTML. renovate.json5 now caps it below 0.17 so the bump is not proposed again. Co-Authored-By: Claude Opus 5.5 <[email protected]>
33 lines
1.0 KiB
Go
33 lines
1.0 KiB
Go
package graph
|
|
|
|
// 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 version v0.17.98
|
|
|
|
import (
|
|
"context"
|
|
|
|
"adam-french.co.uk/backend/graph/model"
|
|
"adam-french.co.uk/backend/models"
|
|
)
|
|
|
|
// CreateFavorite is the resolver for the createFavorite field.
|
|
func (r *mutationResolver) CreateFavorite(ctx context.Context, input model.CreateFavoriteInput) (*models.Favorite, error) {
|
|
favorite := models.Favorite{Type: input.Type, Name: input.Name, Link: input.Link}
|
|
if err := r.Store.DB.Create(&favorite).Error; err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
return &favorite, nil
|
|
}
|
|
|
|
// Favorites is the resolver for the favorites field.
|
|
func (r *queryResolver) Favorites(ctx context.Context) ([]*models.Favorite, error) {
|
|
var favorites []models.Favorite
|
|
if err := r.Store.DB.Order("created_at DESC").Find(&favorites).Error; err != nil {
|
|
return nil, err
|
|
}
|
|
return ptrs(favorites), nil
|
|
}
|