api: Add graphql endpoint

This commit is contained in:
Kevin Kandlbinder 2022-03-17 00:24:30 +01:00
parent 9e05c54d81
commit 8256b70fcb
21 changed files with 9111 additions and 15 deletions

24
graph/model/list.go Normal file
View file

@ -0,0 +1,24 @@
package model
import (
"github.com/Unkn0wnCat/matrix-veles/internal/db/model"
"go.mongodb.org/mongo-driver/bson/primitive"
)
type List struct {
ID string `json:"id"`
Name string `json:"name"`
Tags []string `json:"tags"`
RawComments []*model.DBComment
MaintainerIDs []*primitive.ObjectID
}
func MakeList(dbList *model.DBHashList) *List {
return &List{
ID: dbList.ID.Hex(),
Name: dbList.Name,
Tags: dbList.Tags,
RawComments: dbList.Comments,
MaintainerIDs: dbList.Maintainers,
}
}