Closed c0rdeiro closed 2 months ago
If there's a 404, that's coming from the server you are querying - we do not "interpret" data in any way.
Are you sure the url
you pass into your HttpLink
is reachable both from your browser and server, and even if the Next.js server is not started (e.g. during build)?
@phryneas I think so because if I do something like
const { data } = useSuspenseQuery(
GET_SENTIENCE5_HOLDER,
{
variables: {
id: 'test',
},
queryKey: ['sentience5'],
}
)
it works, so I ruled out that the HttpLink
was not the problem but something related to my variable and the way I was using skipToken
(although I followed the documentation to this argument, and why I am confused with the error)
Yeah, but again: a 404 is not caused by any code, neither in this package nor in @apollo/client
.
I'm not exactly sure where you're seeing a 404, but that would either be sendtby Next.js (if your browser ends up on a 404 error page), or by your GraphQL server (if the request comes back with a 404 error).
@phryneas it is a 404 error from GraphQL, so can I assume the error is not in my skipToken
logic?
Definitely not - it's something in how your server reacts to this specific query, so I'd look into the server.
Thanks, I'll take a look
I think this can be closed now - I hope you found the source of your problem!
Do you have any feedback for the maintainers? Please tell us by taking a one-minute survey. Your responses will help us understand Apollo Client usage and allow us to serve you better.
@apollo/client: 3.8.10 @apollo/experimental-nextjs-app-support: 0.6.0
I have a simple query that has 1 string variable that is defined only when the component is mounted
My query looks something like
and my hook looks like
I'm using skipToken to only run the query when the
address
is definedI've confirmed that the problem is not the endpoint nor the query because if instead of the variable I pass a direct string it works perfectly.
If someone knows what might be the problem here I would love the help, thank you