Skip to content

Java DataLoader: Mismatches results #79

Description

@krdk01

I am using boot-graphql-kick-start in my project(I used Netflix DGS. Result is the same). When I used Dataloader, the result is missmatching. where am I wrong? Can you help me?

Query:
image

Result:
image

Entity: I have ManyToOne Relation With My RoleEntity
image

DataLoader Method: I'm Using BatchLoader for n+1.
image

Hibernate Query: In dataLoader Iam wathcing the result. Is seems correctly
image

Activity

  1. wsaca commented on Apr 29, 2021

    @wsaca

    You could reorder the results to match the order of your keys (roles) or use MappedBatchLoader to return a Map with:

    roleService.findByIdIn(roles).stream().collect(Collectors.toMap(Role::getId, item -> item));
  2. locked and limited conversation to collaborators on Jul 31, 2021
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