facebook / relay

Relay is a JavaScript framework for building data-driven React applications.
https://relay.dev
MIT License
18.41k stars 1.83k forks source link

v14 tutorial doesn't match v14 reality #4242

Open trumbitta opened 1 year ago

trumbitta commented 1 year ago

This code https://relay.dev/docs/tutorial/queries-1/#relay-and-the-type-system is supposed to type data.topStory, but after applying it we discover data.topStory doesn't exist.

data.topStories exists in its stead, but I don't know how what's happening because I'm following the tutorial to learn about Relay 😬

ushironoko commented 1 year ago

@trumbitta Hi! I encountered the same phenomenon myself. It seems to be caused by relay-compiler failing to start watch mode and GraphQL not updating the types.

If I recompile manually, it works correctly.

npm run relay

I couldn't quite figure out why the compiler is failing to start watch mode, but I am getting the following error message.

[relay] thread 'main' panicked at 'Cannot run relay in watch mode if `watchman` is not available (or explicitly disabled).' , crates/relay-bin/src/main.rs:284:9
[relay] note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
[relay] npm run watch-relay exited with code 101

I hope it gets better soon, as it is a great library.

remz99 commented 1 year ago

I encountered the same issue as @trumbitta when I started the tutorial. I managed to resolve the issue by installing watchman.

ushironoko commented 1 year ago

I installed watchman and it works. Also, Relay GraphQL's VSCode Extension now works and can jump to the fragment definition. Thanks! @remz99

danguilherme commented 1 year ago

I also had this problem, and installing watchman also fixed it. Just a heads up that I had to install it with Homebrew. I tried installing it with npm (both local and global) and it did not work.

nmcmaster commented 1 year ago

This problem still exists as originally described.

flex-mookeun commented 1 year ago

Encountered same issue here. Seems the tutorial document should be mentioning this.

clalexni commented 1 year ago

in extension setting, I added this line (on m1 mac)

"relay.pathToRelay": "./node_modules/relay-compiler/macos-arm64/relay"

and installed watchman using brew install watchman

Was finally able to click on fragment spread and go to where the fragment is defined!! :D

Screenshot 2023-10-14 at 11 27 09 PM