t

    Tomer Cagan

    6 months ago
    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)
    An example from hasura introspection docs:
    {
      __schema {
        queryType {
          fields {
            name
            description
          }
        }
      }
    }
    Returns
    {
      "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?)
    Sylvain Hazard

    Sylvain Hazard

    6 months ago
    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.
    t

    Tomer Cagan

    6 months ago
    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...
    Sylvain Hazard

    Sylvain Hazard

    6 months ago
    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.
    Kevin Kho

    Kevin Kho

    6 months ago
    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

    Tomer Cagan

    6 months ago
    OK. That explains it 🙂