Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Property 'setLink' is missing in type 'DefaultClient<InMemoryCache>' but required in type 'ApolloClient<any>'. #7309

Closed
baeharam opened this issue Nov 11, 2020 · 3 comments

Comments

@baeharam
Copy link

baeharam commented Nov 11, 2020

When I make client using ApolloClient class, there was no error, but it causes error after updating packages.

  • ApolloClient from apollo-boost (I have to use this, not from @apollo/client)
  • ApolloProvider from @apollo/client
import { ApolloProvider } from '@apollo/client';
import ApolloClient, { InMemoryCache } from 'apollo-boost';

const client = new ApolloClient<InMemoryCache>({
  uri: ...,
  cache: ...,
  request: (operation): void => {...},
});

const App = (): React.ReactElement => {
  return (
    // error is occurred at here
    <ApolloProvider client={client}>
      ...
    </ApolloProvider>
  );
}

Intended outcome:

NO ERROR

Actual outcome:

Type compatibility error!!

Property 'setLink' is missing in type 'DefaultClient<InMemoryCache>' but required in type 'ApolloClient<any>'.

How to reproduce the issue:

I think, it could be solved with above example code

Versions

  • @apollo/client : ^3.2.5
  • apollo-boost : ^0.4.9
@benjamn
Copy link
Member

benjamn commented Nov 11, 2020

@baeharam The apollo-boost package was removed in AC3, and is not intended to be used with @apollo/client.

@baeharam
Copy link
Author

@benjamn Then how can I move request property to new ApolloClient from @apollo/client? This property isn't exist in ApolloClient of @apollo/client

@baeharam
Copy link
Author

I used header property of new ApolloClient from @apollo/client.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 15, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants