Tag: java
-
Graphql : Get parent’s parent source – getSource() in graphql java
0 Let say I have following schema type Org { vp: Person! employees: [Person!]! } type Person { id: ID! name: String! grade: String! @auth } I have auth directive implemented in DGS as below @DgsDirective(name = "auth") public class PrincipleAuthorizationDirective implements SchemaDirectiveWiring { @Override public GraphQLFieldDefinition onField(SchemaDirectiveWiringEnvironment<GraphQLFieldDefinition> environment) { GraphQLFieldDefinition field = environment.getElement(); GraphQLFieldsContainer…
-
How to compare GraphQL query tree in java
3 My spring-boot application is generating GraphQL queries, however I want to compare that query in my test. So basically I have two strings where the first one is containing the actual value and the latter one the expected value. I want to parse that in a class or tree node so I can compare…
-
How can spring-boot application easily get data from external GraphQL service?
1 Background My spring-boot-3 application need to get data from external GraphQL API. There I can/need fetch data by 4 different queries. I want to find some generic GraphQL Client with default GraphQL exceptions handling and default response conversion to objects. Question Is there any simple way to call GraphQL API? Any dependency or client…
-
Why do trigonometric functions give a seemingly incorrect result?
12 When attempting to use a trigonometric function in my programming language, I get a seemingly wildly incorrect result. For example, sin(90) = 0.8939966636005579 But I would expect sin(90) to be 1. What is going on and what can I do to fix this? language-agnostic trigonometry Share Follow edited 1 hour ago Bergi 638k149149 gold…
-
GraphQL Client with spring boot
0 I have a spring boot GraphQL API and I want to consume it in another spring boot app using GraphQL Client. I am using spring boot version 3. when I execute mutate which works as data is added to the database, I am not able to figure out how to convert the received response…
-
Convert a comma separated string of fields to a GraphQL query syntax
-1 I have a requiremenet where I need to parse a user input comma separated string, and generate a graphql query out of it. INPUT: queryPath fieldA.fieldB, fieldA.fieldC, fieldA.fieldD.fieldE, fieldA.fieldD.fieldF, fieldA.fieldD.fieldG OUTPUT: query{ queryPath{ fieldA{ fieldB fieldC fieldD{ fieldE fieldF fieldG } } } } I’m using Java to do this, thanks in advance. EDIT:…
-
Apollo Android Client – Cannot access generated classes on classpath
4 I’ve generated the Apollo classes successfully and can see them in the build directory, however they’re not available on the classpath. Strangely the Enum that is generated is available but the classes themselves aren’t. Running the sample project provided on Apollo’s Github does work but I cant see the difference between the configurations. mcve…
-
Spring GraphQL return NULL
1 I want to create my own website in the form of a blog using Spring Boot and GraphQL API, but I don’t understand how to connect the database to GraphQL. When making a request through /graphiql, it returns NULL. I would appreciate any help and advice. I am using PHPMAdmin as database interface. Leave…
-
Spring Boot GraphQLQueryResolver won’t run, runs on test project
1 So I’m new into GraphQL and i got stuff running by manually setup a schemaparser and datafetchers. But I want to refactor and try out by implementing GraphQLQueryResolver to a class and controll my queries from there. I get it to work by making a new project, but with the same dependencies and should…
-
How to implement union in spring-graphql. I get error that I’m requesting object but its rather a ‘graphql.schema.GraohQLUnionType’
0 I wanted to create a union named Tables, that holds all the other tables and the user can request the table accordingly. I get the error: You have asked for named object type ‘Tables’, but it’s not an object type but rather a ‘graphql.schema.GraohQLUnionType’ Here is my graphql schema: type Query{ getData: [Tables] }…