graphql-java-generator / graphql-gradle-plugin-project

graphql-gradle-plugin is a Gradle Plugin for GraphQL, based on graphql-java. It accelerates the development for both the client and the server, by generating the Java code. It allows a quicker development when in contract-first approach, by avoiding to code the boilerplate code.
https://graphql-maven-plugin-project.graphql-java-generator.com/
MIT License
54 stars 8 forks source link

`gradle generatePojo` fails w/ Spring error #10

Closed NfNitLoop closed 2 years ago

NfNitLoop commented 2 years ago

I can run:

gradle generateClient

And that completes successfully. But I might just want to use the POJOs because I can't introduce Spring as a dependency to the project I'm working on.

But, when I try to run:

gradle generatePojo

I get an error:

> Task :generatePojo FAILED Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'addRelayConnections': Unsatisfied dependency expressed through field 'documentParser'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'generateCodeDocumentParser': Unsatisfied dependency expressed through field 'configuration'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.graphql_java_generator.plugin.conf.CommonConfiguration' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}

FAILURE: Build failed with an exception.

* What went wrong: Execution failed for task ':generatePojo'. > Error creating bean with name 'addRelayConnections': Unsatisfied dependency expressed through field 'documentParser'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'generateCodeDocumentParser': Unsatisfied dependency expressed through field 'configuration'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.graphql_java_generator.plugin.conf.CommonConfiguration' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}

etienne-sf commented 2 years ago

Ok, I repeated it.

This suprises me, as there is a project that uses the generatePojo goal.

I'll try to deliver a patch this week end.

Etienne