服务器错误:本地网络层GraphQL失败错误

时间:2016-05-31 16:31:15

标签: node.js graphql

之前有没有人见过这个错误?我正在开发我的第一个NodeJS / React / GraphQL项目。这让我有点疯狂。我搜索过Google,但之前似乎没有人遇到过这个问题。

  error: Server error: local network layer GraphQL failure errors=[], _settled=true, _resolve=function (value) {
  [1]     if (done) return;
  [1]     done = true;
  [1]     resolve(promise, value);
  [1]   }, _reject=function (reason) {
  [1]     if (done) return;
  [1]     done = true;
  [1]     reject(promise, reason);
  [1]   }, _45=2, _81=2, , _54=null, text=query Routes {
  [1]   Viewer {
  [1]     id,
  [1]     ...F3
  [1]   }
  [1] }
  [1] fragment F0 on Viewer {
  [1]   User_IsAnonymous,
  [1]   User_DisplayName,
  [1]   User_ProfilePhoto,
  [1]   id
  [1] }
  [1] fragment F1 on Viewer {
  [1]   User_IsAnonymous,
  [1]   id
  [1] }
  [1] fragment F2 on Viewer {
  [1]   id,
  [1]   ...F1
  [1] }
  [1] fragment F3 on Viewer {
  [1]   User_IsAnonymous,
  [1]   User_AuthToken,
  [1]   id,
  [1]   ...F0,
  [1]   ...F2,
  [1]   ...F1
  [1] }, , children=[fieldName=id, kind=Field, isGenerated=true, isRequisite=true, type=ID, , children=[fieldName=User_IsAnonymous, kind=Field, , type=Boolean, fieldName=User_AuthToken, kind=Field, , type=String, fieldName=id, kind=Field, isGenerated=true, isRequisite=true, type=ID, , children=[fieldName=User_IsAnonymous, kind=Field, , type=Boolean, fieldName=User_DisplayName, kind=Field, , type=String, fieldName=User_ProfilePhoto, kind=Field, , type=String, fieldName=id, kind=Field, isGenerated=true, isRequisite=true, type=ID], id=1::client, kind=Fragment, , name=AppBar_Auth_ViewerRelayQL, type=Viewer, $ref=$["request"]["_query"]["__concreteNode__"]["children"][1]["_fragment"]["children"][3]["_fragment"], name=$$_aggregated-$$_route[1]_@@default_Viewer-$$_route[2]_@@default_Viewer, , __calls__=null, __children__=[$ref=$["request"]["_query"]["__concreteNode__"]["children"][1]["_fragment"]["children"][3]["_fragment"]["children"][0], $ref=$["request"]["_query"]["__concreteNode__"]["children"][1]["_fragment"]["children"][3]["_fragment"]["__cachedFragment__"]["__route__"], $ref=$["request"]["_query"]["__concreteNode__"]["children"][1]["_fragment"]["children"][3]["_fragment"]["__cachedFragment__"]["__variables__"], __calls__=[], __children__=[], __fieldMap__=null, __hasDeferredDescendant__=false, __hasValidatedConnectionCalls__=null, __serializationKey__=null, __storageKey__=null, __debugName__=undefined, __isRefQueryDependency__=false, __rangeBehaviorKey__=undefined, __shallowHash__=undefined, $ref=$["request"]["_query"]["__concreteNode__"]["children"][1]["_fragment"]["children"][3]["_fragment"]["children"][1], $ref=$["request"]["_query"]["__concreteNode__"]["children"][1]["_fragment"]["children"][3]["_fragment"]["__cachedFragment__"]["__route__"], $ref=$["request"]["_query"]["__concreteNode__"]["children"][1]["_fragment"]["children"][3]["_fragment"]["__cachedFragment__"]["__variables__"], $ref=$["request"]["_query"]["__concreteNode__"]["children"][1]["_fragment"]["children"][3]["_fragment"]["__cachedFragment__"]["__children__"][0]["__calls__"], __children__=[], __fieldMap__=null, __hasDeferredDescendant__=false, __hasValidatedConnectionCalls__=null, __serializationKey__=null, __storageKey__=null, __debugName__=undefined, __isRefQueryDependency__=false, __rangeBehaviorKey__=undefined, __shallowHash__=undefined, $ref=$["request"]["_query"]["__concreteNode__"]["children"][1]["_fragment"]["children"][3]["_fragment"]["children"][2], $ref=$["request"]["_query"]["__concreteNode__"]["children"][1]["_fragment"]["children"][3]["_fragment"]["__cachedFragment__"]["__route__"], $ref=$["request"]["_query"]["__concreteNode__"]["children"][1]["_fragment"]["children"][3]["_fragment"]["__cachedFragment__"]["__variables__"], $ref=$["request"]["_query"]["__concreteNode__"]["children"][1]["_fragment"]["children"][3]["_fragment"]["__cachedFragment__"]["__children__"][0]["__calls__"], __children__=[], __fieldMap__=null, __hasDeferredDescendant__=false, __hasValidatedConnectionCalls__=null, __serializationKey__=null, __storageKey__=null, __debugName__=undefined, __isRefQueryDependency__=false, __rangeBehaviorKey__=undefined, __shallowHash__=undefined, $ref=$["request"]["_query"]["__concreteNode__"]["children"][1]["_fragment"]["children"][3]["_fragment"]["children"][3], $ref=$["request"]["_query"]["__concreteNode__"]["children"][1]["_fragment"]["children"][3]["_fragment"]["__cachedFragment__"]["__route__"], $ref=$["request"]["_query"]["__concreteNode__"]["children"][1]["_fragment"]["children"][3]["_fragment"]["__cachedFragment__"]["__variables__"], $ref=$["request"]["_query"]["__concreteNode__"]["children"][1]["_fragment"]["children"][3]["_fragment"]["__cachedFragment__"]["__children__"][0]["__calls__"], __children__=[], __fieldMap__=null, __hasDeferredDescendant__=false, __hasValidatedConnectionCalls__=null, __serializationKey__=null, __storageKey__=null, __debugName__=undefined, __isRefQueryDependency__=false, __rangeBehaviorKey__=undefined, __shallowHash__=undefined], __fieldMap__=null, __hasDeferredDescendant__=false, __hasValidatedConnectionCalls__=null, __serializationKey__=null, __storageKey__=null, __compositeHash__=_1::client1hz3YB, isDeferred=false, isContainerFragment=true, __cacheKey__=$$_aggregated-$$_route[1]_@@default_Viewer-$$_route[2]_@@default_Viewer:{}:{isContainerFragment:true,isDeferred:false}, _fragmentGetter=function () {
  [1]       return buildContainerFragment(containerName, fragmentName, fragmentBuilder, initialVariables);
  [1]     }, _isContainerFragment=true, _isDeferred=false, _variableMapping=undefined, _prepareVariables=undefined, , children=[fieldName=id, kind=Field, isGenerated=true, isRequisite=true, type=ID, , children=[fieldName=User_IsAnonymous, kind=Field, , type=Boolean, fieldName=id, kind=Field, isGenerated=true, isRequisite=true, type=ID], id=4::client, kind=Fragment, , name=NavMenu_ViewerRelayQL, type=Viewer, $ref=$["request"]["_query"]["__concreteNode__"]["children"][1]["_fragment"]["children"][4]["_fragment"]["children"][1]["_fragment"], $ref=$["request"]["_query"]["__concreteNode__"]["children"][1]["_fragment"]["children"][3]["_fragment"]["__cachedFragment__"]["__route__"], , __calls__=null, __children__=[$ref=$["request"]["_query"]["__concreteNode__"]["children"][1]["_fragment"]["children"][4]["_fragment"]["children"][1]["_fragment"]["children"][0], $ref=$["request"]["_query"]["__concreteNode__"]["children"][1]["_fragment"]["children"][3]["_fragment"]["__cachedFragment__"]["__route__"], $ref=$["request"]["_query"]["__concreteNode__"]["children"][1]["_fragment"]["children"][4]["_fragment"]["children"][1]["_fragment"]["__cachedFragment__"]["__variables__"], $ref=$["request"]["_query"]["__concreteNode__"]["children"][1]["_fragment"]["children"][3]["_fragment"]["__cachedFragment__"]["__children__"][0]["__calls__"], __children__=[], __fieldMap__=null, __hasDeferredDescendant__=false, __hasValidatedConnectionCalls__=null, __serializationKey__=null, __storageKey__=null, __debugName__=undefined, __isRefQueryDependency__=false, __rangeBehaviorKey__=undefined, __shallowHash__=undefined, $ref=$["request"]["_query"]["__concreteNode__"]["children"][1]["_fragment"]["children"][4]["_fragment"]["children"][1]["_fragment"]["children"][1], $ref=$["request"]["_query"]["__concreteNode__"]["children"][1]["_fragment"]["children"][3]["_fragment"]["__cachedFragment__"]["__route__"], $ref=$["request"]["_query"]["__concreteNode__"]["children"][1]["_fragment"]["children"][4]["_fragment"]["children"][1]["_fragment"]["__cachedFragment__"]["__variables__"], $ref=$["request"]["_query"]["__concreteNode__"]["children"][1]["_fragment"]["children"][3]["_fragment"]["__cachedFragment__"]["__children__"][0]["__calls__"], __children__=[], __fieldMap__=null, __hasDeferredDescendant__=false, __hasValidatedConnectionCalls__=null, __serializationKey__=null, __storageKey__=null, __debugName__=undefined, __isRefQueryDependency__=false, __rangeBehaviorKey__=undefined, __shallowHash__=undefined], __fieldMap__=null, __hasDeferredDescendant__=false, __hasValidatedConnectionCalls__=null, __serializationKey__=null, __storageKey__=null, __compositeHash__=_4::client3dbVxF, isDeferred=false, isContainerFragment=true, __cacheKey__=$$_aggregated-$$_route[1]_@@default_Viewer-$$_route[2]_@@default_Viewer:{}:{isContainerFragment:true,isDeferred:false}, _fragmentGetter=function () {
  [1]       return buildContainerFragment(containerName, fragmentName, fragmentBuilder, initialVariables);
  [1]     }, _isContainerFragment=true, _isDeferred=false, _variableMapping=undefined, _
  [1] /Users/lorm/projects/React-Relay-Boilerplate/node_modules/promise/lib/done.js:10
  [1]       throw err;
  [1]       ^
  [1] 
  [1] Error: Can't set headers after they are sent.
  [1]     at ServerResponse.OutgoingMessage.setHeader (_http_outgoing.js:346:11)
  [1]     at ServerResponse.header (/Users/lorm/projects/React-Relay-Boilerplate/node_modules/express/lib/response.js:718:10)
  [1]     at ServerResponse.send (/Users/lorm/projects/React-Relay-Boilerplate/node_modules/express/lib/response.js:163:12)
  [1]     at serveFailure (renderOnServer.js:28:21)
  [1]     at NetworkLayer.onError [as _onError] (renderOnServer.js:58:41)
  [1]     at NetworkLayer._executeRequest$ (/Users/lorm/projects/React-Relay-Boilerplate/node_modules/relay-local-schema/lib/NetworkLayer.js:71:18)
  [1]     at tryCatch (/Users/lorm/projects/React-Relay-Boilerplate/node_modules/relay-local-schema/node_modules/babel-runtime/regenerator/runtime.js:72:40)
  [1]     at GeneratorFunctionPrototype.invoke [as _invoke] (/Users/lorm/projects/React-Relay-Boilerplate/node_modules/relay-local-schema/node_modules/babel-runtime/regenerator/runtime.js:334:22)
  [1]     at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (/Users/lorm/projects/React-Relay-Boilerplate/node_modules/relay-local-schema/node_modules/babel-runtime/regenerator/runtime.js:105:21)
  [1]     at tryCatch (/Users/lorm/projects/React-Relay-Boilerplate/node_modules/relay-local-schema/node_modules/babel-runtime/regenerator/runtime.js:72:40)

1 个答案:

答案 0 :(得分:0)

好吧,这似乎来自类型错误。我们使用的是Universal React Boilerplate,我们撕掉了Cassandra代码,我们认为我们可以使用node-uuid来替换Cassandra.uuid,但前者返回一个字符串,后者返回一个对象。