第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

aiohttp-graphql AsyncioExecutor

aiohttp-graphql AsyncioExecutor

慕無忌1623718 2021-10-10 15:30:12
我從 asyncio + GraphQL 開始,但即使是最簡單的例子也無法工作:from aiohttp import webfrom aiohttp_graphql import GraphQLViewfrom graphql.execution.executors.asyncio import AsyncioExecutorfrom graphql import GraphQLSchema, GraphQLObjectType, GraphQLField, GraphQLStringasync def resolve_hello(root, info):    return 'World!'Schema = GraphQLSchema(    query=GraphQLObjectType(        name='RootQueryType',        fields={            'hello': GraphQLField(                type=GraphQLString,                resolver=resolve_hello),        },    ))app = web.Application()GraphQLView.attach(    app,    route_path='/graphql',    schema=Schema,    graphiql=True,    executor=AsyncioExecutor)if __name__ == '__main__':    web.run_app(app)安慰:$ venv/bin/python example.py======== Running on http://0.0.0.0:8080 ========(Press CTRL+C to quit)An error occurred while resolving field RootQueryType.helloTraceback (most recent call last):  File "/.../venv/lib/python3.7/site-packages/graphql/execution/executor.py", line 447, in resolve_or_error    return executor.execute(resolve_fn, source, info, **args)  File "/.../venv/lib/python3.7/site-packages/graphql/execution/executors/asyncio.py", line 69, in execute    result = fn(*args, **kwargs)TypeError: 'NoneType' object is not callableTraceback (most recent call last):  File "/.../venv/lib/python3.7/site-packages/graphql/execution/executor.py", line 447, in resolve_or_error    return executor.execute(resolve_fn, source, info, **args)  File "/.../venv/lib/python3.7/site-packages/graphql/execution/executors/asyncio.py", line 69, in execute    result = fn(*args, **kwargs)graphql.error.located_error.GraphQLLocatedError: 'NoneType' object is not callable/graphql graphiql 界面中的錯誤消息:{  "errors": [    {      "message": "wait_until_finished() missing 1 required positional argument: 'self'"    }  ]}
查看完整描述

1 回答

?
慕少森

TA貢獻2019條經(jīng)驗 獲得超9個贊

問題出在執(zhí)行程序設置中:


GraphQLView.attach(

    ...

    executor=AsyncioExecutor)

應該


GraphQLView.attach(

    ...

    executor=AsyncioExecutor())


查看完整回答
反對 回復 2021-10-10
  • 1 回答
  • 0 關注
  • 175 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網(wǎng)微信公眾號