Questions tagged [graphql-java]

graphql-java is a Java implementation for GraphQL, a query language created by Facebook for describing data requirements on complex application data models.

Useful links

Java Implementations:

596 questions
52
votes
6 answers

How to expose graphql field with different name

I am exploring GraphQL and would like to know if there is any way of renaming the response field for example i have a POJO with these field class POJO { Long id; String name; } GraphQL query: type POJO { id: Long name: String } My response…
Amit Kumar
  • 825
  • 1
  • 9
  • 19
35
votes
1 answer

Validation error of type SubSelectionRequired: Sub selection required for type null of field

I am working on a graphql issue where I am getting following error for the request { customer(id: "5ed6092b-6924-4d31-92d0-b77d4d777b47") { id firstName lastName carsInterested } } "message": "Validation error of type…
BrownTownCoder
  • 1,312
  • 5
  • 19
  • 25
20
votes
4 answers

Return HashMap from GraphQL-Java

I tried few variant and had no luck to return a map in GraphQL. So I have the following two objects: public class Customer { private String name, age; // getters & setters } public class Person { private String type; private…
Simple-Solution
  • 4,209
  • 12
  • 47
  • 66
19
votes
3 answers

Sending GraphQl query in java

I am new to GraphQL. I know it is very basic question. But tried spending lot of time and i couldn't make it. My requirement is i need to send GraphQL query by using graphql-java api methods from a java class. Here is the query: { …
HemaSundar
  • 1,263
  • 3
  • 17
  • 28
18
votes
7 answers

LazyInitializationException with graphql-spring

I am currently in the middle of migrating my REST-Server to GraphQL (at least partly). Most of the work is done, but i stumbled upon this problem which i seem to be unable to solve: OneToMany relationships in a graphql query, with FetchType.LAZY. I…
puelo
  • 5,464
  • 2
  • 34
  • 62
15
votes
2 answers

authentication in spring boot using graphql

I’m working on a spring boot project with GraphQL. I'm using graphql-java-tools and graphql-spring-boot-starter. I managed to configure security and session management with spring security as you can see in the java config files below. Now the…
15
votes
2 answers

Why is DataFetcher not called in this GraphQL setup?

I want to write a piece of code, which will handle GraphQL queries like these: query { group(id: "com.graphql-java") name(name: "graphql-java") version(id: "2.3.0") } I've created a data fetcher and put a breakpoint inside the…
Glory to Russia
  • 17,289
  • 56
  • 182
  • 325
11
votes
2 answers

Make a POST call to GraphQL API programmatically using Java

I have to send a query with some headers and graphQL variables as a POST call to a GraphQL API in java. I also have to send some headers and authentication parameters in the query. Right now, I am doing a manual call in POSTMAN, but I want to do…
Sai Krishna
  • 593
  • 1
  • 8
  • 25
11
votes
1 answer

Should I write two times each objects as 'input' and 'type' in a graphql schema file

I have to use a Java object in GraphQL in response as well as in request. Should I have to write two times each objects as 'input' and 'type' in a GraphQL schema file? For getting that object in request as well as in response. Should I define the…
Pranav
  • 115
  • 1
  • 6
11
votes
1 answer

GraphQL: How to implement pagination with graphQL-java?

Currently, I see no existing support for pagination in the graphql-java library. It does have some basic relay support, where-in, we can create a connection, Facebook's recommended way of implementing pagination. This is the method which helps…
sbrk
  • 1,338
  • 1
  • 17
  • 25
11
votes
3 answers

graphql-java - How to use subscriptions with spring boot?

In a project I use graphql-java and spring boot with a postgreSQL Database. Now I would like to use the subscription feature published in version 3.0.0. Unfortunately, the information about the application of the subsciption function is not very…
muetzerich
  • 5,600
  • 7
  • 37
  • 52
10
votes
2 answers

Difference between Datafetchers and Resolvers

I am planning to implement Graphql in my spring boot application. I Googled many sites for Graphql server setup in Java and came across two ways of doing it . One is implementing GraphQlResolver like below public class MyResolver implements…
Sam
  • 163
  • 1
  • 11
10
votes
1 answer

GraphQL and Spring Boot 2.0.3

I want to test GraphQL in a project that also uses Spring Boot, Spring Security; and I hope to use the latest [as of writing] Spring Boot 2.0.3.RELEASE. As described in more detail below, I found that an older version of GraphQL along with an older…
Jonas Wolff
  • 203
  • 1
  • 4
  • 11
10
votes
2 answers

Custom Scalar in Graphql-java

We are planning use Graphql as backend server in our application. We choose Graphql-Java to develop our POC. We came across a stituation to create our own scalartype to handle java.util.Map object type. we havent found any documentation regarding…
KrishnaFJ
  • 155
  • 1
  • 2
  • 8
10
votes
4 answers

No qualifying bean of type 'javax.persistence.EntityManager' available: expected single matching bean but found 2

I have two entity manager configurations for two separate databases but when I try to auto-wire an entity manager in to configure my GraphQLExecutor bean I get an exception stating that there are two beans that match the criteria even though I've…
MJPearsall
  • 175
  • 1
  • 3
  • 9
1
2 3
39 40