and my graphql query is taken after built and run (localhost:4000)
my output stops at “loading” stage and doesn’t show “data” ???>>
# Write your query or mutation here
query{
category{
products{
id
name
inStock
gallery
description
category
attributes{
id
name
type
items{
displayValue
value
id
}
}
prices{
currency{
label
symbol
}
amount
}
brand
}
}
}
I really tried hard to figure out what’s wrong but I failed, so, please can you help me?
thanks a lot…
The docs are pretty good, you should be able to figure it out.
I assume you are following some old article/tutorial on this? I’d suggest going with function components and hooks and the latest version of the libs (and the hooks they provide).
That is unless it was specifically asked that you use class components and the older versions of the libs. If you were not, it just looks a little odd to be using the old way of doing things.
import { ApolloClient, InMemoryCache } from '@apollo/client/core';
import { Query } from '@apollo/client/react/components';
import { ApolloProvider } from '@apollo/client';
I guess, you can also downgrade the client but I didn’t test it.
Seems like an odd requirement but I guess it has to do with their code-base using class components and making sure you can work with it. Still, they might give you a starter client repo as well just so you do not have to spend all day figuring out the setup.
No problem, it wasn’t super easy to debug, but it did seem apparent after using code that should work that it had to be something other than the code.
That is also why I said they should provide a starter repo. An empty one with no code but with the correct packages and maybe a note about the versions. But I also do not know what type of conversation lead up to this test assignment.
Did you finish the project and submitted it? I just started working on this project as well. Problem is the same that they use class components. anyway, could you please tell me if it is worth the shot and i f you were selected or heard back from them?