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
UnsatisfiedDependencyException for org.springframework.graphql.test.tester.GraphQlTester
Getting below exception when I am executing the testcase given in below code for spring boot weblfux project using spring-graphql :-
Please let me know what is the issue. This project is using spring boot webflux and spring graphql.
Error…

C P
- 1
0
votes
0 answers
Spring GraphQL Pagination - Scroll query needs to have a ScrollPosition parameter
I am trying to introduce pagination in Spring GraphQL with ReactiveMongoRepository
Controller:
@QueryMapping
Flux> orders(ScrollSubrange subrange) {
return this.orderRepository.findAllBy(subrange);
}
Repository:
public interface…

Ravi Bhushan
- 39
- 3
0
votes
0 answers
Spring Boot Graphql: How can I pre-process an individual query/mutation before it runs the controller method?
I want to add an annotation to my controller methods that is used to check if the user can perform an action or access a piece of data before the controller method is called.
I want to be able to check each individual query/mutation, rather than…

Mar
- 7,765
- 9
- 48
- 82
0
votes
0 answers
How to customize the Spring GraphQL Error Response
I am developing a project wherein I'm using GraphQL.
The way GraphQL handles errors is not secure as it exposes the application logic and internals.
Default GraphQL error response looks like this:
{
"errors": [
{
// message in my case…

Itachi
- 1
- 2
0
votes
0 answers
Spring GraphQl : access the parent argument in @SchemaMapping
I have below graphQL with year as an input to the query.
type Query {
getResult(year:Int):Parent
}
type Parent {
child: Int
}
Can refer to the same argument in child?
I tried with @Argument, it worked for getResult method, but gave null…

was_777
- 599
- 1
- 9
- 28
0
votes
0 answers
How to generate and expose part of a GraphQL schema that's generated from a OpenSpec API in Springboot?
I currently have a Springboot microservice which has a OpenSpec API. I would like to expose a GraphQL API next to it using Spring for GraphQL, but I do not want to write out the schema myself since properties are already available through…

Daniell
- 1
- 2
0
votes
0 answers
Is there a Spring Data REST equivalent for GraphQL schemas?
Is there an equivalent to Spring Data REST for GraphQL?
More specifically a library that automatically generates GraphQL schemas and query-, schema- and batch-mappings based on a noSQL schema in the database.
Similar to…
0
votes
1 answer
Why this mutation GraphQL query does not pass data through?
I have the Mutation below and I'd like to test it with the script below, but I don't know what is the problem with it.
I already checked the documentation, at least 10 tutorials and according to those it should work, but it doesn't:
when remove the…

AndrasCsanyi
- 3,943
- 8
- 45
- 77
0
votes
1 answer
clear spring for GraphQLContext content after request finished
I am using spring boot 3.1.1 to develop GraphQL application, also included spring-boot-starter-graphql, code as below, I want to delete all content from context after the request is done, how can I implement it? Beside GraphQLContext, is there any…

george jiang
- 105
- 9
0
votes
0 answers
Set up Apollo-Router with TLS
I'm having some issues by setting up apollo-router 1.9.0 to work with TLS.
I tried to configure apollo-router using these configs:
tls:
subgraph:
subgraphs:
spring-graphql-service:
certificate_authorities:…

svx10
- 1
0
votes
1 answer
How to access all directives on selected fields of a query, with GraphQL Spring Boot?
I have an authentication directive, used to restrict fields to certain authentication levels
directive @auth(role: [String!]!) on FIELD_DEFINITION
For example, with the following schema
type Query {
test: TestResultType! @auth(role: ["USER",…

GeekOverdose
- 325
- 2
- 10
0
votes
1 answer
Issues while adding Spring for GraphQL to an existing Spring 3 project
I am trying to implement Spring for GraphQL in a existing Springboot 3 project. I have followed the steps in the beginners guide, however when I try to run the application, I get several errors. Part of the pom:
…
user22143675
0
votes
0 answers
Can't throw exception in the graphql @BatchMapping
I'm using Spring with graphql and have the following code:
@QueryMapping
public Client clientById(Long id) {
return dao.findById(id).orElse(null);
}
@BatchMapping(typeName = "Client")
public List> legalEntity(List…

Stanislau Listratsenka
- 522
- 4
- 14
0
votes
1 answer
Advice on extending DefaultServerRequestObservationConvention with request body data?
Currently, with Spring Boot, all http requests are instrumented through Micrometer (https://docs.spring.io/spring-framework/reference/integration/observability.html). However, for GraphQL requests, the contextual name is the following: http post…

princekc
- 1
0
votes
0 answers
Scalar Type Json is not working when we are using type "Input" for Mutation
Scenario:
When I have a scenario where I need to send one attribute with key value pair data to a graphql server, I use the Scalar type as Json in the setup and declare the same thing in the graphql schema.
However, during testing, I discovered that…

GRajaMca
- 82
- 1
- 9