Questions tagged [graphql-java-tools]

GraphQL Java Tools is a library on top of that further simplifies creating and implementing a GraphQL API.

14 questions
9
votes
1 answer

Difference in usage of graphql-java vs graphql-java-tools

Im new to graphql found 2 java implementation using from official graphql: https://www.graphql-java.com/documentation/v10/ and https://github.com/graphql-java-kickstart/graphql-java-tools Like whats their difference in implementing graphql in…
Orville
  • 518
  • 7
  • 17
8
votes
2 answers

getting requested fields on resolver level from graphql

Model of book from graphql schema type Book { id: ID name: String pageCount: Int author: Author } So I am having this resolver for Book public class BookResolver implements BookByIdQueryResolver, GraphQLQueryResolver { private final…
doubleW
  • 590
  • 5
  • 17
6
votes
2 answers

Error handling with graphql-java-tools and graphql-spring-boot-starter

How to handle errors in my graphQL API? I am using graphql-java-tools and graphql-spring-boot-starter. I created error handler but every time I get response 200 even when exception was thrown. Could you tell me how I should set error code e.g 400 in…
A.Sidor
  • 257
  • 4
  • 12
6
votes
4 answers

How to upload files with graphql-java?

I can't find out how to upload files if i use graphql-java, can someone show me a demo? I will be appreciated! reference : https://github.com/graphql-java-kickstart/graphql-java-tools/issues/240 I tried it in springboot by using…
EA Ubisoft
  • 326
  • 1
  • 3
  • 9
2
votes
2 answers

How to execute Java calls to GraphQL in a Spring Boot + GraphQL Java Tools' context?

In a Spring Boot application, we're already having a fully functional GraphQL endpoint, serving .graphqls files via GraphQL Java Tools (we included the graphql-spring-boot-starter dependency) and handling the data resolution through our base Query…
maxxyme
  • 2,164
  • 5
  • 31
  • 48
2
votes
2 answers

graphql-java-tools: null parameter vs not present parameter

How can I distinguish in java graphQL if a parameter was explicitly set to null, or if it was not provided at all? The use case that I try to achieve is the following: I have a mutation like this updateUser(id:Int!, changes:UserChanges!) #where…
Alkis Mavridis
  • 1,090
  • 12
  • 28
1
vote
2 answers

Consuming graphql query in Java

I have Graphql query in this format : query { priceData { customer id title dob } } In java, we use this query in String format Like : "{\"query\":\"query {\\r\\n priceData {\\r\\n customer \\r\\n id\\r\\n …
1
vote
1 answer

graphql servlet not started with graphql-java-tools (schema files not found?)

So according to the graphql-java-kickstart/graphql-java-tools a 'graphql' endpoint should become available when the dependency 'com.graphql-java-kickstart:graphql-spring-boot-starter' is added to the project and .graphqls schema files are scanned…
d01berg
  • 76
  • 6
1
vote
1 answer

Use enum as query argument in Graphql

What is the graphql syntax in SDL to use an enum as a query argument? schema { query: Query } type Query { getWordsCountByLanguage (language: LanguageIso): [WordCount] } enum LanguageIso { AA AB } Parsing the above schema will throw…
cksrc
  • 2,062
  • 3
  • 24
  • 39
0
votes
0 answers

Sanitize Graphql input fields using INPUT_FIELD_DEFINITION directive

We use graphql-java library, and we are trying to create @trim directive for input fields, which automatically trims the input values. Can someone provide me an example how can I achieve such behavior? All examples I found are only about validation,…
Lukáš Gemela
  • 205
  • 3
  • 10
0
votes
1 answer

How can I propagate graphQL query argument to child dataFetchers using graphQL java

I am using those GraphQL Java dependencies: | +- com.graphql-java:graphql-java:jar:17.3:compile | | +- com.graphql-java:java-dataloader:jar:3.1.0:compile With this schema: schema { query: Query } type Query { users:…
0
votes
1 answer

GraphQL Java Kickstart Tools Enums causing exception - Expected enum with name 'XXX' but found none

How is a Java enum correctly registered with GraphQL when using the kickstart framework with spring? In attempting to use a GraphQL schema enum with an equivalent Java enum in a simple Java Spring application, the following exception is…
0
votes
1 answer

Disable GraphQL Introspection in graphql-java-tools

I am trying to disable GraphQL Introspection in my project and not having much luck with specific framework I am using. Some articles say it can be done in CcodeRegistry module but that is a decompiled source which is read only. Has anyone achieved…
0
votes
1 answer

Can I safely call back a GraphQLQueryResolver from a GraphQLResolver?

My question is: what is the best when implementing resolving methods? direct call of data repositories or calling back a main resolver aka one implementing GraphQLQueryResolver (provided it has appropriate methods)? in other words (see example…
maxxyme
  • 2,164
  • 5
  • 31
  • 48