Comments (8)
Hi @jondowsec,
Looking at the exception I conclude that clairvoyance wasn't able to recognize the suggestion because the suggestion uses '
and clairvoyance expects "
.
Could you please add regexes to
clairvoyance/clairvoyance/oracle.py
Line 374 in 33da27e
'
with "
) and run against your GraphQL endpoint?from clairvoyance.
I changed the "
with '
and worked like a charm. Thank you.
from clairvoyance.
Cool! You may do a Pull Request with the changes you've made so others will benefit from your improvements 😃
from clairvoyance.
Small issue after leaving it for a while I get a TypeRef error:
Traceback (most recent call last):
File "/usr/lib/python3.7/runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "/usr/lib/python3.7/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/clairvoyance/clairvoyance/__main__.py", line 97, in <module>
wordlist, config, input_schema=input_schema, input_document=input_document
File "/clairvoyance/clairvoyance/oracle.py", line 453, in clairvoyance
typeref = probe_field_type(field_name, config, input_document)
File "/clairvoyance/clairvoyance/oracle.py", line 342, in probe_field_type
typeref = probe_typeref(documents, "Field", config)
File "/clairvoyance/clairvoyance/oracle.py", line 329, in probe_typeref
raise Exception(f"Unable to get TypeRef for {documents} in context {context}")
Exception: Unable to get TypeRef for ['query { bedding }', 'query { bedding { lol } }'] in context Field
If I send query{bedding}
and query{bedding{lol}}
directly I get this:
Traceback (most recent call last):
File "/usr/lib/python3.7/runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "/usr/lib/python3.7/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/clairvoyance/clairvoyance/__main__.py", line 97, in <module>
wordlist, config, input_schema=input_schema, input_document=input_document
File "/clairvoyance/clairvoyance/oracle.py", line 446, in clairvoyance
typename = probe_typename(input_document, config)
File "/clairvoyance/clairvoyance/oracle.py", line 392, in probe_typename
raise Exception(f"Expected '{errors}' to match any of '{wrong_field_regexes}'.")
Exception: Expected '[{'message': "Cannot query field 'bedding' on type 'Query'.", 'code': 'GRAPHQL_VALIDATION_FAILED'}]' to match any of '['Cannot query field "imwrongfield" on type "(?P<typename>[_0-9a-zA-Z\\[\\]!]*)".', 'Field "[_0-9a-zA-Z\\[\\]!]*" must not have a selection since type "(?P<typename>[_A-Za-z\\[\\]!][_0-9a-zA-Z\\[\\]!]*)" has no subfields.', "Cannot query field 'imwrongfield' on type '(?P<typename>[_0-9a-zA-Z\\[\\]!]*)'.", "Field '[_0-9a-zA-Z\\[\\]!]*' must not have a selection since type '(?P<typename>[_A-Za-z\\[\\]!][_0-9a-zA-Z\\[\\]!]*)' has no subfields."]'.
But if I'm reading the above error correctly (which I most certainly might not), then it should be present in the wrong_field_regex array. What am I missing?
from clairvoyance.
I suppose it's again '
/ "
issue. You can add regexes with '
to https://github.com/nikitastupin/clairvoyance/blob/main/clairvoyance/oracle.py#L374-L377. It should fix the issue.
from clairvoyance.
I'm wrong. We've already fixed https://github.com/nikitastupin/clairvoyance/blob/main/clairvoyance/oracle.py#L374-L377. I think it's better to replace all "
to ["']
in regexes so we won't have "
/ '
issue again.
from clairvoyance.
In particular https://github.com/nikitastupin/clairvoyance/blob/main/clairvoyance/oracle.py#L249-L261 most likely related to the latest issue.
from clairvoyance.
Yes, I also fixed it by setting "
in the regex and it worked. Thanks.
from clairvoyance.
Related Issues (20)
- `cd.yml`: add tags to Docker Hub HOT 1
- `.github/workflows/*`: set minimal required permissions
- `cd.yml`: build Docker images for platforms other than `linux/amd64`
- json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0) HOT 3
- Infinite Loop When TypeRef References Parent TypeRef HOT 1
- Exception: Unable to get TypeRef for [] in context Field HOT 3
- Unable to use headers with docker container HOT 1
- help HOT 9
- Unknown error message HOT 3
- Wrong relative file open
- JSON Requests are not formulating correctly HOT 1
- SSL Certificate issue
- Add SECURITY.txt HOT 1
- Feature Request : `-proxy` HOT 1
- Idea: add brute-force as fallback
- client_session: <aiohttp.client.ClientSession object at 0x7f3307f050d0> HOT 1
- Impossible to Map Introspection Disabled GQL APIs for These Specific URLS (Apollo Servers Detected)
- Pacman package does not exist HOT 1
- clairvoyance error : connector: <aiohttp.connector.TCPConnector object at 0x7f373f35bdf0> HOT 2
- Processing takes way too long HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from clairvoyance.