Hi All,
I am hoping someone can help me as I have no idea where to start!
I have been tasked with extracting data from a company (MOZO) that provides API endpoints via graphQL into our Salesforce org.
I can use Altair and Postman to send the POST method to get the data, but am stuck when it comes to doing this in Anypoint Studio so that I can insert it in Salesforce.
Some details:
- url provided by MOZO is the following: https://marketview.mozo.com.au/graphql/{access token}
- this url doesn't change
- How can I reference this as an endpoint to send a payload of the graphQL quey to it in Anypoint?
- this url doesn't change
- Payload is sent as POST method (which is fine) and sent as a graphQL query
- eg. { homeLoans ( limit: 10) { additionalRepayments}}
- How can I send this as the body of the payload to then get the response?
- eg. { homeLoans ( limit: 10) { additionalRepayments}}
I am so stuck as I have only ever built applications that create the endpoint for someone to send ME the payload, not needing to send a payload to a pre-existing endpoint url, and I have never used graphQL before so i am not sure if there are extra complexities involved?
Any help would be much appreciated! #Anypoint Studio #MuleSoft #GraphQL #Help
You can use Http requestor to call the Graph ql similar to rest endpoint call in anypoint studio.
Pass following http parameter
URL -https://marketview.mozo.com.au/graphql/{access token}
Method - POST
Content-Type - application/json
payload -
{ "query": "{ homeLoans ( limit: 10) { additionalRepayments}}" }