Open 4ekin opened 2 years ago
Seems it fails on generating this arg:
{
"defaultValue": "{performSynchronously: true}",
"description": null,
"name": "performanceControl",
"type": {
"kind": "INPUT_OBJECT",
"name": "PerformSynchronously",
"ofType": null
}
},
with type:
{
"description": null,
"enumValues": null,
"fields": null,
"inputFields": [
{
"defaultValue": "true",
"description": null,
"name": "performSynchronously",
"type": {
"kind": "SCALAR",
"name": "Boolean",
"ofType": null
}
}
],
"interfaces": null,
"kind": "INPUT_OBJECT",
"name": "PerformSynchronously",
"possibleTypes": null
},
could you share a reproducible example? Other than that, it seems that newer version of graphql-core may be an issue, could you check which version are you using? See #186
could you share a reproducible example? Other than that, it seems that newer version of graphql-core may be an issue, could you check which version are you using? See #186
Sorry for long answer Version of graphql-core is 3.1.6
$python3 -m pipenv run pip freeze
certifi==2021.10.8
charset-normalizer==2.0.8
ecdsa==0.17.0
graphql-core==3.1.6
idna==3.3
pyasn1==0.4.8
python-jose==3.3.0
python-keycloak==0.26.1
requests==2.26.0
rsa==4.8
sgqlc==14.1
six==1.16.0
urllib3==1.26.7
I've tried do all my best for minimal reproducible example min_api_schema.txt
If I remove arg on 111 line (PerformSynchronously) it successfully generates classes.
@4ekin is it still happening with the latest releases?
@4ekin is it still happening with the latest releases?
Hi, sorry for long answer Actually yes But I dont know is it problem on your side
Well, graphql-core doc for class Visitor says that if you want to stop visiting you should use BREAK value https://github.com/graphql-python/graphql-core/blob/main/src/graphql/language/visitor.py#L82
But when their implementation of visit
func leave from node, it checks BREAK and True values.
Your Visitor implemetation returns bool value for BooleanNode, and in my case during parsing
"defaultValue": "{performSynchronously: true}",
it returns True, and graphql-core visit func decide to BREAK visiting, and your Visitor callback https://github.com/profusion/sgqlc/blob/master/sgqlc/codegen/schema.py#L52 does not work.
If I change https://github.com/graphql-python/graphql-core/blob/main/src/graphql/language/visitor.py#L263 to
if result is BREAK:
for me it works ideal.
What do you think about it @barbieri , is it core bug?
Hello! Great lib, really great, thank you for your work!
Eventually I wanted to update my api adapter and during codegen operation it fails
Version from Pipfile.lock -
Can you help me?