Skip to content

Latest commit

 

History

History
21 lines (17 loc) · 874 Bytes

README.md

File metadata and controls

21 lines (17 loc) · 874 Bytes

GraphQL.BatchResolver

Resolve your collections in batches and prevent multiple round-trips to the DB.

NuGet MyGet Pre Release MyGet Build Status

API

Field<ListGraphType<DroidType>>()
    .Batch(d => d.DroidId)
    .Resolve(ctx =>
    {
        var ids = ctx.Source; // Source contains the keys collection
        return db.Droids.Where(d => ids.Contains(d.DroidId)).ToListAsync();
    });