All Downloads are FREE. Search and download functionalities are using the official Maven repository.

entry-point.graphql-api.api-queries.mustache Maven / Gradle / Ivy

Go to download

Gradle plugin to create a clean application in Java that already works, It follows our best practices!

There is a newer version: 3.17.22
Show newest version
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}}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy