All Questions
Tagged with react-query node.js
18
questions
0
votes
2
answers
1k
views
Why it shows error here? Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions
Unexpected Application Error!
Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call....
2
votes
3
answers
5k
views
Uncaught runtime error when running @tanstack/react-query
I am using React.js to run a simple React Query code but I am facing an error.
The code:
import { useQuery } from '@tanstack/react-query';
import Axios from "axios"
export const Home = () =&...
0
votes
0
answers
17
views
Sequence of dependent axios requests in react-query mutate functions [duplicate]
I have a usecase to allow a user to edit data, stored in two database tables, from one Formik form. All the below is therefore triggered via one press of a form submit button.
My edit functions ...
0
votes
1
answer
41
views
I have a data list in data.data, while using React fetch I use setEducation(data.data). How can I use it in React Query?
//try to setEducation(data.data) using React Query//
const { data, isLoading, refetch } = useQuery(['available', user?.email], () => fetch(`http://localhost:5000/education/${user?.email}`)
...
2
votes
1
answer
2k
views
Filtering with React-Query + Prisma - How to pass down filters dynamically & and completely omit them from my prisma call, when they aren't present?
Say I have a filter on my frontend. I have an option to get all the users who are blue or all the users who are red. In the front-end, I pass that filter value into react-query and in the backend I ...
3
votes
2
answers
4k
views
How do I wait for next-auth session before using useQuery()?
I have a NextJS project that uses NextAuth for session management and then React Query to retrieve data on the front-end.
However, with the current format (as seen below), useSession() will return ...
2
votes
1
answer
2k
views
TRPC doesn't react to config / variables passed (e.g.: enabled : false)
New to trpc and am trying to understand how to use useQuery (which I am familiar with from react-query):
const IndexPage = () => {
const { isLoading, data, isIdle } = trpc.useQuery([
"...
1
vote
2
answers
1k
views
React reactquery and formik initialvalues async problem
const {productid} = useParams()
const {isLoading,isErr,data,err} =useQuery([`Admin`,productid],() => fetchProduct(productid))
const formik = useFormik({
initialValues: {title:data?.title,...
0
votes
2
answers
357
views
Mapping over values from Strapi when used with React-Query
I have used React-Query many times, but when I return an API call from Strapi, I receive the error:
TypeError: Cannot read properties of undefined (reading 'map')
It's basically a simple function call ...
2
votes
1
answer
1k
views
data property in useQuery() hook returns Cannot read properties of undefined
This is an extremely perplexing issue. The code below gives this error:
TypeError: Cannot read properties of undefined (reading 'map')
When console.log() is used to look at res.data it is fine, it ...
1
vote
0
answers
830
views
Returning products from useQuery() using react-query
I have an api that is returning a list of products. I am using the react-query package to fetch the data and then return a map that in turn renders out each product with helper component. Can't seem ...
2
votes
2
answers
4k
views
React-query returns Cannot read properties of undefined even though I can see id is set
I am trying to learn react-query and been following quite a few guides. However everytime I try with parameters something goes wrong.
This code that I have under just keep telling me that Cannot read ...
1
vote
1
answer
2k
views
React-query mutation dosent refresh
I have another fetch of "SpecificList in another component, but when posts excutes it dosent refetch it only refetches on rewindowfocus? What could the reason be?
const { mutate,isLoading:...
0
votes
1
answer
747
views
How to search keyword into api with React Query
How can I use the "keyword" from the params into my axios get request?
My Approach is not working,
// Front End Code
const ComprasLista = () => {
const { keyword } = useParams();
...
0
votes
1
answer
182
views
Is It possible to use a React Awesome Builder (js) with MySQL?
I have to access a MySQL database, I have been told to use a query builder to create a query to create a fresh list of filtered data. So, it looks like I can use SQL to filter the data, but I'm not ...