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

Apollo version and hooks #356

Open
steinitz opened this issue Mar 30, 2021 · 2 comments
Open

Apollo version and hooks #356

steinitz opened this issue Mar 30, 2021 · 2 comments

Comments

@steinitz
Copy link

Hi,

Thanks again for sharing Pup. It's awesome and continues to stands alone in providing this breadth of full-stack superpowers. I was pleased to discover that you intend to continue work on Pup, including an upgrade to Meteor 2. Bravo.

On the topic of upgrades, I'm in the middle of upgrading Apollo, in Pup, to allow use of the useMutation hook and its friends. I'm stuck in module hell and a bit overwhelmed.

I'd enjoy hearing from anyone who has gone down this Apollo upgrade path or has an interest in it.

@cleverbeagle
Copy link
Owner

@steinitz can you share more details about what errors you're running into?

@steinitz
Copy link
Author

steinitz commented Mar 30, 2021

Thanks for your reply @cleverbeagle

I was able to solve the build and runtime issues - the app works again. I haven't yet replaced the Mutation component with useMutation but I now have recent Apollo libs. Here they are:

"@apollo/client": "^3.3.13",
"@apollo/react-components": "^4.0.0",
"apollo-cache-inmemory": "^1.6.6",
"apollo-link": "^1.2.14",
"apollo-link-error": "^1.1.13",
"apollo-link-http": "^1.5.17",
"apollo-server-express": "^2.22.2",

notes:
I was able to remove react-apollo and others
I didn't manually set versions
I haven't confirmed they're all required

The conversion required a couple dozen minor changes to imports. Here are some highlights:

  • change apollo/client to @apollo/client

Importing compose and graphql is now done so:

import {graphql} from '@apollo/client/react/hoc';
import {flowRight as compose} from 'lodash'; // apollo no longer keeps a copy of flowRight named compose

Here are some other changed imports:

import { renderToStringWithData } from '@apollo/client/react/ssr';
import { ApolloProvider } from '@apollo/client'

I hope this helps somebody get over the hump, or at least know it's feasible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants