Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/290.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 无法解析石墨烯中带下划线的字段名_Python_Graphql_Graphene Python - Fatal编程技术网

Python 无法解析石墨烯中带下划线的字段名

Python 无法解析石墨烯中带下划线的字段名,python,graphql,graphene-python,Python,Graphql,Graphene Python,我研究了Python的石墨烯,它成功了。这是密码- from graphene import ObjectType, String, Schema class Query(ObjectType): hello = String(name=String(default_value="stranger")) def resolve_hello(root, info, name): return f'Hello {name}!' schema = Schema

我研究了Python的石墨烯,它成功了。这是密码-

from graphene import ObjectType, String, Schema


class Query(ObjectType):
    hello = String(name=String(default_value="stranger"))

    def resolve_hello(root, info, name):
        return f'Hello {name}!'


schema = Schema(query=Query)

query = '{ hello(name: "GraphQL") }'

result = schema.execute(query)

print(result.data['hello'])    # "Hello GraphQL!"
但是,在将
hello
更改为
某些字段
,并将
解析hello
更改为
解析某些字段
,并进行
查询='{some字段(名称:“GraphQL”}'
,我得到的最终结果是


有没有办法处理包含下划线的字段?

我不知道幕后的石墨烯是如何将蛇壳转换成骆驼壳的

模式定义中的一切都很完美,但我将其称为客户机的方式需要改变

因此,不是:

query='{some_字段(名称:“GraphQL”}'

…我需要做:

query='{someField(名称:“GraphQL”}'

…因为客户端JavaScript更喜欢这样称呼它