Module containing common logic used by the GraphQL Kotlin Gradle and Maven plugins to generate the client code. This module is not intended to be consumed directly. Instead, you should rely on the functionality provided by the build plugins.
- downloadSDL
GraphQL endpoints are often public and as such many servers might disable introspection queries in production environment. Since GraphQL schema is needed to generate type safe clients, as alternative GraphQL servers might expose private endpoints (e.g. accessible only from within network, etc) that could be used to download schema in Schema Definition Language (SDL) directly. This function will attempt to download schema SDL from the specified endpoint, verify it is a valid SDL and return it to the client.
- introspectSchema
Executes introspection query against GraphQL endpoint, constructs GraphQL schema from the results and returns pretty print representation of the resulting schema.
- generateClient
Generate GraphQL Kotlin client code from the specified queries to be run against target GraphQL schema. Code is generated using square/kotlinpoet library.
- Only a single operation per GraphQL query file is supported.
- Subscriptions are currently NOT supported.