Skip to content

Understanding the plugin use cases #7

@yossisp

Description

@yossisp

After going through the code of the plugin it seems that the plugin only works with the default resolvers provided with graphql-compose (e.g. findById or findByIds). Am I correct? So if I'm using a custom resolver the plugin will not help me. I think it will be nice to note this in the readme because users might expect that the plugin automatically provides dataloader functionality for all resolvers (at least this is what I expected).

In addition, on this line for findByIds loader I'm wondering why findByIdResolver.resolve is called in resolve(resolveParamsArray.map(rp => findByIdResolver.resolve(rp))). Shouldn't findByIdsResolver be given an array of id's and called once? Same goes for this line shouldn't findManyResolver.resolve be given an array of id's and resolve them in one call? Without this modification as far as I understand the only advantage of using the plugin is that it batches calls to resolvers. But it doesn't group database queries. Am I correct?

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