REST to GraphQL
Examples of how to use Bi-direct to make REST API calls to a server that only supports GraphQL queries.
Bi-Direct endpoint for REST to SOAP: https://tri-way.vercel.app/resttographql
Just like a REST to SOAP API call if you want to pass any data and the required data in the request body, you need to include a JSON object with the following keys:
Url: The endpoint URL of the REST API you want to use
Data (not optional in this case): The query you want to make
Example of a Query request
Normally this is how a GraphQL query looks like
{
characters(page: 1) {
results {
name
id
}
}
}
Example of a query made using Bi-Direct
Headers
headers: {
'Content-Type': 'application/json'
}
Request Body
{
"Url": "https://rickandmortyapi.graphcdn.app/",
"Data": "query { characters(page:1){ results { name } }}"
}
Last updated