Skip to content

[Suggestion] ability to allow multi queries for internal calls only #2546

Closed

Description

@1valdis

Currently by default, a query like

await context.app.service('profiles').remove(null, {
  query: {
    user_id: context.id,
  },
});

won't work unless profiles service has multi option allowing multi delete. Yet, having that allowed, Feathers "authomatically" allows for multi delete external call on profiles, which is suboptimal. I think it could be useful if there were not only "true" and "false" options for multi, but also either a list of providers allowed for multi, or some other option to allow for internal multi call but disallow external one.

One could use feathers-hooks-common disable-multi-item-change conditionally with iff(isProvider(...)), but disable-multi-item-change is deprecated since feathers-hooks-common@5.0.0.

Activity

  1. FossPrime commented on Feb 3, 2022

    @FossPrime
    Member

    This is about adapters-common

    It seems to me that this is already covered by _remove style methods... or am I missing something?

    https://stackblitz.com/fork/feathersjs (The default template does not use an adapter... so it doesn't have the concept of multi)

  2. daffl commented on Feb 4, 2022

    @daffl
    Member

    Correct, the multi checks are done at the adapter service method level (e.g. https://github.com/feathersjs/feathers/blob/dove/packages/adapter-commons/src/service.ts#L194). So calling the underscored methods will circumvent that check.

  3. 1valdis commented on Feb 4, 2022

    @1valdis
    Author

    I didn't know that underscored methods allow for multi calls even if a service has them disabled. Is this mentioned somewhere in the docs? I'm pretty sure I read everything there is for multi option but there was no such note. Might be worth adding?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions