Skip to content

How can I refer a local file schema instead of introspection and SDL endpoint usage when using the gradle plugin? #905

Answered by dariuszkuc
xetra11 asked this question in Q&A
Discussion options

You must be logged in to vote

graphql extension will apply introspection/sdl task to obtain the schema and use the resulting schema as an input to generate the client. It is not possible to use the extension to run just client generation. See documentation.

Instead you will need to configure the corresponding task directly, e.g.

val graphqlGenerateClient by tasks.getting(GraphQLGenerateClientTask::class) {
  packageName.set("com.example.generated")
  schemaFile.set(file("path/to/your/schema/file")
}

You can then invoke the corresponding task directly (it will also automatically add itself as a dependency of compileKotlin task)

./gradlew graphqlGenerateClient

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by dariuszkuc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #905 on October 17, 2020 04:25.