GraphQL API and utilities for the rpdata project
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
807 B

  1. package graph2
  2. import (
  3. "git.aiterp.net/rpdata/api/graph2/queries"
  4. "git.aiterp.net/rpdata/api/graph2/types"
  5. graphql "github.com/99designs/gqlgen/graphql"
  6. )
  7. //go:generate ./combine.sh
  8. //go:generate gorunpkg github.com/99designs/gqlgen -v
  9. // New creates a new GraphQL schema.
  10. func New() graphql.ExecutableSchema {
  11. return NewExecutableSchema(Config{
  12. Resolvers: &rootResolver{},
  13. })
  14. }
  15. type rootResolver struct{}
  16. func (r *rootResolver) Query() QueryResolver {
  17. return &queries.Resolver
  18. }
  19. func (r *rootResolver) Log() LogResolver {
  20. return &types.LogResolver
  21. }
  22. func (r *rootResolver) Chapter() ChapterResolver {
  23. return &types.ChapterResolver
  24. }
  25. func (r *rootResolver) Story() StoryResolver {
  26. return &types.StoryResolver
  27. }
  28. func (r *rootResolver) File() FileResolver {
  29. return &types.FileResolver
  30. }