Graphcool / graphcool-framework

Apache License 2.0
1.77k stars 131 forks source link

504: Error during a mutation #520

Closed birdwell closed 6 years ago

birdwell commented 6 years ago

For bug reports, please fill in the next sections:

Current behavior

It throws a 504 error when I try to call a mutation using node & graphql-request. I got a failed to fetch when I ran it the first time in the playground. I ran it a second time and it worked. I'm not sure what's going on here. I have built my project on the graph.cool interface. This is a simple update I'm calling. It's failing on this simple case. This is my first time using it. I can provide the code I'm using to call the mutation.

    const draftedData = await request('https://api.graph.cool/simple/v1/<my-id>', graphqlQuery.updatePlayerAdp, 
    { 
        id: queryPlayer[0].id, adp: newAdp, drafts: newDrafts, development: player.devTrait.toString(), 
        round: newRound, oldAdp: (queryPlayer[0].adp || 0), adpDiff (queryPlayer[0].adp - newAdp)
    }
    );
<img width="1440" alt="screen shot 2018-04-29 at 12 15 40 am" src="https://user-images.githubusercontent.com/3323856/39403464-7e6b8654-4b42-11e8-8957-72cf2173f4c1.png">
GraphQL Error (Code: 504): {"response":{"error":"<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n<HTML><HEAD><META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=iso-8859-1\">\n<TITLE>ERROR: The request could not be satisfied</TITLE>\n</HEAD><BODY>\n<H1>504 ERROR</H1>\n<H2>The request could not be satisfied.</H2>\n<HR noshade size=\"1px\">\nCloudFront attempted to establish a connection with theorigin, but either the attempt failed or the origin closed the connection.\n<BR clear=\"all\"/>\nFor more information on how to troubleshoot this error, please refer to the CloudFront documentation\n(<A href=\"https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/http-504-gateway-timeout.html\">https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/http-504-gateway-timeout.html</A>).\n<BR clear=\"all\">\n<HR noshade size=\"1px\">\n<PRE>\nGenerated by cloudfront (CloudFront)\nRequest ID: b3sump64Q-9Aw3focfcFJLLTx2yF7exSHBNLK-hBzhGZCZ5gYGorcg==\n</PRE>\n<ADDRESS>\n</ADDRESS>\n</BODY></HTML>","status":504},"request":{"query":"mutation UpdatePlayerAdp($id: ID!, $adp: Int, $drafts: [Int!], $development: String, $round: Int, $oldAdp: Int, $adpDiff: Int) {\n\tupdatePlayer(id:$id, adp: $adp, drafts: $drafts, development: $development, round: $round, oldAdp: $oldAdp, adpDiff: $adpDiff){\n    firstName\n    lastName\n    adp\n    round\n  }\n}\n","variables":{"id":"cjghn2enlztba0143qg4b85ru","adp":593,"drafts":[593],"development":"1","round":19,"oldAdp":0,"adpDiff":-593}}}
    at GraphQLClient.<anonymous> (/Users/Birdwell/Documents/GraphQLMadden/node_modules/graphql-request/src/index.ts:71:13)
    at step (/Users/Birdwell/Documents/GraphQLMadden/node_modules/graphql-request/dist/src/index.js:40:23)
    at Object.next (/Users/Birdwell/Documents/GraphQLMadden/node_modules/graphql-request/dist/src/index.js:21:53)
    at fulfilled (/Users/Birdwell/Documents/GraphQLMadden/node_modules/graphql-request/dist/src/index.js:12:58)
    at <anonymous>
    at process._tickDomainCallback (internal/process/next_tick.js:228:7)
screen shot 2018-04-29 at 12 15 40 am

Reproduction

If your problem can be reproduced with a certain service definition, please create a new GitHub repository with the reproduction instructions.

Expected behavior? That it would accept the query. I copied it exactly to the playground and failed then it worked on the second go. Sometimes these queries work and other times they fail.

morgothulhu commented 6 years ago

Same here. Not sure what changed.

marktani commented 6 years ago

This is now fixed, thanks for bringing it up!

birdwell commented 6 years ago

@marktani Thanks for looking into this!