graphql-spqr

How to get the generated scheme file .graphqls using SPQR?

怎甘沉沦 提交于 2021-01-19 06:19:11
问题 I really like the way SPQR makes easy to integrate graphql with an existing system, the only thing I'd like to see is the .graphqls file so I can learn more on GraphQL Syntax. Is there a way to generate the scheme file from an existing code with SPQR annotations integrated? To provide some code let's use the same code from the GitHub site Entity: public class User { private String name; private Integer id; private Date registrationDate; @GraphQLQuery(name = "name", description = "A person's

how to Disable Schema Introspection in graphql-spqr-spring-boot-starter

自闭症网瘾萝莉.ら 提交于 2021-01-05 07:40:31
问题 I have integrated my spring boot application with graphql-spqr-spring-boot-starter https://github.com/leangen/graphql-spqr-spring-boot-starter , I need to find a way on how to disable graphql schema introspection since its a security issue for production. 回答1: I am using graphql-spqr 0.9.9 and graphql-spqr-spring-boot-starter 0.0.4, but the code base changed for graphql-spqr 0.10. I'll try to cover both cases, but keep in mind you might have to tweak the code snippets a bit. In Graphql-spqr

how to Disable Schema Introspection in graphql-spqr-spring-boot-starter

帅比萌擦擦* 提交于 2021-01-05 07:39:09
问题 I have integrated my spring boot application with graphql-spqr-spring-boot-starter https://github.com/leangen/graphql-spqr-spring-boot-starter , I need to find a way on how to disable graphql schema introspection since its a security issue for production. 回答1: I am using graphql-spqr 0.9.9 and graphql-spqr-spring-boot-starter 0.0.4, but the code base changed for graphql-spqr 0.10. I'll try to cover both cases, but keep in mind you might have to tweak the code snippets a bit. In Graphql-spqr

Access to protected field of parent object through child object via a query schema

冷暖自知 提交于 2019-12-11 17:05:13
问题 I am using graphql-spqr So that I don't have to create schema.graphql files. I have a base class in which most of my other classes inherit from. For example @GraphQLInterface(name = "BaseResponse", implementationAutoDiscovery = true) @ToString @Data public class BaseResponse { @JsonInclude(Include.NON_NULL) protected String responseCode; @JsonInclude(Include.NON_NULL) protected String responseDescription; protected String hash; } Other classes inherit from the above base class as below

How to register ResolverInterceptors with SPQR and Spring

巧了我就是萌 提交于 2019-12-08 07:26:35
问题 I am trying to create some authentication mechanism for my spring-boot/graphQL/SPQR-project. I managed to do it on a single service method via @GraphQLRootContext annotation: @GraphQLMutation(name = "createProblem") public Problem createProblem( @GraphQLRootContext DefaultGlobalContext<Object> context, @GraphQLArgument(name = "problemInput") @Valid Problem problemInput) { WebRequest request = (WebRequest) context.getNativeRequest(); String token = request.getHeader("token"); } here I can