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

cartesi / rollups-explorer / 11943333351

20 Nov 2024 11:09PM CUT coverage: 86.535% (-0.07%) from 86.605%
11943333351

push

github

brunomenezes
chore(ci): Set the Preview endpoint when available in the CI settings.

1276 of 1529 branches covered (83.45%)

Branch coverage included in aggregate %.

9077 of 10435 relevant lines covered (86.99%)

44.89 hits per line

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

0.0
/apps/web/src/lib/urql.ts
1
import { Client, cacheExchange, createClient, fetchExchange } from "urql/core";
×
2

3
let urqlClient: Client | null = null;
×
4
let urqlServerClient: Client | null = null;
×
5

6
const buildClient = (url?: string) => {
×
7
    if (!url)
×
8
        throw new Error(
×
9
            "Rollups explorer API URL not defined! Check .env.template file for reference.",
×
10
        );
×
11

12
    return createClient({
×
13
        url,
×
14
        exchanges: [cacheExchange, fetchExchange],
×
15
    });
×
16
};
×
17

18
export const getUrqlClient = () => {
×
19
    if (!urqlClient) {
×
20
        const url =
×
21
            process.env.NEXT_PUBLIC_PREVIEW_EXPLORER_API_URL ??
×
22
            process.env.NEXT_PUBLIC_EXPLORER_API_URL ??
×
23
            "";
×
24
        urqlClient = buildClient(url);
×
25
    }
×
26

27
    return urqlClient;
×
28
};
×
29

30
export const getUrqlServerClient = () => {
×
31
    if (!urqlServerClient) {
×
32
        const url =
×
33
            process.env.INTERNAL_EXPLORER_API_URL ??
×
34
            process.env.NEXT_PUBLIC_PREVIEW_EXPLORER_API_URL ??
×
35
            process.env.NEXT_PUBLIC_EXPLORER_API_URL ??
×
36
            "";
×
37

38
        urqlServerClient = buildClient(url);
×
39
    }
×
40

41
    return urqlServerClient;
×
42
};
×
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

© 2025 Coveralls, Inc