Home / Companies / Vonage / Blog / Post Details
Content Deep Dive

Using Apollo to Query GraphQL from Node.js

Blog post from Vonage

Post Details
Company
Date Published
Author
Michael Jolley
Word Count
1,361
Company Posts That Month
62
Language
English
Hacker News Points
-
Post removed?
No
Summary

The Apollo client library within a Node.js Express app can provide a middleman to a third-party endpoint, abstracting GraphQL queries and mutations without requiring direct access from the frontend JavaScript app. An Express application can use this middleman to forward requests to the third-party endpoint, handling authentication with custom headers as needed. The example uses the Apollo client library to create an HTTP link that injects node-fetch, providing a solution for scenarios where CORS headers are not provided by the third-party endpoint. The code also demonstrates how to generate valid JWT tokens and attach them to custom headers using the jsonwebtoken package. With this setup, requests can be sent to the Express application to retrieve data from the third-party endpoint.

Trends Found in this Post
Trend Post Mentions Total Month Mentions Posts Companies MoM
Secrets Management 3 314 48 29 -40%
Real-time 1 786 208 71 -4%
Use This Data

Use this post, company, and trend context to find content marketing opportunities, perform competitive analysis, or address product feature gaps via the Plushcap MCP server or the Plushcap API.