GraphQL uses the same HTTP requests to a server to retrieve data. However, there are some key differences in how you structure those requests when working with GraphQL:
GraphQL exposes a single endpoint (e.g./graphql
) for all API operations.
In REST, you use different HTTP methods to perform CRUD operations (GET, POST, PUT, DELETE). In GraphQL, you use the POST method and send a query or mutation as the request body.
Instead of specifying different endpoints and parameters as you do in REST, in GraphQL you send a structured query that defines the data you want. The query is written using the GraphQL Query Language.
GraphQL Query Language allows you to make queries with a lot more flexibility than traditional REST API servers. You can specify the fields you want, access nested data, get many resources in a single request, and more.
In order to start making requests to the GraphQL API Endpoint, you will need to first authenticate.
Authenticate
https://datafeeds.rolling-insights.com/auth/token <POST>
Body:
{
"client_id": "YOUR CLIENT ID",
"client_secret": "YOUR CLIENT SECRET",
"grant_type": "client_credentials"
}
Make sure that the credentials and grant_type are part of the Body of the POST request and that the content-type is of application/x-www-form-urlencoded