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.

72 questions
7
votes
3 answers

ValidationError FieldUndefined SPQR GraphQL

I am getting the following and cant seem to find an answer. Error [ValidationError{validationErrorType=FieldUndefined, queryPath=[find_by_id], message=Validation error of type FieldUndefined: Field 'find_by_id' in type 'Query' is undefined @…
Tinus Jackson
  • 2,255
  • 1
  • 18
  • 47
5
votes
0 answers

How to access field level Graphql directive with graphql-spqr

Given a graphql Query query @my (arg:1) { foo @my (arg:2) { bar @my (arg:3) foobar @my (arg:4) } } And graphql server implementation using graphql-spqr @GraphQLType(name="foo") public class Foo{ @GraphQLQuery(name="bar") public…
Dennis C
  • 23,310
  • 12
  • 68
  • 98
4
votes
1 answer

GraphQL SPQR - How to get the list of the fields were requested by client using a query

is there a way to retrieve the list of the fields were requested in a GraphQL query by a client? Lets assume I have the following types: type Book { isbn: String title: String genre: String author: Author } type Author { …
Massimo Da Ros
  • 363
  • 2
  • 8
3
votes
2 answers

guidance on whether to use Annotation based spring boot graphql server

I am developing a new project with spring boot and graphql. I am confused on how to proceed because there are 2 ways to develop it, one is via the graphqls file and Annotation based approach. I prefer Annotation based approach but are they stable.…
3
votes
1 answer

Filtering nested fields, or mapping types to queries

Excuse the probably-basic question. I've used GraphQL SPQR to implement a fetch of a product DTO like so: @GraphQLQuery(name = "products") public Page getProducts(@GraphQLArgument(name = "count", defaultValue = "10") int count,…
S.V.
  • 967
  • 5
  • 20
3
votes
1 answer

How to get the generated scheme file .graphqls using SPQR?

I really like the way SPQR makes easy to integrate graphql with an existing system, the only thing I'd like to see is the .graphqls file so I can learn more on GraphQL Syntax. Is there a way to generate the scheme file from an existing code with…
Ruslan López
  • 4,056
  • 1
  • 19
  • 33
3
votes
1 answer

How to implement Subscriptions using Graphql SPQR?

How to implement Subscription feature of GraphQL using Graphql SPQR library?
2
votes
0 answers

How to get a schema file in graphql using spqr-spring-boot-starter?

Could anyone please help me how to get a schema file using spqr-spring-boot-starter? I looked for the solutions online and found this: How to get the generated scheme file .graphqls using SPQR? new SchemaPrinter( // Tweak the…
2
votes
0 answers

How to stop graphql-spqr-spring-boot-starter from printing logs in case of exception?

Could someone please help me on how to avoid printing stack trace in graphql in case exception happens (e.g. sending invalid id to find a record or creating a record without sending a mandatory field)? I'm using graphql-spqr-spring-boot-starter and…
2
votes
0 answers

Is it possible to create namespaces or logical groups to group queries/mutations in GraphQL?

I am using io.leangen.graphql.spqr library version 0.10.1 which is the latest version at the moment. Is it possible to make logical groups to separate queries? For example, I have the list of queries: borrowBook, lendBook bookInfo, books chooseBook,…
Dmytro Chasovskyi
  • 2,169
  • 3
  • 18
  • 44
2
votes
1 answer

How to create compile-time constant in Kotlin from enum?

I have an annotation that requires defaultValue to be compile-time constant. I take defaultValue from enum below: enum class RaceType { MARATHON, SPRINT; companion object { fun apply(type: RaceType): RaceDto { return…
2
votes
0 answers

graphql spqr Page MappingException

I try to use io.leangen.graphql.execution.relay.Page; Like this @GraphQLQuery public Page sysUsers(SysUser sysUser, @GraphQLArgument(name = "page", defaultValue = "1") int page, @GraphQLArgument(name = "size", defaultValue =…
EchoCow
  • 133
  • 4
1
vote
1 answer

GraphQL Federation: How To Consume, Not Extend

I have a service that returns Products that I can extend via GraphQL Federation in a service returning Reviews. The review service depends on the Products and this decoupling is just awesome! I also have an order service that stores (among other…
rü-
  • 1,657
  • 11
  • 29
1
vote
0 answers

GraphQL and Spring Security using @PreAuthorize?

I have a problem setting up spring security and disabling/enabling access to jwt-authenticated role-based users for graphql services. All other REST endpoints are properly protected and JWT authentication and role-based authorization are working…
Mike
  • 483
  • 1
  • 10
1
vote
1 answer

JWT Authentication graphql-spqr with spring security

I am using graphql-spqr-spring-boot-starter, version 0.0.5 in my spring boot application. @GraphQLApi & @GraphQLQuery working fine and I am fetching data on /gui as well. But as many have faced I am trying to apply the authentication part on graphql…
1
2 3 4 5