entry-point.graphql-api.api-queries.mustache Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of scaffold-clean-architecture Show documentation
Show all versions of scaffold-clean-architecture Show documentation
Gradle plugin to create a clean application in Java that already works, It follows our best practices!
package {{package}}.graphqlapi;
{{#lombok}}
import lombok.RequiredArgsConstructor;
{{/lombok}}
import org.springframework.graphql.data.method.annotation.Argument;
import org.springframework.graphql.data.method.annotation.QueryMapping;
import org.springframework.stereotype.Controller;
{{#reactive}}
import reactor.core.publisher.Mono;
{{/reactive}}
{{#lombok}}
@RequiredArgsConstructor
{{/lombok}}
@Controller
/**
* To interact with the API make use of Playground in the "/graphiql" path, but remember,
* Playground ONLY must be used in dev or qa environments, not in production.
*/
public class ApiQueries {
// private final MyUseCase useCase;
{{^lombok}}
//public ApiQueries(MyUseCase useCase){
// this.useCase = useCase;
//}
{{/lombok}}
{{#reactive}}
@QueryMapping
public Mono getSomething(@Argument("id") String id/* change for object request */) {
//return useCase.doAction(objRequest);
return Mono.just("Hello world from graphql-api queries " + id);
}
{{/reactive}}
{{^reactive}}
@QueryMapping
public String getSomething(@Argument("id") String id/* change for object request */) {
//return useCase.doAction(objRequest);
return "Hello world from graphql-api queries " + id;
}
{{/reactive}}
}