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.

55 lines
1.1 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) Subscription() SubscriptionResolver {
  23. return queries.SubscriptionResolver
  24. }
  25. func (r *rootResolver) Log() LogResolver {
  26. return &types.LogResolver
  27. }
  28. func (r *rootResolver) Chapter() ChapterResolver {
  29. return &types.ChapterResolver
  30. }
  31. func (r *rootResolver) Story() StoryResolver {
  32. return &types.StoryResolver
  33. }
  34. func (r *rootResolver) File() FileResolver {
  35. return &types.FileResolver
  36. }
  37. func (r *rootResolver) Change() ChangeResolver {
  38. return &types.ChangeResolver
  39. }
  40. func (r *rootResolver) Token() TokenResolver {
  41. return &types.TokenResolver
  42. }