leangen / graphql-spqr-spring-boot-starter

Spring Boot 2 starter powered by GraphQL SPQR
Apache License 2.0
275 stars 68 forks source link

GraphQLSchemaGenerator to graphqls file #144

Closed marcotama closed 8 months ago

marcotama commented 8 months ago

Hello,

Thank you for this great project!

Apologies if this is not the right place to ask. I was wondering, is there a way to output the schema in .graphqls format? I would like to use the output in my front-end.

Thank you for the assistance.

kaqqao commented 8 months ago

You can use new SchemaPrinter(options).print(schema) to get it. You can of course also expose it on some URL if you so choose. I'm about to release v2.0.0, which is based on Spring GraphQL, and that has a /schema endpoint for this out of the box.

marcotama commented 8 months ago

Beautiful! I had written code to print it myself but this is much better.

Looking forward to v2!

Thank you!