How to call StarDog from Isomnia/POSTMAN

http://localhost:5820

{
    Droid {
        name
        friends {
            name
        }
    } 
}

401 Unauthorized?

What credentials are needed and where can I find them thanks

I’m not sure what that snippet with Droid/friends/name is but Stardog uses http basic authentication and the default user/password is admin/admin unless you’ve changed it.

Thanks @zachary.whitle, within Studio when connecting, it doesnt matter what credentials are for

username
password

It will still connect?

But in Isomnia even if I put
username: admin
password: admin

Still 405 Method Not Allowed?

Droid is from the tutorial StarWars dB

That is not correct. You’ll need to supply the correct username/password. This is unless you’ve disabled security for some reason which isn’t common. Studio does not need to be run on the same machine that is running the Stardog server.

You’re getting a 405 method not allowed not a 403 forbidden. You should check the rest api to make sure you’re sending the right request. https://stardog.docs.apiary.io/#

Tried all of the Content-Types but still 405?

What is the exact call that you’re trying to make?

The same above

{
    Droid {
        name
        friends {
            name
        }
    } 
}

security enabled again in Studio, so admin/admin and works only in Studio, but in Insomnia:

Basic Authentication:
username admin
password admin

405 METHOD NOT ALLOWED?

Header:
Content-Type application/json

What url are you requesting?

The same URL within Studio:

http://localhost:5820

That's the base url that Studio will use to construct the urls to interact with Stardog with. If you're looking to do a GraphQL query then the url would be http://localhost:5820/{db}/graphql replacing {db} with the name of your database.

https://www.stardog.com/docs/#_execute_graphql_query

Thanks @zachary.whitley now it works. :slight_smile:

BTW same query:

{
    Droid {
        name
    } 
}

Returning:

{
  "data": [
    {
      "name": "C-3PO"
    },
    {
      "name": "R2-D2"
    }
  ]
}

StarDogStudio: 143ms
Isomnia: 8ms

Why the big difference? Note in Header of Isomnia I didnt use any Content-Type

Did you run the Studio query first then the rest call? If you go back and do the Studio query again I suspect that it may be faster as there may be some caching going on here.

No matter how many calls in Studio, it is always in 150ms vs 8ms from Isomnia

Stardog Studio is likely including the HTML back and forth in its timer whereas Insomnia isn't. They are using the same HTML endpoint, so server-wise the performance would be identical

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.