• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

cofacts / rumors-api / 12866036919

20 Jan 2025 10:29AM UTC coverage: 81.248% (-1.5%) from 82.699%
12866036919

Pull #357

github

jhk482001
add checking issuer for awarding badge
Pull Request #357: add Badge api

764 of 990 branches covered (77.17%)

Branch coverage included in aggregate %.

17 of 48 new or added lines in 5 files covered. (35.42%)

1 existing line in 1 file now uncovered.

1476 of 1767 relevant lines covered (83.53%)

18.6 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/graphql/dataLoaders/badgeLoaderFactory.js
1
import DataLoader from 'dataloader';
2
import client, { processMeta } from 'util/client';
3

4
export default () =>
NEW
5
  new DataLoader(async (slugs) => {
×
NEW
6
    const body = [];
×
7

NEW
8
    slugs.forEach(({ slug }) => {
×
NEW
9
      body.push({ index: 'badges', type: 'doc' });
×
10

NEW
11
      body.push({
×
12
        query: {
13
          term: { slug },
14
        },
15
        size: 1,
16
      });
17
    });
18

NEW
19
    return (
×
20
      await client.msearch({
21
        body,
22
      })
23
    ).body.responses.map(({ hits }) => {
NEW
24
      if (!hits || !hits.hits || hits.hits.length == 0) return null;
×
NEW
25
      return processMeta(hits.hits[0]);
×
26
    });
27
  });
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc