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
570 B

  1. package types
  2. import (
  3. "context"
  4. "git.aiterp.net/rpdata/api/graph2/input"
  5. "git.aiterp.net/rpdata/api/models"
  6. )
  7. type changeResolver struct{}
  8. func (r *changeResolver) Objects(ctx context.Context, obj *models.Change) ([]input.ChangeObject, error) {
  9. objects := obj.Objects()
  10. results := make([]input.ChangeObject, 0, len(objects))
  11. for _, object := range objects {
  12. if changeObject, ok := object.(input.ChangeObject); ok {
  13. results = append(results, changeObject)
  14. }
  15. }
  16. return results, nil
  17. }
  18. // ChangeResolver is a resolver
  19. var ChangeResolver changeResolver