Search code examples
javascriptreactjsreact-reduxgraphqlapollo-client

How to use useQuery in React JS class component?


I am creating an application that only allows using React JS class component. UseQuery works only with function components, and the Query tag is deprecated. How can I get the data?


Solution

  • The solution that works for me is using tag that is imported from @apollo/client/react/components. and here is where I got this information. https://www.apollographql.com/docs/react/migrating/apollo-client-3-migration/