简体   繁体   中英

graphiQL not showing GraphQL schmea (spring graphql-spqr)

I am using spring-boot with graphql-spqr. GraphQL queries and mutations work. But the GraphiQL webfrontend does not show the schema in the "documentatin explorer" in the rightmost column. Why?

My 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.
在此处输入图像描述

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: []

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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