插入调试器语句
mutateAndGetPayload: ({id, text}) => {
debugger;
/* ... */
},
使用调试器运行服务器
$ ./node_modules/.bin/babel-node debug ./server.js
< Debugger listening on port 5858
debug> . ok
break in node_modules/babel/lib/_babel-node.js:1
> 1 "use strict";
2
3 // istanbul ignore next
debug> c
< GraphQL Server is now running on http://localhost:8080
< Relay TodoMVC is now running on http://localhost:3000
break in data/schema.js:278
276 var text = _ref11.text;
277
>278 debugger;
279 var localTodoId = (0, _graphqlRelay.fromGlobalId)(id).id;
280 (0, _database.renameTodo)(localTodoId, text);
debug>