简体   繁体   English

graphiQL 未显示 GraphQL schmea(spring graphql-spqr)

[英]graphiQL not showing GraphQL schmea (spring graphql-spqr)

I am using spring-boot with graphql-spqr.我正在使用 spring-boot 和 graphql-spqr。 GraphQL queries and mutations work. GraphQL 查询和突变工作。 But the GraphiQL webfrontend does not show the schema in the "documentatin explorer" in the rightmost column.但是 GraphiQL webfrontend 没有在最右边一列的“文档资源管理器”中显示架构。 Why?为什么?

My graphql Controller我的 graphql Controller

@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 shows the "schmea", but doesn't show anything in the documentation tab. GraphiQL 显示“schmea”,但在文档选项卡中不显示任何内容。
在此处输入图像描述

Thank you for the tips.感谢您的小费。 After some debuggin I found out, that in my Custom GraphQL Controller I directly returned the graphQL data, instead of the ExecutionResult with data: {}, errors: []经过一些调试后我发现,在我的自定义 GraphQL Controller 中,我直接返回了 graphQL 数据,而不是ExecutionResult数据:{},错误:[]

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM