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
1
vote
0 answers

Is GraphQL-SPQR library production-ready?

I'm working on an existing REST API project and trying to migrate it to GraphQL using graphql-spqr library. Can someone please help me with whether this library is production-ready? Has anyone used spqr library in their product? Thanks in advance!
1
vote
1 answer

Cant find whats causing graphql.AssertException: Object required to be not null

I am currently learning Spring Boot and GraphQL. For graphql I am using the graphql spqr library and am encountering a graphql error. I am able to use localhost:8080/gui to make queries and mutations with my graphql api but when I use Postman or…
1
vote
2 answers

graphql-spqr with Spring Boot and Transactional Boundary

We are using graphql-spqr and graphql-spqr-spring-boot-starter for a new project (With Spring DataJPA, hibernate and so on). We have a mutation like this: @Transactional @GraphQLMutation public Match createMatch(@NotNull @Valid MatchForm matchForm)…
1
vote
1 answer

How to exclude mutations from Query root node with spqr?

I use io.leangen.graphql.spqr library version 0.9.6 and I need to exclude mutations from Query root node into the Doc. My GraphQLController.kt looks this way: @RestController class GraphQLController { private var graphQL: GraphQL? = null …
Dmytro Chasovskyi
  • 3,209
  • 4
  • 40
  • 82
1
vote
2 answers

How to pass parameters/variables to query or mutation?

I'm trying to read some parameters passed down through variables on my backend, lets see: (this method is inside AuthenticationService, injected in my graphql controller, see bellow) @GraphQLMutation(name = "getSessionToken") public AuthReturn…
lpFranz
  • 406
  • 5
  • 22
1
vote
1 answer

How to register ResolverInterceptors with SPQR and Spring

I am trying to create some authentication mechanism for my spring-boot/graphQL/SPQR-project. I managed to do it on a single service method via @GraphQLRootContext annotation: @GraphQLMutation(name = "createProblem") public Problem createProblem( …
Matthias
  • 551
  • 4
  • 11
1
vote
1 answer

Correct way to return errors in GraphQL-SPQR

At the moment, I'm throwing RuntimeException's to return GraphQL validation errors. It works surprisingly well, with the exception that it throws horrible errors with large stack traces in my logs. Here you can see I'm checking the submitted new…
sparkyspider
  • 13,195
  • 10
  • 89
  • 133
1
vote
0 answers

Using GraphQL,Springboot,MongoDB.The json is 1000+ lines deeply nested.Instead of updating whole doc,need to update specific key-value at any position

Requirement for mutation is to behave like upsert. For example in below json mutation is required to change "status" under Rooms->Availability section. Which I do not want to hard code like db.collection.update({ …
Pradeep Nooney
  • 740
  • 10
  • 12
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!…
1
vote
1 answer

File upload with SPQR Graphql

I'm using spring boot and spqr graphql library. I need to upload a file(s) via graphql. I don't know what object type to expect in the service and I'm assuming that this isn't even supported. Has anyone tried this? Any advice? Thanks.
cyberthreat
  • 179
  • 13
1
vote
1 answer

Custom Scalar Type in graphql-spqr

I graphql-spqr, java.util.Date is defined as Scalar. Is it possible to overwrite the serialization/deserialization of java.util.Date to get a different String representation of the date? The ScalarStrategy mentioned in this answer was removed with…
Patrick
  • 447
  • 8
  • 17
1
vote
1 answer

AssertValidName throws on a name presumably generated by the library itself

This is using a quite intricate entity collection which mainly consist of JPA entities, but which also include proxies and entities fetched from APIs. I've only really annotated the base class I'm trying to fetch with @GraphQLQuery annotations, but…
tofagerl
  • 95
  • 10
1
vote
1 answer

What is the recommended way to paginate using SPQR?

Building a graphQL API with SQPR. I have a large data collections and would like to load data page by page. What is the recommended way to do this with SQPR and how would it look from the client side (query)? Also, keeping in mind Apollo client for…
Gadi
  • 1,539
  • 22
  • 37
1
vote
1 answer

GraphQL SPQR extend mutation parameters of an input object

Being able to extend existing types is brilliant because it allows modularisation of the code and separation of privilege. I have found good examples as to how to extend objects outputs in query (see below), but no good way to extend what inputs a…
SDekov
  • 9,276
  • 1
  • 20
  • 50
1
vote
1 answer

How do I add a custom directive to a query resolved through a singleton

I have managed to add custom directives to the GraphQL schema but I am struggling to work out how to add a custom directive to a field definition. Any hints on the correct implementation would be very helpful. I am using GraphQL SPQR 0.9.6 to…