Answers for "Uncaught TypeError: this is undefined ApolloClient ApolloClient.ts:72"

1

Uncaught TypeError: this is undefined ApolloClient ApolloClient.ts:72

const client = new ApolloClient({ //...

//you forgot to put (new in front of ApolloClent)

//=====================> here is my provide
import ApolloClient from 'apollo-client';
import { InMemoryCache } from 'apollo-cache-inmemory';
import { createHttpLink } from 'apollo-link-http';

const httpLink = createHttpLink({
  url: 'http://localhost:4000'
});

export const client = new ApolloClient({
  link: httpLink,
  cache: new InMemoryCache()
});
Posted by: Guest on April-02-2022

Code answers related to "Uncaught TypeError: this is undefined ApolloClient ApolloClient.ts:72"

Code answers related to "Javascript"

Browse Popular Code Answers by Language