Getting more data than i should, PlanetScale mySQL, server component.
Answered
Siamese Crocodile posted this in #help-forum
Siamese CrocodileOP
Hello all I am calling a function in my page.tsx server component. It gets the data from an api i made. in that API it calls planetscale and should be getting filtered data.
Problem is that it is giving more data than it should.
When i call the api in https format like: https://taxonomy.vercel.app/api/planetScale
it returns the correct values. So my API is working.
But i guess something is going wrong with my server and client components.
I made a function and am calling it in the server component page.tsx and passing down the data into my client component.
So on the frontend client component it displays all the data. But my api only shows some.
I also purged my cache and tried on different browser. Even purged Nextjs Cache.
Problem is that it is giving more data than it should.
When i call the api in https format like: https://taxonomy.vercel.app/api/planetScale
it returns the correct values. So my API is working.
But i guess something is going wrong with my server and client components.
I made a function and am calling it in the server component page.tsx and passing down the data into my client component.
So on the frontend client component it displays all the data. But my api only shows some.
I also purged my cache and tried on different browser. Even purged Nextjs Cache.
Answered by Siamese Crocodile
SOLVED. I needed to update my Environment variables and i added indexes to my planetscale queries
1 Reply
Siamese CrocodileOP
SOLVED. I needed to update my Environment variables and i added indexes to my planetscale queries
Answer