machinebox / graphql

Simple low-level GraphQL HTTP client for Go
https://blog.machinebox.io/a-graphql-client-library-for-go-5bffd0455878
Apache License 2.0
933 stars 217 forks source link

Been getting following error `Post -url-: EOF` #51

Open dovydas55 opened 4 years ago

dovydas55 commented 4 years ago

Has anyone seen this kind of error before? I ran this client on a loop for the last 12 hours, and around once every hour i noticed this error. It did not return any other contextual information

ddirkson commented 3 years ago

This is probably way too late to be useful to you, but I was seeing a similar issue. It boiled down to the sender (client) expecting the recipient to close the connection by default which it wasn't doing.

Adding the "ImmediatelyCloseReqBody" flag to the client instantiation fixed the issue of stale connections lying around: client := graphql.NewClient("https://example.com/graphql", graphql.ImmediatelyCloseReqBody())

brlala commented 1 year ago

This is probably way too late to be useful to you, but I was seeing a similar issue. It boiled down to the sender (client) expecting the recipient to close the connection by default which it wasn't doing.

Adding the "ImmediatelyCloseReqBody" flag to the client instantiation fixed the issue of stale connections lying around: client := graphql.NewClient("https://example.com/graphql", graphql.ImmediatelyCloseReqBody())

apparently it is still useful! encountering EOF but couldn't scratch my head on the reason. Will try this out! thank you.

Edit: tried the solution, doesn't work still encountering the same issue, for us it's the router we are using that causes the issue