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.

23 lines
497 B

  1. package queries
  2. import (
  3. "context"
  4. "git.aiterp.net/rpdata/api/graphql/resolver/types"
  5. "git.aiterp.net/rpdata/api/model/channel"
  6. )
  7. // ChannelArgs is args for channel query
  8. type ChannelArgs struct {
  9. Name string
  10. }
  11. // Channel resolves the channel query
  12. func (r *QueryResolver) Channel(ctx context.Context, args *ChannelArgs) (*types.ChannelResolver, error) {
  13. channel, err := channel.FindName(args.Name)
  14. if err != nil {
  15. return nil, err
  16. }
  17. return &types.ChannelResolver{C: channel}, nil
  18. }