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.

51 lines
1.0 KiB

  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) Mutation() MutationResolver {
  20. return queries.MutationResolver
  21. }
  22. func (r *rootResolver) Log() LogResolver {
  23. return &types.LogResolver
  24. }
  25. func (r *rootResolver) Chapter() ChapterResolver {
  26. return &types.ChapterResolver
  27. }
  28. func (r *rootResolver) Story() StoryResolver {
  29. return &types.StoryResolver
  30. }
  31. func (r *rootResolver) File() FileResolver {
  32. return &types.FileResolver
  33. }
  34. func (r *rootResolver) Change() ChangeResolver {
  35. return &types.ChangeResolver
  36. }
  37. func (r *rootResolver) Token() TokenResolver {
  38. return &types.TokenResolver
  39. }