A collection of example applications using Relay.
See CONTRIBUTING.md.
This project is MIT licensed.
A collection of sample Relay applications
License: MIT License
A collection of example applications using Relay.
See CONTRIBUTING.md.
This project is MIT licensed.
if this error ,update watchman to 4.9.0 version
These steps didnt work.
yarn install
yarn update-schema
yarn start
Then ran yarn upgrade-interactive still doesnt work. This is the output:
yarn start v0.27.5
$ babel-node ./server.js
GraphQL Server is now running on http://localhost:8080
App is now running on http://localhost:3000
Hash: c01cb292799b02ee3213
Version: webpack 3.5.5
Time: 3680ms
Asset Size Chunks Chunk Names
app.js 1.22 MB 0 [emitted] [big] main
[12] ./node_modules/react/react.js 56 bytes {0} [built]
[17] ./node_modules/react-relay/index.js 386 bytes {0} [built]
[42] ./node_modules/relay-runtime/index.js 382 bytes {0} [built]
[64] ./node_modules/babel-runtime/helpers/possibleConstructorReturn.js 542 bytes {0} [built]
[65] ./node_modules/babel-runtime/helpers/inherits.js 1.11 kB {0} [built]
[140] ./node_modules/react-dom/index.js 59 bytes {0} [built]
[197] multi whatwg-fetch ./js/app.js 40 bytes {0} [built]
[198] ./node_modules/whatwg-fetch/fetch.js 12.7 kB {0} [built]
[199] ./js/app.js 2.36 kB {0} [built]
[200] ./node_modules/babel-runtime/core-js/json/stringify.js 95 bytes {0} [built]
[202] ./node_modules/todomvc-common/base.js 7.25 kB {0} [built]
[302] ./node_modules/react-relay/lib/ReactRelayPublic.js 1.19 kB {0} [built]
[303] ./node_modules/relay-runtime/lib/RelayRuntime.js 2.8 kB {0} [built]
[396] ./js/components/TodoApp.js 4.79 kB {0} [built]
[410] ./js/components/TodoListFooter.js 3.97 kB {0} [built]
+ 397 hidden modules
ERROR in ./js/mutations/AddTodoMutation.js
Module not found: Error: Can't resolve './__generated__/AddTodoMutation.graphql' in '/Users/shingdev/Downloads/relay-examples-master/todo-modern/js/mutations'
@ ./js/mutations/AddTodoMutation.js 24:9-59
@ ./js/components/TodoApp.js
@ ./js/app.js
@ multi whatwg-fetch ./js/app.js
ERROR in ./js/mutations/ChangeTodoStatusMutation.js
Module not found: Error: Can't resolve './__generated__/ChangeTodoStatusMutation.graphql' in '/Users/shingdev/Downloads/relay-examples-master/todo-modern/js/mutations'
@ ./js/mutations/ChangeTodoStatusMutation.js 10:9-68
@ ./js/components/Todo.js
@ ./js/components/TodoList.js
@ ./js/components/TodoApp.js
@ ./js/app.js
@ multi whatwg-fetch ./js/app.js
ERROR in ./js/mutations/MarkAllTodosMutation.js
Module not found: Error: Can't resolve './__generated__/MarkAllTodosMutation.graphql' in '/Users/shingdev/Downloads/relay-examples-master/todo-modern/js/mutations'
@ ./js/mutations/MarkAllTodosMutation.js 10:9-64
@ ./js/components/TodoList.js
@ ./js/components/TodoApp.js
@ ./js/app.js
@ multi whatwg-fetch ./js/app.js
ERROR in ./js/mutations/RemoveCompletedTodosMutation.js
Module not found: Error: Can't resolve './__generated__/RemoveCompletedTodosMutation.graphql' in '/Users/shingdev/Downloads/relay-examples-master/todo-modern/js/mutations'
@ ./js/mutations/RemoveCompletedTodosMutation.js 24:9-72
@ ./js/components/TodoListFooter.js
@ ./js/components/TodoApp.js
@ ./js/app.js
@ multi whatwg-fetch ./js/app.js
ERROR in ./js/mutations/RemoveTodoMutation.js
Module not found: Error: Can't resolve './__generated__/RemoveTodoMutation.graphql' in '/Users/shingdev/Downloads/relay-examples-master/todo-modern/js/mutations'
@ ./js/mutations/RemoveTodoMutation.js 24:9-62
@ ./js/components/Todo.js
@ ./js/components/TodoList.js
@ ./js/components/TodoApp.js
@ ./js/app.js
@ multi whatwg-fetch ./js/app.js
ERROR in ./js/mutations/RenameTodoMutation.js
Module not found: Error: Can't resolve './__generated__/RenameTodoMutation.graphql' in '/Users/shingdev/Downloads/relay-examples-master/todo-modern/js/mutations'
@ ./js/mutations/RenameTodoMutation.js 10:9-62
@ ./js/components/Todo.js
@ ./js/components/TodoList.js
@ ./js/components/TodoApp.js
@ ./js/app.js
@ multi whatwg-fetch ./js/app.js
ERROR in ./js/components/TodoApp.js
Module not found: Error: Can't resolve './__generated__/TodoApp_viewer.graphql' in '/Users/shingdev/Downloads/relay-examples-master/todo-modern/js/components'
@ ./js/components/TodoApp.js 146:11-60
@ ./js/app.js
@ multi whatwg-fetch ./js/app.js
ERROR in ./js/components/TodoListFooter.js
Module not found: Error: Can't resolve './__generated__/TodoListFooter_viewer.graphql' in '/Users/shingdev/Downloads/relay-examples-master/todo-modern/js/components'
@ ./js/components/TodoListFooter.js 99:11-67
@ ./js/components/TodoApp.js
@ ./js/app.js
@ multi whatwg-fetch ./js/app.js
ERROR in ./js/components/TodoList.js
Module not found: Error: Can't resolve './__generated__/TodoList_viewer.graphql' in '/Users/shingdev/Downloads/relay-examples-master/todo-modern/js/components'
@ ./js/components/TodoList.js 116:11-61
@ ./js/components/TodoApp.js
@ ./js/app.js
@ multi whatwg-fetch ./js/app.js
ERROR in ./js/components/Todo.js
Module not found: Error: Can't resolve './__generated__/Todo_todo.graphql' in '/Users/shingdev/Downloads/relay-examples-master/todo-modern/js/components'
@ ./js/components/Todo.js 152:11-55
@ ./js/components/TodoList.js
@ ./js/components/TodoApp.js
@ ./js/app.js
@ multi whatwg-fetch ./js/app.js
ERROR in ./js/components/Todo.js
Module not found: Error: Can't resolve './__generated__/Todo_viewer.graphql' in '/Users/shingdev/Downloads/relay-examples-master/todo-modern/js/components'
@ ./js/components/Todo.js 155:11-57
@ ./js/components/TodoList.js
@ ./js/components/TodoApp.js
@ ./js/app.js
@ multi whatwg-fetch ./js/app.js
ERROR in ./js/app.js
Module not found: Error: Can't resolve './__generated__/appQuery.graphql' in '/Users/shingdev/Downloads/relay-examples-master/todo-modern/js'
@ ./js/app.js 64:11-54
@ multi whatwg-fetch ./js/app.js
Is there an example app that uses Relay Modern with some sort of routing in between pages? If not, is there another repo where I can find something similar?
Hi, i have some problem when deploy on production, I have error in my console
WebSocket connection to 'ws://0.0.0.0:8070/' failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED
Thank for helping me
Feature Request:
I'd love to see a more realistic example using Relay Modern & React & GraphQL. Routing with Relay can be a pain and I haven't found a decent example so far. I think something like a full CRUD example for a blog would be good enough. That's enough routing to at least get started. I can submit a PR and at least do the React portion. From there, I'm kind of lost. (Something that I've heard a lot of other devs struggle with as well.) Thoughts? I'm open to discussing this and to dedicate some time to writing a really good example to add to the collection.
Update:
A good example that I haven't seen before is to get a single resource. So, I hit demo.com/posts/1
and get the blog post I clicked on from demo.com/posts
.
This probably means a full rewrite copying over what we have in the existing TodoMVC.
I try to add pagination for example "todo" by:
EDIT: This has been reproduced in Windows by @kiadorii, another friend of ours has confirmed that the repo works properly on Debian.
I hope it's just something minor that I've overlooked, but here is my experience so far:
cd todo
to enter this project's root foldernpm install; npm run update-schema; npm run build; npm start
localhost:3000/
public/index.html
I'm trying to follow the path of execution from babel-node ./server.js
, and I can't quite understand how the code in js/app.js
is reached. Any help would be greatly appreciated, I'm having a very hard time understanding this technology!
Further notes:
app.js
that is generated by webpack is being correctly included in the markup of the final result. This makes me think that the problem is not with webpack, but somewhere in js/app.js
.console.log()
statements in app.js
do not produce output in the developer console when page is loaded. This makes it seem like the code in app.js
is not being executed, despite being included on the page in a script tag.I'm doing my best to figure this out on my own, but it's all very opaque to me at the moment. Tips for troubleshooting this are just as welcome as the answer to my problem!
Hi! I don't know if this is the best place to ask this.
I was reading Relay documentation, and in this URL https://facebook.github.io/relay/docs/relay-debugging.html appears an "Electron app" to debug React Native apps, but the project that is linked is removed. I would like to know if this app is still working, and if you could fix that link.
Thank you for your help
The todo-modern example is running Relay Compat, which can be confusing when using it as a reference for writing a Relay Modern app (e.g. fragment syntax differences). It would be helpful to either note in the readme that it's running compatibility mode or migrate it to pure Relay Modern.
I am getting an error while building the program.
Error:
GraphQLCompilerContext: Cannot find fragment TodoApp. Please make sure the fragment exists in ``.
npm ERR! code ELIFECYCLE
npm ERR! errno 100
npm ERR! @ build: relay-compiler --src ./js/ --schema ./data/schema.graphql
npm ERR! Exit status 100
npm ERR!
npm ERR! Failed at the @ build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\userpc\AppData\Roaming\npm-cache_logs\2017-10-27T07_45_29_492Z-debug.log
Hi,
there is a FIXME
comment here
Is this still valid. If so, why only total count is updated but not the node/item?
I've followed the process of running the app with react-native.
However, I'm getting errors regarding bundling and loading of the app (like 'JSON Parse error: Unrecognized token '<').
Steps I've taken:
I'm using:
react-native-cli: 2.0.1
react-native: 0.51.0
Xcode 9.2
Build version 9C40b
Would appreciate any assistance, thank you!
Could you please provide example for RefetchContainer?
Similar to described on https://facebook.github.io/relay/docs/refetch-container.html
Can you provide an example how can we enable caching in relay modern? I am not sure how to connect the dots with RelayQueryResponseCache
and fetchQuery
function.
Cloning, yarn
ing, then yarn start
ing yields the following error:
ERROR in ./js/app.js
Module not found: Error: Cannot resolve 'file' or 'directory' ./__generated__/appQuery.graphql in /Users/matt/workspace/relay-examples/todo-modern/js
@ ./js/app.js 64:11-54
ERROR in ./js/components/TodoApp.js
Module not found: Error: Cannot resolve 'file' or 'directory' ./__generated__/TodoApp_viewer.graphql in /Users/matt/workspace/relay-examples/todo-modern/js/components
@ ./js/components/TodoApp.js 146:11-60
ERROR in ./js/mutations/AddTodoMutation.js
Module not found: Error: Cannot resolve 'file' or 'directory' ./__generated__/AddTodoMutation.graphql in /Users/matt/workspace/relay-examples/todo-modern/js/mutations
@ ./js/mutations/AddTodoMutation.js 24:9-59
ERROR in ./js/components/TodoListFooter.js
Module not found: Error: Cannot resolve 'file' or 'directory' ./__generated__/TodoListFooter_viewer.graphql in /Users/matt/workspace/relay-examples/todo-modern/js/components
@ ./js/components/TodoListFooter.js 99:11-67
ERROR in ./js/components/TodoList.js
Module not found: Error: Cannot resolve 'file' or 'directory' ./__generated__/TodoList_viewer.graphql in /Users/matt/workspace/relay-examples/todo-modern/js/components
@ ./js/components/TodoList.js 116:11-61
ERROR in ./js/mutations/RemoveCompletedTodosMutation.js
Module not found: Error: Cannot resolve 'file' or 'directory' ./__generated__/RemoveCompletedTodosMutation.graphql in /Users/matt/workspace/relay-examples/todo-modern/js/mutations
@ ./js/mutations/RemoveCompletedTodosMutation.js 24:9-72
ERROR in ./js/mutations/MarkAllTodosMutation.js
Module not found: Error: Cannot resolve 'file' or 'directory' ./__generated__/MarkAllTodosMutation.graphql in /Users/matt/workspace/relay-examples/todo-modern/js/mutations
@ ./js/mutations/MarkAllTodosMutation.js 10:9-64
ERROR in ./js/components/Todo.js
Module not found: Error: Cannot resolve 'file' or 'directory' ./__generated__/Todo_todo.graphql in /Users/matt/workspace/relay-examples/todo-modern/js/components
@ ./js/components/Todo.js 152:11-55
ERROR in ./js/components/Todo.js
Module not found: Error: Cannot resolve 'file' or 'directory' ./__generated__/Todo_viewer.graphql in /Users/matt/workspace/relay-examples/todo-modern/js/components
@ ./js/components/Todo.js 155:11-57
ERROR in ./js/mutations/ChangeTodoStatusMutation.js
Module not found: Error: Cannot resolve 'file' or 'directory' ./__generated__/ChangeTodoStatusMutation.graphql in /Users/matt/workspace/relay-examples/todo-modern/js/mutations
@ ./js/mutations/ChangeTodoStatusMutation.js 10:9-68
ERROR in ./js/mutations/RemoveTodoMutation.js
Module not found: Error: Cannot resolve 'file' or 'directory' ./__generated__/RemoveTodoMutation.graphql in /Users/matt/workspace/relay-examples/todo-modern/js/mutations
@ ./js/mutations/RemoveTodoMutation.js 24:9-62
ERROR in ./js/mutations/RenameTodoMutation.js
Module not found: Error: Cannot resolve 'file' or 'directory' ./__generated__/RenameTodoMutation.graphql in /Users/matt/workspace/relay-examples/todo-modern/js/mutations
@ ./js/mutations/RenameTodoMutation.js 10:9-62
node v6.6.0
yarn v0.24.4
macOS v10.12.5
relay-compiler --src ./js/ --schema ./data/schema.graphql
HINT: pass --watch to keep watching for changes.
Watchman: Watchman was not found in PATH. See https://facebook.github.io/watchman/docs/install.html for installation instructions
events.js:163
throw er; // Unhandled 'error' event
^
Error: Watchman was not found in PATH. See https://facebook.github.io/watchman/docs/install.html for installation instructions
at exports._errnoException (util.js:1050:11)
at Process.ChildProcess._handle.onexit (internal/child_process.js:193:32)
at onErrorNT (internal/child_process.js:367:16)
at _combinedTickCallback (internal/process/next_tick.js:80:11)
at process._tickCallback (internal/process/next_tick.js:104:9)
at Module.runMain (module.js:607:11)
at run (bootstrap_node.js:423:7)
at startup (bootstrap_node.js:147:9)
at bootstrap_node.js:538:3
npm ERR! Linux 4.10.0-19-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "run" "build"
npm ERR! node v7.9.0
npm ERR! npm v4.2.0
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @ build: relay-compiler --src ./js/ --schema ./data/schema.graphql
npm ERR! Exit status 1
TodoMVC npm start
starts only GraphQL server
todo npm start
:
ERROR in ./js/app.js
Module build failed: Error: Plugin 0 specified in "foreign" provided an invalid property of "_c"
at Plugin.init (/home/roman/sandbox/relay-examples/todo/node_modules/babel-core/lib/transformation/plugin.js:131:13)
at Function.normalisePlugin (/home/roman/sandbox/relay-examples/todo/node_modules/babel-core/lib/transformation/file/options/option-manager.js:144:12)
at /home/roman/sandbox/relay-examples/todo/node_modules/babel-core/lib/transformation/file/options/option-manager.js:176:30
at Array.map (native)
at Function.normalisePlugins (/home/roman/sandbox/relay-examples/todo/node_modules/babel-core/lib/transformation/file/options/option-manager.js:150:20)
at OptionManager.mergeOptions (/home/roman/sandbox/relay-examples/todo/node_modules/babel-core/lib/transformation/file/options/option-manager.js:224:36)
at /home/roman/sandbox/relay-examples/todo/node_modules/babel-core/lib/transformation/file/options/option-manager.js:230:17
at /home/roman/sandbox/relay-examples/todo/node_modules/babel-core/lib/transformation/file/options/option-manager.js:299:20
at Array.map (native)
at OptionManager.resolvePresets (/home/roman/sandbox/relay-examples/todo/node_modules/babel-core/lib/transformation/file/options/option-manager.js:265:20)
When I attempt to build the project (either with npm run build
or yarn run build
, and after installing node_modules & updating the schema), I get this failure:
> @ build /Users/bropa18/Projects/relay-examples/todo-modern
> relay-compiler --src ./js/ --schema ./data/schema.graphql
HINT: pass --watch to keep watching for changes.
Parsed default in 0.12s
Writing default
TypeError: options.path.includes is not a function
at Transformer.visitLinkedField (/Users/bropa18/Projects/relay-examples/todo-modern/node_modules/relay-compiler/bin/relay-compiler:1526:37)
at Transformer._visit (/Users/bropa18/Projects/relay-examples/todo-modern/node_modules/relay-compiler/bin/relay-compiler:776:35)
at /Users/bropa18/Projects/relay-examples/todo-modern/node_modules/relay-compiler/bin/relay-compiler:872:30
at Array.forEach (native)
at Transformer._map (/Users/bropa18/Projects/relay-examples/todo-modern/node_modules/relay-compiler/bin/relay-compiler:871:16)
at /Users/bropa18/Projects/relay-examples/todo-modern/node_modules/relay-compiler/bin/relay-compiler:847:30
at Array.forEach (native)
at Transformer._traverseChildren (/Users/bropa18/Projects/relay-examples/todo-modern/node_modules/relay-compiler/bin/relay-compiler:841:31)
at Transformer._traverse (/Users/bropa18/Projects/relay-examples/todo-modern/node_modules/relay-compiler/bin/relay-compiler:826:26)
at Transformer.traverse (/Users/bropa18/Projects/relay-examples/todo-modern/node_modules/relay-compiler/bin/relay-compiler:765:26)
npm ERR! Darwin 15.6.0
npm ERR! argv "/Users/bropa18/.nvm/versions/node/v5.10.1/bin/node" "/Users/bropa18/.nvm/versions/node/v5.10.1/bin/npm" "run" "build"
npm ERR! node v5.10.1
npm ERR! npm v3.8.3
npm ERR! code ELIFECYCLE
npm ERR! @ build: `relay-compiler --src ./js/ --schema ./data/schema.graphql`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @ build script 'relay-compiler --src ./js/ --schema ./data/schema.graphql'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! relay-compiler --src ./js/ --schema ./data/schema.graphql
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /Users/bropa18/Projects/relay-examples/todo-modern/npm-debug.log
This is in the npm-debug logfile:
14 verbose stack Error: @ build: `relay-compiler --src ./js/ --schema ./data/schema.graphql`
14 verbose stack Exit status 1
14 verbose stack at EventEmitter.<anonymous> (/Users/bropa18/.nvm/versions/node/v5.10.1/lib/node_modules/npm/lib/utils/lifecycle.js:239:16)
14 verbose stack at emitTwo (events.js:100:13)
14 verbose stack at EventEmitter.emit (events.js:185:7)
14 verbose stack at ChildProcess.<anonymous> (/Users/bropa18/.nvm/versions/node/v5.10.1/lib/node_modules/npm/lib/utils/spawn.js:24:14)
14 verbose stack at emitTwo (events.js:100:13)
14 verbose stack at ChildProcess.emit (events.js:185:7)
14 verbose stack at maybeClose (internal/child_process.js:850:16)
14 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:215:5)
The version of relay-compiler that was installed is 1.0.0-rc.3
.
I am using node 5.10.1 and npm 3.8.3 (and yarn 0.24.6).
Any pointers where to take this?
cd todo
yarn install
yarn build
but shell give a error:
query failed: synchronization failed: No such file or directory
Is this required for new edge or can be ignored?
star-wars root query causes two POSTs: one per faction. I thought the point of GraphQL was to use one round trip.
The i-th ship's cursor has the same value (shown in bold below) for both factions. This might be fine but surprised me.
{
"data": {
"factions": [
{
"id": "RmFjdGlvbjoy",
"factionId": "2",
"name": "Galactic Empire",
"_ships1kM1Bq": {
"edges": [
{
"node": {
"id": "U2hpcDo2",
"name": "TIE Fighter"
},
"cursor": "YXJyYXljb25uZWN0aW9uOjA="
},
{
"data": {
"factions": [
{
"id": "RmFjdGlvbjox",
"factionId": "1",
"name": "Alliance to Restore the Republic",
"_ships1kM1Bq": {
"edges": [
{
"node": {
"id": "U2hpcDox",
"name": "X-Wing"
},
"cursor": "YXJyYXljb25uZWN0aW9uOjA="
},
When running npm run build
I'm getting a watchman error
Tried reinstalling watchman a few times, no luck.
HINT: pass --watch to keep watching for changes.
ERROR: Unknown option --no-pretty
Watchman: watchman --no-pretty get-sockname returned with exit code=1, signal=null, stderr= ERROR: Unknown option --no-pretty
events.js:160
throw er; // Unhandled 'error' event
^
Error: watchman --no-pretty get-sockname returned with exit code=1, signal=null, stderr= ERROR: Unknown option --no-pretty
at ChildProcess.<anonymous> (/home/the-noob/workspace/relay-examples/todo-modern/node_modules/fb-watchman/index.js:198:18)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:191:7)
at maybeClose (internal/child_process.js:891:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
0 info it worked if it ends with ok
1 verbose cli [ 'D:\\app\\develop\\nodejs\\node.exe',
1 verbose cli 'D:\\app\\develop\\nodejs\\node_global\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'run',
1 verbose cli 'build' ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'prebuild', 'build', 'postbuild' ]
5 info lifecycle @~prebuild: @
6 silly lifecycle @~prebuild: no script for prebuild, continuing
7 info lifecycle @~build: @
8 verbose lifecycle @~build: unsafe-perm in lifecycle true
9 verbose lifecycle @~build: PATH: D:\app\develop\nodejs\node_global\node_modules\npm\bin\node-gyp-bin;D:\data\code\relay-examples\todo-modern\node_modules\.bin;C:\ProgramData\Oracle\Java\javapath;D:\app\develop\Python27\;D:\app\develop\Python27\Scripts;D:\app\com\VanDyke Software\Clients\;C:\windows\system32;C:\windows;C:\windows\System32\Wbem;C:\windows\System32\WindowsPowerShell\v1.0\;d:\app\develop\Git\cmd;D:\app\develop\nodejs\;D:\app\develop\TortoiseGit\bin;C:\Users\liuxc1\AppData\Local\Microsoft\WindowsApps;C:\Users\liuxc1\AppData\Roaming\npm;D:\app\develop\nodejs\node_global
10 verbose lifecycle @~build: CWD: D:\data\code\relay-examples\todo-modern
11 silly lifecycle @~build: Args: [ '/d /s /c',
11 silly lifecycle 'relay-compiler --src ./js/ --schema ./data/schema.graphql' ]
12 silly lifecycle @~build: Returned: code: 1 signal: null
13 info lifecycle @~build: Failed to exec build script
14 verbose stack Error: @ build: `relay-compiler --src ./js/ --schema ./data/schema.graphql`
14 verbose stack Exit status 1
14 verbose stack at EventEmitter.<anonymous> (D:\app\develop\nodejs\node_global\node_modules\npm\lib\utils\lifecycle.js:279:16)
14 verbose stack at emitTwo (events.js:106:13)
14 verbose stack at EventEmitter.emit (events.js:191:7)
14 verbose stack at ChildProcess.<anonymous> (D:\app\develop\nodejs\node_global\node_modules\npm\lib\utils\spawn.js:40:14)
14 verbose stack at emitTwo (events.js:106:13)
14 verbose stack at ChildProcess.emit (events.js:191:7)
14 verbose stack at maybeClose (internal/child_process.js:886:16)
14 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
15 verbose pkgid @
16 verbose cwd D:\data\code\relay-examples\todo-modern
17 verbose Windows_NT 10.0.14393
18 verbose argv "D:\\app\\develop\\nodejs\\node.exe" "D:\\app\\develop\\nodejs\\node_global\\node_modules\\npm\\bin\\npm-cli.js" "run" "build"
19 verbose node v6.10.2
20 verbose npm v4.5.0
21 error code ELIFECYCLE
22 error errno 1
23 error @ build: `relay-compiler --src ./js/ --schema ./data/schema.graphql`
23 error Exit status 1
24 error Failed at the @ build script 'relay-compiler --src ./js/ --schema ./data/schema.graphql'.
24 error Make sure you have the latest version of node.js and npm installed.
24 error If you do, this is most likely a problem with the package,
24 error not with npm itself.
24 error Tell the author that this fails on your system:
24 error relay-compiler --src ./js/ --schema ./data/schema.graphql
24 error You can get information on how to open an issue for this project with:
24 error npm bugs
24 error Or if that isn't available, you can get their info via:
24 error npm owner ls
24 error There is likely additional logging output above.
25 verbose exit [ 1, true ]
Warning: commitRelayModernMutatuion: Expected optimisticResponse
to be an object, received a function.
Hello,
can you add an ItemTextInput in the TodoApp component to filter the todo list .
The goal of this request is to show how variables are used through fragment (ie variable set in the TodoApp and used in the TodoList).
Thank you.
Follow the instructions in readme
gives me the error below when launching the app in the browser.
{
"errors": [
{
"message": "Must provide query string."
}
]
}
The documentation for environments mentions creating a new environment instance whenever the user logs in or out in order to prevent data for different users being cached together. This seems like a very common usage pattern, but the documentation doesn't show any examples of how to do it. The todo
example in this repository doesn't handle logging in and logging out, so it doesn't show how to do it, either.
There is a StackOverflow question that discusses how to do this, but it's light on details. It also refers to storing the environment in component state, which is not shown in the todo
example in this repository.
Could you add an example to this repository that shows how to create a fresh environment instance when a user logs in?
Followed the general instructions of
npm install
npm run update-schema
npm run build
npm start
My local host just throws me this on screen and 400 status code in my chrome console.
{
"errors": [
{
"message": "Must provide query string."
}
]
}
Please let me know if I'm missing anything blatantly obvious.
I believe the issue is that AddTodoMutation
is using just text
as its input, and is not using a clientMutationId
.
Is the idea with Relay Modern that mutations that require client mutation IDs must generate one in user code?
I recently came across this comment by Lee Byron which advises against using the Viewer type pattern in GraphQL/Relay applications: lucasbento/graphql-pokemon#1 (comment)
If this is now considered best practice, it would be helpful if all examples within this Repo were updated to reflect the guidelines outlined in the above issue thread.
WebSocket connection to 'ws://localhost:8734/' failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED
Just cloned the repo for the example todo and after running npm install and npm start, I am getting the following GraphQL validation errors. Any thoughts what might be wrong?
`-- GraphQL Validation Error -- TodoApp --
File: F:/Javascript/react-relay-todo-example/src/components/TodoApp.js
Error: Cannot query field "allTodoes" on type "Viewer". Did you mean "allFiles"?
Source:
allTodoes(first: $limit) { ^^^
-- GraphQL Validation Error -- TodoList --
File: F:/Javascript/react-relay-todo-example/src/components/TodoList.js
Error: Cannot query field "allTodoes" on type "Viewer". Did you mean "allFiles"?
Source:
allTodoes(first: $limit) { ^^^
-- GraphQL Validation Error -- ChangeTodoStatusMutation --
File: F:/Javascript/react-relay-todo-example/src/mutations/ChangeTodoStatusMutation.js
Error: Cannot query field "updateTodo" on type "Mutation". Did you mean "updateFile" or "updateUser"?
Source:
mutation ChangeTodoStatusMutation {updateTodo}
^^^
-- GraphQL Validation Error -- ChangeTodoStatusMutation --
File: F:/Javascript/react-relay-todo-example/src/mutations/ChangeTodoStatusMutation.js
Error: Unknown type "UpdateTodoPayload". Did you mean "UpdateFilePayload", "UpdateUserPayload", "CreateFilePayload", "CreateUserPayload", or "DeleteFilePayload"?
Source:
fragment ChangeTodoStatusMutation_ValueRelayQL on UpdateTodoPayload {
^^^
-- GraphQL Validation Error -- ChangeTodoStatusMutation --
File: F:/Javascript/react-relay-todo-example/src/mutations/ChangeTodoStatusMutation.js
Error: Unknown type "Todo". Did you mean "Node"?
Source:
fragment ChangeTodoStatusMutation_TodoRelayQL on Todo {
^^^
-- GraphQL Validation Error -- TodoListFooter --
File: F:/Javascript/react-relay-todo-example/src/components/TodoListFooter.js
Error: Cannot query field "allTodoes" on type "Viewer". Did you mean "allFiles"?
Source:
allTodoes(first: $limit) { ^^^
-- GraphQL Validation Error -- AddTodoMutation --
File: F:/Javascript/react-relay-todo-example/src/mutations/AddTodoMutation.js
Error: Cannot query field "createTodo" on type "Mutation". Did you mean "createFile" or "createUser"?
Source:
mutation AddTodoMutation {createTodo}
^^^
-- GraphQL Validation Error -- AddTodoMutation --
File: F:/Javascript/react-relay-todo-example/src/mutations/AddTodoMutation.js
Error: Unknown type "CreateTodoPayload". Did you mean "CreateFilePayload", "CreateUserPayload", "UpdateFilePayload", "UpdateUserPayload", or "DeleteFilePayload"?
Source:
fragment AddTodoMutation_ValueRelayQL on CreateTodoPayload {
^^^
-- GraphQL Validation Error -- Todo --
File: F:/Javascript/react-relay-todo-example/src/components/Todo.js
Error: Unknown type "Todo". Did you mean "Node"?
Source:
fragment Todo_TodoRelayQL on Todo {
^^^
-- GraphQL Validation Error -- RemoveTodoMutation --
File: F:/Javascript/react-relay-todo-example/src/mutations/RemoveTodoMutation.js
Error: Cannot query field "deleteTodo" on type "Mutation". Did you mean "deleteFile" or "deleteUser"?
Source:
mutation RemoveTodoMutation {deleteTodo}
^^^
-- GraphQL Validation Error -- RemoveTodoMutation --
File: F:/Javascript/react-relay-todo-example/src/mutations/RemoveTodoMutation.js
Error: Unknown type "DeleteTodoPayload". Did you mean "DeleteFilePayload", "DeleteUserPayload", "CreateFilePayload", "UpdateFilePayload", or "UpdateUserPayload"?
Source:
fragment RemoveTodoMutation_ValueRelayQL on DeleteTodoPayload {
^^^
-- GraphQL Validation Error -- RemoveTodoMutation --
File: F:/Javascript/react-relay-todo-example/src/mutations/RemoveTodoMutation.js
Error: Unknown type "Todo". Did you mean "Node"?
Source:
fragment RemoveTodoMutation_TodoRelayQL on Todo {
^^^
-- GraphQL Validation Error -- RenameTodoMutation --
File: F:/Javascript/react-relay-todo-example/src/mutations/RenameTodoMutation.js
Error: Cannot query field "updateTodo" on type "Mutation". Did you mean "updateFile" or "updateUser"?
Source:
mutation RenameTodoMutation {updateTodo}
^^^
-- GraphQL Validation Error -- RenameTodoMutation --
File: F:/Javascript/react-relay-todo-example/src/mutations/RenameTodoMutation.js
Error: Unknown type "UpdateTodoPayload". Did you mean "UpdateFilePayload", "UpdateUserPayload", "CreateFilePayload", "CreateUserPayload", or "DeleteFilePayload"?
Source:
fragment RenameTodoMutation_ValueRelayQL on UpdateTodoPayload {
^^^
-- GraphQL Validation Error -- RenameTodoMutation --
File: F:/Javascript/react-relay-todo-example/src/mutations/RenameTodoMutation.js
Error: Unknown type "Todo". Did you mean "Node"?
Source:
fragment RenameTodoMutation_TodoRelayQL on Todo {
^^^
`
Is this required for new edge or can be ignored?
Does the backend even need to generate a cursor
field?
package.json need to update to use react-native 0.33, else it won't build
in database.js
export function getHidingSpot(id) {
return hidingSpots.find(hs => hs.id === id)
}
if I add log here:
console.log(`id: ${id} ${hs.id} ${hs.id === id} ${hs.id == id}`)
if the id is '2', it will print: 'id: 2 2 false true'
Am I making a mistake or maybe it shouldn't be ===
but ==
in the getHidingSpot
function?
I'm new to relay
and watchman
(need it as since it is a dependency for relay-compiler
). I don't understand the why
& how
the __generated__
directory is being populated and what it's purpose is the the repository. Could you please give a brief explanation of this or lead me to a resource on this? thanks.
changeTodoStatus
Warning: commitRelayModernMutation: Expected optimisticResponse
to be an object, received a function.
Would be very helpful to provide tests for examples
Relay and GraphQL tests
😄
In example, the viewer is available in database so when the page load, it's will have VIEWER_ID.
In my case, I want to add an viewer when page load, after that I will use that VIEWER_ID to add an TODO.
I tried to write a mutation to add viewer but I don't know how to write an updater
Anyone have any ideas ?
ie. will need to reroll facebook/relay#1207 against this repo.
CC: @steveluscher
When I start via yarn start
the TodoMVC example at ./todo-modern
then the browser console throws this warning:
Warning: Accessing PropTypes via the main React package is deprecated. Use the prop-types package from npm instead.
imho
Note: The code generator has deoptimised the styling of "/Users/yutin/Develop/github/relay-examples/TodoMVC/node_modules/immutable/dist/immutable.js" as it exceeds the max of "100KB"
"amdefine": ">=0.0.4",
"babel-preset-react-native": "1.9.0",
"babel-relay-plugin": "0.9.2",
"express": "4.13.4",
"express-graphql": "0.5.2",
"graphql": "0.6.0",
"graphql-relay": "0.4.2",
"react": "15.1.0",
"react-native": "0.28.0",
"react-native-listitem": "1.0.5",
"react-relay": "0.9.2",
"babel-cli": "6.9.0",
"babel-core": "6.9.1"
Hi guys,
I have downloaded the source and installed from relay-examples/todo/
after running the commands I get:
GraphQL Server is now running on http://localhost:8080
Hash: d06d94fe6047259421f3
Version: webpack 3.6.0
where do I go to see the "todo list app" ?
Thanks
just run
cd relay-examples/todo
yarn
yarn upgrade graphql graphql-relay
yarn run update-schema
then comes this error
D:\CodeToRead\relay-examples\todo>yarn run update-schema
yarn run v0.23.2
$ babel-node ./scripts/updateSchema.js
D:\CodeToRead\relay-examples\todo\node_modules\graphql\jsutils\invariant.js:19
throw new Error(message);
^
Error: Root.node field type must be Output Type but got: Node.
at invariant (D:\CodeToRead\relay-examples\todo\node_modules\graphql\jsutils\invariant.js:19:11)
at D:\CodeToRead\relay-examples\todo\node_modules\graphql\type\definition.js:337:29
at Array.forEach (native)
at defineFieldMap (D:\CodeToRead\relay-examples\todo\node_modules\graphql\type\definition.js:328:14)
at GraphQLObjectType.getFields (D:\CodeToRead\relay-examples\todo\node_modules\graphql\type\definition.js:282:44)
at typeMapReducer (D:\CodeToRead\relay-examples\todo\node_modules\graphql\type\schema.js:206:25)
at Array.reduce (native)
at new GraphQLSchema (D:\CodeToRead\relay-examples\todo\node_modules\graphql\type\schema.js:95:34)
at Object.<anonymous> (D:/CodeToRead/relay-examples/todo/data/schema.js:278:23)
at Module._compile (module.js:571:32)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
the node version is v7.9.0
has anybody met this error? how to locate where the error occured?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.