Basic question GraphQl

Hello everyone,

My apologies for my ignorance here- I am new to the Graphql world.

I am just trying to connect a resource and have been given the following basic instructions. However, I cannot for the life of me work out how to get retool to connect to it!
I've tried reading a bit on how to but a lot of the lingo doesn't make sense to me at my current knowledge base.

Any advice would be warmly appreciated.


To authenticate and retrieve a token, send a POST here: https://demo.api.XXX

With these credentials as body:
username: apiuser
password: ******
grant_type: password
scope: api_access

The response should return an access token to use against the graphql API and a refresh token.


query {
  visit(id: Id!) {
    orders {
      product { pimsId, label, productType }
      treatments(fromDt: Datetime!, untilDt: Datetime!) {
        treatmentNotes { treatmentNote }
        user { nameFirst, nameLast, username }

Hey @bg1900!

It sounds like you might want to set up a custom auth flow (docs!). With that you can set up a POST request to that endpoint and then store the auth token it returns as a variable:

Note that the syntax you need may be a bit different than {{ http1.body.auth_token }} since it depends on what the endpoint actually returns but you can see what that is either in the docs you're currently referencing or by hitting the Test auth workflow button:

The variable you store can then be used in the request itself:

The docs are a great place to dig into about how to set things up and there are a number of people asking questions about specific implementations of custom auth here on the forums! Let me know if you run into any particular blockers :slightly_smiling_face:

Thanks Kabirdas! I'll try that out and see :slight_smile: