Tag: graphql
-
How can I use debounce to avoid triggering the graphQL query on every keystroke in react?
0 I was given a new task and I have to debounce the input value to prevent a backend request on each keystroke and on the other hand CollectionsAutocomplete should have an internal useState with an input value, that is linked to the generalQuery variable. Right now I was able to add the internal useState…
-
Injected dependencies of Controller are sometimes null when using @SchemaMapping
1 The bounty expires in 5 days. Answers to this question are eligible for a +100 reputation bounty. Benoit Cuvelier wants to draw more attention to this question. I have a problem on a SpringBoot (3.2.0) application that uses GraphQL with spring-boot-starter-graphql. I have several annotated controllers that contain some @SchemaMapping, @QueryMapping and @MutationMapping. For…
-
How to handle dynamic routes, non existing pages and no existing data from GraphQL request in Astro project
-2 How do I solve the following issue in my Astro project: I can request the page content data for various pages from my GraphQL endpoint. I am using Apollo Client for this. Using the following query as an example: query Page($target: String!) { page(target: $target) { id type content { …on PageOne { id…
-
Forward compatiblity in GraphQL
4 GraphQL is well-known for its easy to maintain backward-compatibility of APIs defined with it. You’re supposed to just add new fields/types every time you need them and never remove old ones, only mark them with @deprecated directive. Thus, your server could evolve independently of its clients versions. However, I have a quite opposite problem:…
-
How to load rust struct vector data into GraphQL for query usage? OutputType error
0 After successfully creating a sample Rust+GraphQL project using async-graphql and axum and visualizing something in the playground, the time has come to actually use data for queries. I am using this for schema: let schema = Schema::build( Query, EmptyMutation, EmptySubscription ) .data(user_data) .finish(); where Query is: pub(crate) struct Query; where user_data is: pub struct…
-
Provider not found on operation “collection_query”
0 I am trying to use Doctrine with API Platform graphql in symfony application. I am using Postgres for database. I have two entities viz WallPost and WallPostLikes with OneToMany Relationship. That means one wall post will have many likes. While querying wall posts, I am also trying to retrieve all the likes for each…
-
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…
-
GraphQL Federation where two services share data of a single shared schema
0 Really like the GraphQL Federation concept, where a gateway joins the data for clients. For example, imagine a library: Service A serves books from the library with title & ISBN property. Service B serves people, with a checkedOut list of books they have checked out, by ISBN. From what I can tell, though, there is…
-
Cannot read properties of undefined (reading ‘isAuth’) in React and GraphQL application
0 I’m encountering an error when trying to create a post in my React application using a GraphQL mutation. The error message is: { "errors": [ { "message": "Cannot read properties of undefined (reading ‘isAuth’)", "status": 500 } ], "data": { "createPost": null } } This suggests that the req.isAuth property is undefined when the…
-
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…