You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've create custom templates for Types and Inputs but when I specify them in gradle, I have an error from FreeMaker that a template is not found:
My gradle task:
tasks.named<io.github.kobylynskyi.graphql.codegen.gradle.GraphQLCodegenGradleTask>("graphqlCodegen") {
graphqlSchemaPaths = listOf("$projectDir/src/main/resources/graphql/schema.graphql")
outputDir = File("$buildDir/generated")
apiPackageName = "my.graphql.api"
modelPackageName = "my.graphql.model"
// TODO: If we generate Kotlin classes, we get better builders and null-safety.
generatedLanguage = GeneratedLanguage.KOTLIN
isGenerateNoArgsConstructorOnly = true
customTemplates = mutableMapOf(
FreeMarkerTemplateType.TYPE.name to "src/main/resources/graphql/type.ftl",
FreeMarkerTemplateType.PARAMETRIZED_INPUT.name to "src/main/resources/graphql/input.ftl",
)
}
The error that I've got:
Caused by: freemarker.template.TemplateNotFoundException: Template not found for name "src/main/resources/graphql/type.ftl".
The name was interpreted by this TemplateLoader: MultiTemplateLoader(loader1 = ClassTemplateLoader(classLoader="InstrumentingVisitableURLClassLoader(ClassLoaderScopeIdentifier.Id{coreAndPlugins:settings[:]:buildSrc[:]:root-project[:](export)})", basePackagePath=""), loader2 = FileTemplateLoader(baseDir="/Users/admin/.gradle/daemon/8.1.1", canonicalBasePath="/Users/admin/.gradle/daemon/8.1.1/")).
at freemarker.template.Configuration.getTemplate(Configuration.java:2957)
at freemarker.template.Configuration.getTemplate(Configuration.java:2759)
at com.kobylynskyi.graphql.codegen.generators.FreeMarkerTemplatesRegistry.getCustomTemplates(FreeMarkerTemplatesRegistry.java:84)
And I definitely have them:
I was trying to change path from "src/main/resources/graphql/type.ftl" to "$projectDir/src/main/resources/graphql/type.ftl". But still have the same error.
What am I doing wrong?
The text was updated successfully, but these errors were encountered:
I've create custom templates for Types and Inputs but when I specify them in gradle, I have an error from FreeMaker that a template is not found:
My gradle task:
The error that I've got:
And I definitely have them:

I was trying to change path from
"src/main/resources/graphql/type.ftl"
to"$projectDir/src/main/resources/graphql/type.ftl"
. But still have the same error.What am I doing wrong?
The text was updated successfully, but these errors were encountered: