podhmo / apikit

api toolkit (WIP)
MIT License
0 stars 0 forks source link

support graphql #150

Closed podhmo closed 2 years ago

podhmo commented 3 years ago

https://spec.graphql.org/draft/

podhmo commented 3 years ago

💭 graphql-go/graphql is better for bottom-up construction, maybe.

podhmo commented 3 years ago

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

podhmo commented 3 years ago

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)
podhmo commented 3 years ago

more features

podhmo commented 3 years ago

error handling