#Apollo client with next js
16 messages · Page 1 of 1 (latest)
So basically i have a form, where user enters his information ( register info ) and the information should be queried, but i have no ideea how to do it... ( i've thinked about using server actions, but they are unstable )
const client = new ApolloClient({
uri:"http://localhost:4000/graphql",
cache:new InMemoryCache()
})
export default client```
i am using next js 13.4
Well, then you can call this in your file:
const { data } = await client.query({
query: gql`
query Countries {
countries {
code
name
emoji
}
}
`,
});
Is that what you need to know?
hi, thank you for your help, the problem is that when i create a form
and use the onclick method to send it
i can't use client.query cause it is
a server thing ig
Does it gives your some error or?
lemme try again
I would say there should be no problem with that
yep ❤️