Skip to content

[schema generator] Where is the schema returning from toSchema() supposed to go? (Spring GraphQL) #1596

@ivargj

Description

@ivargj

Hi! I am trying to use the schema generator to replace manually maintaining the schema file in our existing Spring Boot GraphQL module.
Looking at the generator documentation, it describes how to use the toSchema() function to generate the schema, but I can't find any documentation or example code on how to configure my spring graphql application to use that schema.

I have tested the schema generation itself through debugging the code, and it seems to succeed in generating the schema. I just don't know how to get the GraphQL instance to pick it up.

One of my thoughts was to use the GraphQLSource builder to customize the schema. But as of now I only get a MissingSchemaException when trying that.

I could probably solve this by rebuilding a graphql server based on the graphql-kotlin-spring-server here, but as I only need the schema generation functionality, I was hoping it was possible to simply use my existing code with the schema generator on top.

Appreciate any help!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions