Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
There is a requirement to pull data from one of our applications which support GraphQL. Can anybody provides the idea of how we can implement through talend components. I tried with tRest ->tExtractJSON->tlogRow but the output resulted in error code.
This is how I designed tRest I put a POST request , in header tab provided the content type and authorization then in http body has provided the GraphQL .
Thanks
@Sreejith Sreedharan Leela Take a look at the below topics which show how to write the query.
https://community.talend.com/s/question/0D53p00007vCpE8CAK/graphql-in-talend
https://community.talend.com/s/question/0D53p00007vCn6MCAS/how-to-use-graphql-query-with-talend
Please try and let me know if you have any errors.
Regards
Shong
Thanks for the reply. These links I already tried and no result. My question is ,can I pass the graphql query in the http body of the tRest client,
Can anybody provides a solution to how the graphQL can be pass to tRestClient . The reference for this particular use case is less in the support channels, so your support would be appreciable.
can you confirm that you are using tRestClient or tRest Component?
with tRestClient:
...tMap-->tRestClient
You should see a body and a string column in your tMap output table. In your tMap output table's string column value expression, write your query string.
You may want to test the JSON being produce by replacing the tRestClient with a tLogRow.
with tRest:
write the query string in the body field.
Regards
Shong
I tried tRest first, in http body part I provided the json graphql query similar like below. But it throws error.
"
{
online_users {
id
}
todos {
user {
id
name
}
}
}
"
output
==============
----------------+----------.
| tLogRow_7 |
|=---------------+---------=|
|Body |ERROR_CODE|
|=---------------+---------=|
|error code: 1010|403 |
'----------------+----------'