async-graphql/docs/zh-CN/src/integrations_to_poem.md
2021-11-16 14:51:20 +08:00

459 B

Poem

请求例子

use poem::Route;
use async_graphql_poem::GraphQL;

let app = Route::new()
    .at("/ws", GraphQL::new(schema));

订阅例子

use poem::Route;
use async_graphql_poem::GraphQLSubscription;

let app = Route::new()
    .at("/ws", get(GraphQLSubscription::new(schema)));

更多例子

https://github.com/async-graphql/examples/tree/master/poem