Spring for GraphQL provides transport and an annotation model for exposing GraphQL APIs. It is supported with a dedicated Starter as of Spring Boot 2.7.0
Questions tagged [spring-graphql]
87 questions
0
votes
1 answer
Kotlin + Spring + GraphQL : 405 METHOD_NOT_ALLOWED
I am building a simple example with Spring boot + GrapQL
package com.example.graphql
import org.springframework.boot.autoconfigure.SpringBootApplication
import org.springframework.boot.runApplication
import…

JPG
- 750
- 2
- 8
- 23
0
votes
1 answer
Mutation GraphQL map an Array to java.util.Set
With spring-graphql 1.0.1, I am trying to map an array of String [String] to a SortedSet in a GraphQL Mutation but I get an error.
Property referenced in indexed property path 'names[0]' is neither an
array nor a List nor a Map; returned value was…

loonis
- 1,317
- 16
- 19
0
votes
0 answers
assert unhandled exception in Spring GraphQL
My stack is Spring Boot 3.0.0, Java 17, Spring GraphQL.
The GraphQL input model.
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor()
public class CreatePostInput {
@NotBlank
@Size(min = 5, max = 100)
private String title;
…

Hantsy
- 8,006
- 7
- 64
- 109
0
votes
1 answer
Is there a spring for graphql alternative for netflix's @DGSDataloader and DGSData
Trying to migrate a Netflix DGS GraphQL and Neo4J project to now use Spring for GraphQL and Neo4J instead. Hit a roadblock when I wanted to avoid the N+1 problem.

Tariq
- 5
- 2
0
votes
2 answers
java-graphql use namespace type resolver with inner class cant access
Using a scheme with such set
type Query {
client: ClientQuery!
}
type ClientQuery {
info(clientId: String): Client
}
type Client {
gender: String
name: String
}
i have same reoslver for it
@Controller
class ClientResource {
…

Вадим Панов
- 3
- 2
0
votes
1 answer
Java GraphQL schema dependency across modules
I have a gradle project that is divided into multiple modules. There is a shared module that defines a root GraphQL schema that I want to expose to other modules but I'm not sure how to define this dependency in other modules. Also a requirement is…

WitHeld
- 305
- 3
- 8
0
votes
1 answer
How to refactor this GraphQL endpoint to use BatchMapping instead of SchemaMapping?
I am using Spring for GraphQL to create a small microservice project which consists of 2 apps, a customer service and an order service.
My order service app is running on port 8081 and it contains an OrderData model:
public record OrderData(@Id…

bjaklic
- 49
- 5
0
votes
1 answer
Enable or disable async mode in Spring for GraphQL (WebMvc)
Using org.springframework.boot:spring-boot-starter-graphql and WebMvc, I have the following error while running the query:
Caused by: java.lang.IllegalStateException: Async support must be enabled on a servlet and for all filters involved in async…

Stephan Prat
- 33
- 6
0
votes
0 answers
GraphQL unable to find ID
I am trying to use Spring-Graph and fetching all data related to a table.
in my DB i am able to see hibernate saved the ID value but in response we are not getting value.
also If I mark ID as mandatory then i am getting error for value null
See…

Vipul Pandey
- 1,507
- 11
- 20
0
votes
1 answer
Method not allowed error for GraphQL requests with Spring
I have a Java Spring web server that I want to force to use Spring's GraphQL library over GraphQL's own Java library so that I can manage the access to individual queries/mutations.
After following a guide online on how to do that, I have the…

Darius Sas
- 11
- 4
0
votes
1 answer
Is it possible to retrieve a HandlerMethod somewhere between interceptors in spring-graphql
What I would like to achieve is getting a HandlerMethod ( a method annotated with @QueryMapping or @MutationMapping).that resides in a class annotated with @Controller .
I can achieve this in SpringBoot(for regular rest calls) by extending…

Nejc Ravnik
- 1
- 2
- 1
0
votes
1 answer
Kickstarter type dictionary equivalent in spring boot graphql starter
When using spring-boot-starter-graphql Spring is using a simple name to class mapping. E.g. for a mutation:
mutation {
addCategory(id: 6, name: "Green Fruits", products: [8, 2, 3]) {
name
products {
name
}
}
}
Spring will…

elp
- 840
- 3
- 12
- 36
0
votes
2 answers
Spring GraphQL mutation NullPointerException
I'm learning GraphQL in spring boot and I have created a mutation that saves used details in database. When I try to call the mutation from GraphiQL UI using following mutation query, it throws NullPointerException because the object I passed in…

Amit-Chavda
- 45
- 8
0
votes
1 answer
Spring GraphQL ignore auth for introspection query
I have a WebFilter that does some auth logic, write some context before calling chain.filter(exchange).
I'm using Spring GraphQL with GraphiQL enabled. I would like to skip auth for GraphiQL. As GraphiQL makes an introspection query to display the…

opuser1
- 427
- 7
- 29
0
votes
1 answer
Java List to Reactor Flux to Identity Map
I'm trying to implement some simple Spring Boot GraphQL BatchMapping.
The @BatchMapping receives a List and then calls a @Repository and transforms the result into a Map. I'm struggeling using Reactor's Flux and…

Benjamin M
- 23,599
- 32
- 121
- 201