adding in new fields with user todos and query

This commit is contained in:
talksik
2023-05-23 17:06:07 -07:00
parent eb1492f509
commit 6d13b37830
5 changed files with 257 additions and 28 deletions
+2 -22
View File
@@ -1,3 +1,5 @@
//go:generate go run github.com/99designs/gqlgen generate
package graph
import "github.com/talksik/graphql-golang/graph/model"
@@ -7,28 +9,6 @@ import "github.com/talksik/graphql-golang/graph/model"
// It serves as dependency injection for your app, add any dependencies you require here.
var todos = []*model.Todo{
{
ID: "1",
Text: "laundry",
Done: false,
},
{
ID: "2",
Text: "woah",
Done: false,
},
{
ID: "3",
Text: "Hello",
Done: false,
User: &model.User{
ID: "1",
Name: "Talksik",
},
},
}
type Resolver struct{
Todos []*model.Todo
}