Is is possible to use introspection in the API? In...
# prefect-community
t
Is is possible to use introspection in the API? In hasura documentation (and SO) I see it should possible but for whatever introspection query I try to use, I am getting an error (details inside)
discourse 1
An example from hasura introspection docs:
Copy code
{
  __schema {
    queryType {
      fields {
        name
        description
      }
    }
  }
}
Returns
Copy code
{
  "errors": [
    {
      "message": "Unknown argument \"limit\" on field \"__schema\" of type \"Query\".",
      "locations": [
        {
          "line": 2,
          "column": 12
        }
      ],
      "extensions": {
        "code": "GRAPHQL_VALIDATION_FAILED"
      }
    }
  ]
}
I am getting this for every introspection query I am trying to run
Maybe introspection is disabled? I am trying to explore the API - e.g. get object names, fields, etc... Maybe there's another way to do it (documented somewhere?)
s
This only partially answers your question but there is a GraphQL playground UI made available by the Apollo container (if running on docker), I believe the default port is 4200. This UI includes access to a searchable doc with schemas and mutations.
🙌 2
t
I am using the graphql playground to run the query and getting that error. I haven't noticed the searchable docs - thanks for that! Still - I am wondering why the introspection query fails...
s
Yeah those tabs for the docs and schemas are a bit hard to notice. Unfortunately can't help you with the introspection query, haven't tried those myself.
k
I need to ask the team to be sure about this
So we don’t block it but you can’t do it with _the interactive api_; the interactive api automatically adds limits and offsets to queries except those we’ve explicitly exempted and the various introspection queries aren’t ones we’ve added
t
OK. That explains it 🙂