Batch Graphql @Source #29330
-
I tried to use batch queries in GraphQL according to this guide, but I ran into an unpleasant problem.
The problem is that several different entities can have the same nested entities. When these nested entities are requested, their collection is smaller than the collection in the @source method parameters. And in my opinion, this is normal, because there may not be a nested entity at all, or there may be fewer of them due to duplication. But in this case I get an error. If you duplicate the entity with your hands in the collection, then everything starts working, but this is some kind of crutch My request looks something like this public Uni<List<PersonData>> getPhysicalPerson(@Source List<AppealOutput> appeals) { // list.size() == 10
return Multi.createFrom().iterable(appeals)
.onItem().transform(appeal -> appeal.getInitiator().getId())
.collect().asList()
.onItem().transformToUni(physicalPersonClient::getAllById) // example list.size() == 5, error
} |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
/cc @jmartisk, @phillip-kruger |
Beta Was this translation helpful? Give feedback.
/cc @jmartisk, @phillip-kruger