Express API server in Node.js that serves up REST API and GraphQL endpoints, handling various APIs requests for all frontend apps.
All the below listed API endpoints return 200
when a request is successful, and various different codes, e.g., 400
, 500
etc., when something wrong happens.
An external link to our public GraphQL APIs.
In non-production environments, an embedded version of Apollo Sandbox is shown on Apollo Server 4's landing page, served at http://localhost:4000/graphql
.
query ExampleQuery {
cosmosUsersCount {
usersCount
}
}
{
"data": {
"cosmosUsersCount": [
{
"usersCount": "36517"
}
]
}
}
In production environments, when NODE_ENV
is production
, users can query data as follows:
curl --request POST \
--header 'content-type: application/json' \
--url https://api.forbole.com/graphql \
--data '{"query":"query {cosmosUsersCount{usersCount}}"}' |
jq
{
"data": {
"cosmosUsersCount": [
{
"usersCount": "46010"
}
]
}
}