- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-28-2024 11:40 PM
Hi All,
I have created a graphQL API and using the below query I am able to get the result as expected in GraphQL Explorer.
Query:
query {
x1306737Graphql {
IncidentQuerySchema {
getIncidents(
priority: "1"
) {
shortDescription
priority
number
}
}
}
}
I am not getting how to pass this query in REST API POST/GET or any server side script method to get the response? Can anyone help me how we can pass this query in REST API to get the response as expected.
Thanks in advance!
Regards,
Ganesh
Solved! Go to Solution.
- Labels:
-
Architect
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-30-2024 02:51 AM
Hi @DineshS : I tried with below query in the content and it worked fine for me.
{"query" : "query { x1306737Graphql { IncidentQuerySchema { getIncidents( priority: \\\"2\\\" ) { shortDescription priority number } } } }"}
Thank you so much for your response on this question.
Regards,
Ganesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-30-2024 12:49 PM - edited 05-30-2024 12:50 PM
Hi @Ganeshm1 , I realised the trick is to convert the GraphQL to JSON format and found the site https://datafetcher.com/graphql-json-body-converter really helpful for the conversion. Could you please try and let me know if it works ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-30-2024 02:51 AM
Hi @DineshS : I tried with below query in the content and it worked fine for me.
{"query" : "query { x1306737Graphql { IncidentQuerySchema { getIncidents( priority: \\\"2\\\" ) { shortDescription priority number } } } }"}
Thank you so much for your response on this question.
Regards,
Ganesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-30-2024 12:49 PM - edited 05-30-2024 12:50 PM
Hi @Ganeshm1 , I realised the trick is to convert the GraphQL to JSON format and found the site https://datafetcher.com/graphql-json-body-converter really helpful for the conversion. Could you please try and let me know if it works ?