Closed podhmo closed 2 years ago
💠graphql-go/graphql is better for bottom-up construction, maybe.
this is the action definition example.
func DoSomething(ctx context.Context, id string) (*T, error) { return nil, nil }
https://gist.github.com/podhmo/8b7ae20b3816c6f986de565237ae0dfd#file-main_test-go-L63-L91
routing example (this is not fixed)
var r Router
r.Query("todo", action.ResolveTodo)
r.Object(design.Todo{}, func(r Router) {
r.Query("children", action.ResolveTodoChildren)
})
r.Mutation("updateTodo", action.UpdateTodo)
https://spec.graphql.org/draft/