I try to parse a date, e.g. “2022-02-02” as java.time.LocalDate. Why the values passed to the scalar class are wrapped into curly braces? And how do I fix this? I configured the scalar for java.time.LocalDate: This is the query: The error says that Text ‘StringValue{value=’2018-09-03′}’ could not be parsed at index 0. I do not really understand why this is
Tag: graphql-java
How to define Nested enum type in GraphQL schema
I have an enum defined in graphql schema as below: But the WILDCARD query, can be further specified as STARTSWITH, ENDSWITH and CONTAINS, So can we achieve something like below while defining Schema or Answer There are no such nested enums in GraphQL schema. You can consider to model it using two separate fields with separate enums . And suppose
GraphQL Input type declaration for Mutation
I’m new to GraphQL and after some coding I bumped into a problem with declaring an Input type for a Mutation. Here’s my Schema: When I run my app, I get the error Caused by: graphql.kickstart.tools.SchemaError: Expected type ‘IdInput’ to be a GraphQLInputType, but it wasn’t! Was a type only permitted for object types incorrectly used as an input type,
Get Original Field Name on GraphQL
I’m using https://github.com/leangen/graphql-spqr with spring-boot java application. I can reach to alias name easily but how can I reach to original fieldName? When I run this code, Output looks like with alias fields: “aliasNameX”, …, but I need original name like “originalName”. Is there a way to do it? Solved, according to: https://github.com/leangen/graphql-spqr/issues/381 Answer Posting my original answer here as
How to integrate GraphiQL with Spring-Boot?
My target is to build a GraphQL server on Spring with (1) GraphiQL IDE (2) dynamic GraphQL schema at run-time. My GraphQL engine is GraphQL-Java. In my first try, I use graphql-java-spring-boot-starter-webmvc and graphiql-spring-boot-starter. Both the GraphQL server and the GraphiQL work well. However, under the graphql-java-spring-boot-starter-webmvc framework, a @Bean of GraphQL class is needed. In this bean, the schema