Questions tagged [graphql-spqr]

GraphQL SPQR is a graphql-java based library for rapid development of GraphQL servers in Java, using the code-first approach. A question tagged with graphql-spqr should be related to GraphQL SPQR, either inquiring about its usage or features, or referring to its functionality directly in the supplied code.

GraphQL SPQR is a simple-to-use library for rapid development of GraphQL APIs in Java. It takes the code-first approach to GraphQL development, where the server-side code is written first and the GraphQL schema is generated from it.

GraphQL SPQR Spring Boot Starter uses the base GraphQL SPQR library to automatically expose the chosen Spring beans, configure a web end-point and optionally set up a subscription server.

83 questions
0
votes
1 answer

Graphql Schema doku displays Input type automatically with Input

I have added leangen/graphql-spqr as described in the readme. Before we had a custom implementation of graphql types like in customtype.types.gql. After implementation, everything works fine, except the type which are called e.g. OperatorInput, are…
AlwinF
  • 1
0
votes
1 answer

Get Original Field Name on GraphQL

I'm using https://github.com/leangen/graphql-spqr with spring-boot java application. I can reach to alias name easily but how can I reach to original fieldName? class Food { @GraphQLQuery(name = "aliasNameX", description = "A food's name") …
0
votes
1 answer

Can I resolve fields that are not in the model with @GraphQLQuery

We are using graphql-spqr to generate the graphql schema from our Java backend api and model. Today to get products for example we annotate a methods that looks like that: @GraphQLQuery List allProducts() {...} We want to avoid creating a…
Denis G.
  • 86
  • 6
0
votes
1 answer

How to implement query filters and sorting using Graphql SPQR?

How to implement query filters and sorting using Graphql SPQR? I'm looking for a solution with Graphql SPQR for schema which looks something like this. schema { query: Query mutation: Mutation } enumSortOrder { ASC DESC } type…
Rajesh
  • 4,273
  • 1
  • 32
  • 33
0
votes
1 answer

TypeMappingException: Multiple methods detected for operation "opName" with different return types

Working with graphql-spqr and Spring Boot, I'm trying to run the project but I run into this: exception:org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'graphQLSchema' defined in class path resource…
Rabhi salim
  • 486
  • 5
  • 17
0
votes
1 answer

how to create fragments using Annotations of spring-spqr graphql-spqr-spring-boot-starter graphQL

using graphql-spqr-spring-boot-starter and graphql-spqr but not able to create Fragment using @GraphQLDirective, not sure if there is anyway to do it. my intension is to create Fragment through code like @Data @GraphQLFragment public class…
0
votes
1 answer

How to configure GraphQL SPQR to use Gson instead of Jackson

I noticed that GraphQL-SPQR has at least a couple properties that you can configure (e.g. graphql.spqr.gui.enabled=true). Is there a configuration for specifying to use Gson instead of Jackson for object serialization/deserialization? If there is…
drix
  • 177
  • 3
  • 9
0
votes
1 answer

How to set header variables in GraphQL-SPQR

I'm running a GraphQL API using GraphQL-SPQR and Spring Boot. At the moment, I am throwing RuntimeExceptions to return GraphQL errors. I have a customExceptionHandler that implements DataFetcherExceptionHandler that returns errors in the correct…
LostAtSea
  • 5,384
  • 1
  • 9
  • 11
0
votes
1 answer

Not wait for the parent @GraphQLContext resolver to resolve

Is it possible to not have to wait for the parent @GraphQLContext resolver to fully resolve before executing the child-resolvers? By looking at the source code I figured this might be possible by leveraging futures, something like…
William Boman
  • 2,079
  • 5
  • 26
  • 39
0
votes
2 answers

GraphQL SPQR Unable to serialize ZonedDateTime as expected

I'm on graphql-spqr-0.10.0 and using code-first approach and here is a sample type that clients can query. @GraphQLType(name = "Activity", description = "Some activity") public class SomeActivity { @GraphQLQuery(description = "Unique id") …
opuser1
  • 427
  • 7
  • 29
0
votes
1 answer

Can I access graphql-context from a spring bean?

We are using spqr graphQl with Spring. It works great and simplifies a lot, thanks for that! Right now we are using a ResolverInterceptor for authorization: A JWT-Token is read from DefaultGlobalContext and validated. We are also able to determine…
Matthias
  • 551
  • 4
  • 11
0
votes
1 answer

Model NaN in a Double value in graphql-spqr

There is no standard to represent NaN and INFINITY in neither the Graphql and also in JSON. In JavaScript, JSON.stringify(0/0) and JSON.stringify(1/0) will just return string null. It cause little trouble when I am providing GraphQL endpoint with…
Dennis C
  • 24,511
  • 12
  • 71
  • 99
0
votes
1 answer

Relay pagination using graphql-spqr, java and mongo

How can we create a paginated query using graphql spqr, java, mongo? Below is how query would look like: allUsers(first : int, last :int, after : String, before: String)
0
votes
2 answers

Graphql SPQR customize object serialization / deserialization

I have the following data model with custom attributes: class Foo { private Long id; private Set attributes; } class AdditionalAttribute { private Key key; private String value; } …
kelmouna
  • 11
  • 4
0
votes
2 answers

How to set Cookie from server side api in graphql mutation in spring boot?

I tried developing a server side API. I am using GraphQL and want to set a cookie from the server side, but when i try to set the cookie using HttpServletResponse it gives me a NullPointerException? Here is my Response View class: package…