nikitastupin / clairvoyance

Obtain GraphQL API schema even if the introspection is disabled
Apache License 2.0
1.02k stars 92 forks source link

Exception: Unable to get TypeRef for [] in context Field #51

Closed mbrg closed 1 year ago

mbrg commented 2 years ago

Hi, this is a very cool project!!

Could you help me figure out what can I do to resolve this? I'm getting an error with command:

python3 -m clairvoyance -o ./schema.json -w wordlist.txt https://www.REDACTED.com/graphql/

Full error:

Traceback (most recent call last):
  File "/usr/lib/python3.9/runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.9/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/home/mbrg/install/clairvoyance/clairvoyance/__main__.py", line 4, in <module>
    cli()
  File "/home/mbrg/install/clairvoyance/clairvoyance/cli.py", line 109, in cli
    asyncio.run(
  File "/usr/lib/python3.9/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "/usr/lib/python3.9/asyncio/base_events.py", line 642, in run_until_complete
    return future.result()
  File "/home/mbrg/install/clairvoyance/clairvoyance/cli.py", line 67, in blind_introspection
    schema = await oracle.clairvoyance(
  File "/home/mbrg/install/clairvoyance/clairvoyance/oracle.py", line 503, in clairvoyance
    results = await asyncio.gather(*tasks)
  File "/home/mbrg/install/clairvoyance/clairvoyance/oracle.py", line 438, in explore_field
    typeref = await probe_field_type(
  File "/home/mbrg/install/clairvoyance/clairvoyance/oracle.py", line 358, in probe_field_type
    return await probe_typeref(documents, 'Field')
  File "/home/mbrg/install/clairvoyance/clairvoyance/oracle.py", line 342, in probe_typeref
    raise Exception(e) from e
Exception: Unable to get TypeRef for ['query { ApplicationType }', 'query { ApplicationType { lol } }'] in context Field

Probably related to #20

doomerhunter commented 1 year ago

Hi !

Bumping with the same issue :

Exception: Unable to get TypeRef for ['query { 96013192d3b3 }', 'query { 96013192d3b3 { lol } }'] in context Field

Query :

query { 96013192d3b3 { lol } }

Response :

{
  "errors": [
    {
      "message": "Syntax Error: Invalid number, expected digit but got: \"d\".",
      "locations": [
        {
          "line": 1,
          "column": 17
        }
      ],
      "extensions": {
        "code": "GRAPHQL_PARSE_FAILED"
      }
    }
  ]
}

Just to add a bit of context :)

Have a nice day !

nikitastupin commented 1 year ago

Hey @mbrg and @ch4dbzh! Could you check this with the latest (2.5.1) version of Clairvoyance and see whether it solved the problem? Thanks!

mbrg commented 1 year ago

Hey @mbrg and @ch4dbzh! Could you check this with the latest (2.5.1) version of Clairvoyance and see whether it solved the problem? Thanks!

It does! ty!