我使用了spring-boot和graphql-spqr。GraphQL查询和突变起作用。但是GraphiQL does前端不会在最右栏的"documentatin explorer“中显示模式。为什么?
我的graphql控制器
@RestController
public class LiquidoGraphQLController {
private final GraphQL graphQL;
@Autowired
public LiquidoGraphQLController(
TeamsGraphQL teamsGraphQL, // my graphQL service classes
PollsGraphQL pollsGraphQL,
UserGraphQL userGraphQL
) {
// Automatically create GraphQL Schema from graphql-spqr annotations
GraphQLSchema schema = new GraphQLSchemaGenerator()
.withBasePackages("org.doogie.liquido")
.withOperationsFromSingleton(teamsGraphQL, TeamsGraphQL.class)
.withOperationsFromSingleton(pollsGraphQL, PollsGraphQL.class)
.withOperationsFromSingleton(userGraphQL, UserGraphQL.class)
.withOutputConverters()
.generate();
this.graphQL = new GraphQL.Builder(schema).build();
}
}GraphiQL会显示"schmea",但不会在documentation选项卡中显示任何内容。

发布于 2021-05-04 04:04:57
谢谢你的建议。经过一些调试,我发现在我的自定义GraphQL控制器中,我直接返回了graphQL数据,而不是带有数据的ExecutionResult:{},错误:[]
https://stackoverflow.com/questions/67364141
复制相似问题