apollographql / fullstack-tutorial

🚀 The Apollo platform tutorial app

Home Page:https://www.apollographql.com/docs/tutorial/introduction.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Tutorial part 8 and part 9 are no long followable.

dataifora opened this issue · comments

Tutorial part 8 and part 9 are completely diverted from the current Apollo Client version.

The version from package.json is as below

  "dependencies": {
    "@apollo/client": "^3.0.2",

Although the theory from part 8 & 9 is "basically" true, the source code, the organization of code paragraph, the location of source within which file are not correct any more.

From part 8: https://www.apollographql.com/docs/tutorial/mutations/
begins with below content

In our onCompleted handler, we also call client.writeData 

it begins to not able to execute the code any more.
First of all

"writeData" is no longer available, writeData has been removed, see PR #5923.

Another thing is, resolver.tsx (which is mentioned within tutorial) also not used within /final/client/src/index.tsx at all

These are just 2 "minor" issues among too many errors.

Same experience here. Sections 0 through 5 were solid. Sections 6 and 7 were not as clean but could be followed - sometimes I had to compare the instructions against the final/ version of the code to infer what was intended at the point in the tutorial. I managed to infer the intent of the first part of Section 8 but had to stop at the same point as @dataifora.

As another concrete example, the code snippet in the documentation for start/ client/src/index.tsx assumes a cache object but there is no reference to it in the documentation. The final/ version of the tutorial includes a src/cache.ts but that file is not present in the start/ version which is at odds with the convention used elsewhere in the tutorial: final files are always present in start/ even if in a degraded variant.

Same experience as pelegri above. Steps 1 - 5 for the "server" tutorial were some of the best docs I have ever followed. Super clear, concise, and complete. I started Step 6 and was a little confused because the instructions went from " copy this code and paste between *here and * here: to "copy this code into the file", with little indication of where. After making it through the first time and it not working, I thought it was me, so I started over. I realized that most of the code to copy here was meant to "replace" default code, and that was fine. But as soon as I hit the "writeData" code, I began to get errors. I pushed forward to the part where we copy the "cache" code to src/index.tsx, only to find that yes, the "cache.ts" file does not exist in the start/client/src folder. So I just copied the file from the final/client/src folder to my start/client/src folder and added the import. It fixed the cache issue, but as stated above, does not fix the writeData issues in src/index.tsx and src/pages/login.tsx. I copied and pasted the code from the final/src/pages/login.tsx, and that just caused more errors. I'm afraid at this point it's a rabbit hole of errors and the client tutorial is not able to be properly completed. I hope they fix it soon, because I really love what Apollo client has to offer.

I experienced the same issue, and I found out we have to use writeQuery instead of writeData


Here is my diff of the start and the final code with writeQuery.
https://github.com/apollographql/fullstack-tutorial/compare/master...takkyuuplayer:tutorial?expand=1

If you're stuck on part 8/9, here is how I proceeded:

  1. Finish part 8 by commenting out all cache.writeData lines.
  2. Follow part 9 along with
    • commenting in the part-8's writeData lines by replacing them with writeQuery
    • rewrite writeData with writeQuery

Hi all, long overdue apologies for the confusion here! I was updating the full-stack tutorial step-by-step following the release of AC3, and y'all hit a wall right where I hadn't gotten to yet. The full tutorial has since been updated for use with AC3.