2 min read
Resolve from REST
const resolvers = {
Query: {
products: () =>
fetch(`${BASE}/products`).then(r => r.json()).then(b => b.data),
quote: (_, { amount, termMonths }) =>
fetch(`${BASE}/quote`, {
method: 'POST', headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ amount, term_months: termMonths }),
}).then(r => r.json()),
},
};
Batch and cache
Use a per-request DataLoader to dedupe product lookups within one query, and cache the catalogue at the resolver so repeated queries do not each hit the REST API.
Frequently asked questions
Why wrap REST in GraphQL?
To give your front-end a single typed graph and combine Credicorp data with your own. The public ring stays the source of truth behind your resolvers.
How do I avoid N+1 calls?
Use DataLoader to batch and cache within a request, and cache the catalogue at the resolver so the same list isn't fetched repeatedly.
Related reading

Quickstart: Write a typed client in TypeScript
A handful of interfaces gives you end-to-end type safety over the public API — products, quotes and the…
Read →
Quickstart: Cache the product catalogue correctly
The catalogue changes rarely, so caching it removes the API from your hot path and keeps you well under the…
Read →
Quickstart: Proxy the public API through your backend
A thin backend proxy lets you cache, trim payloads and keep one origin for your front-end — and it is the…
Read →
Quickstart: list Credicorp business-finance products
GET /public/v1/products returns the live catalogue of Credicorp business-finance products. Each item carries…
Read →Funding for UK limited companies
Credicorp lends to your company, not to you personally — short-term working capital with no personal guarantee. See what your business could access.