stuebingerb / KGraphQL

Pure Kotlin GraphQL implementation
MIT License
4 stars 1 forks source link

feat: Export schema in SDL #90

Open stuebingerb opened 1 week ago

stuebingerb commented 1 week ago

Adds support for exporting an existing schema in the human-readable schema definition language (SDL). The Ktor feature by default provides it via GET /<endpoint>?schema.

SDL follows introspection config, so if introspection queries are disabled, export in SDL will also be disabled.

As implementations that support SDL have to provide the @deprecated directive, this also adds that directive to the built-in directives (without attempting to fix existing issues there).

Lastly, this fixes a small inconsistency with the spec by making the description of a __Type optional (and subsequently gets rid of some artificial empty string defaults).

Resolves #79

stuebingerb commented 1 week ago

First (fully working) draft of schema export in SDL for review. Documentation will be updated once the implementation is more or less stable.

stuebingerb commented 1 week ago

It might may sense to implement https://spec.graphql.org/October2021/#sec--specifiedBy as well 🤔