Tag: javascript
-
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…
-
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…
-
How to eliminate mirroring the records?
0 I’ve got GraphQl code like this : const queryGraphQL = { query: `query { products(searchInput: { parameters: [{ id: 915 values:[4095,4170] } ] }, settingsInput: {limit:35 }) { products { producer{ link name id } awardedParameters { id name values { name link } } } } }`, } const fetchData = async ()…
-
Circular modules: Expected {} to be a GraphQL type
0 I came across this issue called module cycles when requiring modules. Im working on a small star wars graphql api and ill explain in short where i got the issue : I have two type : filmType and charecterType: film.js: const axios = require("axios"); const { GraphQLObjectType, GraphQLString, GraphQLInt, GraphQLList, } = require("graphql"); const…
-
Is there a more efficient way to call multiple apis using graphql and react
0 I am using GraphQL and react on my client side project but I am not using a state management system like Redux I have organised my api calls into custom hook files like below const [getSomeData, { data: getSomeDataData, loading: getSomeDataLoading, error: getSomeDataError }] = useLazyQuery( GET_SOME_DATA2, { client: dataClient, fetchPolicy: "cache-and-network", nextFetchPolicy: "cache-first",…
-
415 status code from from simple graphql-http setup
0 I was scanning over the graphql docs to find express-graphql deprecated so I decided to implement the recommended graphql-html version: this is my server.js: import { createHandler } from "graphql-http/lib/use/express"; import { buildSchema } from "graphql"; import http from "http"; import fs from "fs"; import path from "path"; const __filename = new URL(import.meta.url).pathname; const…
-
Problem loading external scripts like jQuery
11 I’m facing a problem since this morning with webapps deployed with Apps Script that used to works fine previously. Of course no changes has been made to justify this problem. External scripts are not loaded from the HTML side, and a new error arise in the console. In order to have a reproducible example:…
-
Prisma throws an error “TypeError: cannot read property findmany of undefined”
5 I wanted to make a chat app to practice working with graphql and node, for database I used prisma. I was doing everything like in this tutorial. https://www.howtographql.com/graphql-js/0-introduction/ I just changed variable names. so I have this code const { PrismaClient } = require(‘@prisma/client’) const prisma = new PrismaClient() const resolvers = { Query:…
-
axios error code 499 for chrome extension
0 i’m using axios to send some queries to leetcode to access their graphql API. I’m using a chrome extension that reads the necessary cookie credentials so that i can use it as auth for the API. however, I’m getting Request failed with status code 499 errors as a response. my query and cookies work…
-
Variables of required type not provided despited their validity
2 I’m getting a GraphQL error I can’t seem to pinpoint the source of. Variable “$title” of required type “String!” was not provided. Variable “$body” of required type “String!” was not provided. Variable “$price” of required type “Int!” was not provided. The error message is simple. There are three required variables for this mutation and…