package queries import ( "context" "errors" "git.aiterp.net/rpdata/api/models" "git.aiterp.net/rpdata/api/models/changes" ) /// Queries func (r *resolver) Changes(ctx context.Context, filter *changes.Filter) ([]models.Change, error) { return changes.List(filter) } /// Subscriptions func (r *subscriptionResolver) Changes(ctx context.Context, keys []models.ChangeKey) (<-chan models.Change, error) { if len(keys) == 0 { return nil, errors.New("At least one key is required for a subscription") } return changes.Subscribe(ctx, keys, false), nil }