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.

26 lines
551 B

  1. package resolvers
  2. import (
  3. "context"
  4. "git.aiterp.net/rpdata/api/models"
  5. )
  6. /// Queries
  7. func (r *queryResolver) Changes(ctx context.Context, filter *models.ChangeFilter) ([]*models.Change, error) {
  8. if filter == nil {
  9. filter = &models.ChangeFilter{}
  10. }
  11. return r.s.Changes.List(ctx, *filter)
  12. }
  13. /// Subscriptions
  14. func (r *subscriptionResolver) Changes(ctx context.Context, filter *models.ChangeFilter) (<-chan *models.Change, error) {
  15. if filter == nil {
  16. filter = &models.ChangeFilter{}
  17. }
  18. return r.s.Changes.Subscribe(ctx, *filter), nil
  19. }