0
Angualar App内でApolloを使用していますが、現在この問題が発生しています。 AWS LambdaにGraphQLエンドポイントがあり、API Gatewayを介して応答が正しく戻ってくるのを見ていますが、それを読むとこのエラーがスローされます。 AWSはLAMBDA_PROXYを使用している予期しない入力が終了しました:AWS API Gatewayからの応答を取得する際にApolloClientエラーが発生しました
//setup
const client = new ApolloClient({
networkInterface: createNetworkInterface({
opts: {
mode: 'no-cors',
},
uri: "https://xxxxxxx.execute-api.ap-southeast-2.amazonaws.com/dev/graphql"
}),
});
//make the call
this.apollo.watchQuery({
forceFetch: true,
query: QueryToSend
}).subscribe(({data}) => {
...process...
}, error => {
console.log(error);
});
//the error...
Network error: Unexpected end of input
at new ApolloError (ApolloError.js:31)
at QueryManager.js:128
at t.invoke (polyfills.js:3)
at Object.onInvoke (ng_zone.js:236)
at t.invoke (polyfills.js:3)
at e.run (polyfills.js:3)
at polyfills.js:3
at t.invokeTask (polyfills.js:3)
at Object.onInvokeTask (ng_zone.js:227)
at t.invokeTask (polyfills.js:3)
要求が間違っている何
const QueryToSend= gql`
query data {
getSuperDefinitionList{
id,
name,
}
}
`;
わからないです。私はPostmanとSoapUIから同じリクエストボディが呼び出されます。私は、すべてはそれがありません使用するJavaScriptライブラリAWSが、アポロまたは一部からOKに見える
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: ...
Connection: keep-alive
Date: Fri, 13 Jan 2017 21:10:10 GMT
x-amzn-RequestId: ab0fghjghja-d9d4-11e6-b19a-090dsfvdgcebe
X-Amzn-Trace-Id: Root=1-58794232-c7f7157d28e033330dbbe6f2
X-Cache: Miss from cloudfront
Via: 1.1 a1d4b598e9b2fghjgfhj3991961a666a6.cloudfront.net (CloudFront)
X-Amz-Cf-Id: XHeOfghjfghjUthDPKxVbCrFoLM4iOYpf9X9mWlu2Z374grmuAv5jMjg==
{"data":{"getSuperDefinitionList":[{"id":"83d3b09f-a947-4a33-bcb0-f5c9e0446ace","name":"S","__typename":"SuperDefinitionType"}]}}
...そのシオマネキ応答が正しい応答があっても参照してください。
どうすればよいですか?