Questions tagged [graphql-spring-boot]

15 questions
6
votes
1 answer

GraphQL Federation : Is there a Java Springboot gateway

Is there a GraphQL federation gateway in Java / SpringBoot. Couldn't find any implementations in java. Saw few example with federated graph but the gateway was on native node . Checked both Apollo and netflix DGS…
4
votes
1 answer

Why does graphql java query all fields in entity when I only ask for a few?

I created a basic graphql-java app with the spring boot starter and using the graphql spqr library against an MSSQL database utilizing Hibernate and Jpa. I have an entity called "Task" with 5 fields. I have a simple Jpa repository and a simple Jpa…
J-man
  • 1,743
  • 3
  • 26
  • 50
3
votes
1 answer

GraphQL Caused by: graphql.AssertException: you must provide a data fetcher. How to stub data fetcher here?

I am trying to write JUnit test for GraphQl with Spring Boot. My test fails at the below method. I am getting AsserException at treeWiring.abcFetcher. (Caused by: graphql.AssertException: you must provide a data fetcher). PLease help me how to mock…
anonymous
  • 31
  • 1
2
votes
1 answer

Spring Graphql - How to use a custom DataFetcherExceptionHandler and override the default one?

I'm new to spring graphql and I was trying to implement my own DataFetcherExceptionHandler so I can wrap all exceptions with my custom one. I've implemented my custom class that implements DataFetcherExceptionHandler but it seems like it still uses…
2
votes
2 answers

Building a Relay GraphQL server with graphql-java

We're using graphql-java to build a graphql server and having trouble conforming to the Relay spec. According to the Relay spec, all nodes must be retrievable via a single query: node(id: ID). The graphql-java docs show support for Relay's node…
2
votes
1 answer

graphql Validation error of type FieldsConflict coming when alias is not used

I am getting the error "Validation error of type FieldsConflict" when i am not using aliases in my request. kindly confirm if this is expected or if there is a workaround { person(search: [{firstname: "DAN", lastname: "WATLER", country:…
1
vote
0 answers

GraphQL java - using SourceLocations to extract the field from a ValidationError

Supposing I have a simple GraphQL schema: type Query { test(requestId: String!): String } and I execute a query like this (intentionally passing a Number instead of a String as 'requestId' value): query { test(requestId: 5) } Then I have a Java…
Roberto Manfreda
  • 2,345
  • 3
  • 25
  • 39
1
vote
0 answers

Springboot Kickstart GraphQL - Metrics for number of requests per resolver

I am currently trying in SpringBoot GraphQL kickstart to track the number of times each resolver method is called. To be more specific, I want to exactly how many times the methods of my GraphQLResolver are called. This would have two…
Sunny Pelletier
  • 329
  • 2
  • 13
1
vote
1 answer

GraphQLTestTemplate not getting autowired

I am using GraphQLTestTemplate to mock responses for queries. @RunWith(SpringRunner.class) @GraphQLTest public class UnitTest { @Autowired private GraphQLTestTemplate graphQlTestTemplate ; } When i run unit test it is giving me error :…
vinit_tiwari
  • 228
  • 3
  • 11
1
vote
1 answer

How can I produce a graphql schema for federation with java?

My group is planning to use Apollo Gateway for federation. Therefore, we need to produce our schemas a little bit differently. Can we produce something like this with using your amazing lib? extend type User @key(fields: "id") { id: ID!…
0
votes
1 answer

Import graphql schema from parent module in spring boot

I am trying to import my schema definition files from a parent module which is imported in maven. The schema files exist under resources in my parent jar file, is there a way to import those schema files in my child project? I can copy the files…
0
votes
1 answer

Springboot GraphQL: Bad Get Request : path was not schema '/json'

I have a springboot application exposed as a graphql API. When I fire a call from postman, I see 400 error in the output. At the same time, I also see the following error in the STS console HttpRequestHandlerImpl [{<>}]: Bad GET request: path was…
Ram
  • 327
  • 1
  • 4
  • 18
0
votes
0 answers

Saving compressed base64 string in local database is a good practise?

I'm making an app with react native and spring boot for backend, what is the best way to save images? Is it fine to get compressed base64 string from image crop picker and save it in the database? I test it and it works. I chose 10 MB image and when…
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
0 answers

how to map object that extends collections?

I'm using graphql-java. My problem is: I have an object that extends LinkedHashMap and I do not know how to map it to my schema. Can someone help me? I'm using graphql-java-tools and graphql-spring-boot CODE: public class XPTO extends…