How to use apollo client in components of my shopify application

arturmihno
New Member
2 0 0

I created the app using Shopify CLI and got next.js structure of pages.
I covered app.js Component with Apollo provider and it let me query from admin of shopify store on pages, next I want to make queries in Components of my next.js app but it make error like "Violation: Could not find "client" in the context or passed in as an option. Wrap the root component in an <ApolloProvider>, or pass an ApolloClient instance in via options." to fix this issue I followed the tutorial from Apollo devs https://www.apollographql.com/blog/building-a-next-js-app-with-apollo-client-slash-graphql/  but i get Error like "ApolloError: Only absolute URLs are supported" it couses as CLI builds structure where in forlder sever/handlers/client.js I got client without absolute URL check at screenshot (https://prnt.sc/xd1c6h).
I would be glad if you could help me to fix this issue and provide requests to shopify's store admin graphql server. 

0 Likes