rmosolgo/graphql-ruby

docs: how to change timeout duration for Net::OpenTimeout and Net::ReadTimeout

Closed this issue · 1 comments

Is your feature request related to a problem? Please describe.

Sometimes you want to change the timeout.

Describe the solution you'd like

Add the following instructions to the docs:

source: https://github.com/ankane/the-ultimate-guide-to-ruby-timeouts/blob/master/README.md#graphql-client

    ```ruby
    GraphQL::Client::HTTP.new(url) do
      def connection
        conn = super
        conn.open_timeout = 1
        conn.read_timeout = 1
        conn
      end
    end
    ```

    Raises
    
    - `Net::OpenTimeout` on connect timeout
    - `Net::ReadTimeout` on read timeout

Describe alternatives you've considered

n/a

Additional context

n/a

Hi! I'd be happy to help address this but there are a couple of paperwork issues to address:

  1. This code is in the graphql-client gem, so could you please open a new issue there? https://github.com/github-community-projects/graphql-client/issues I am now the maintainer of that library, so I'll see you there, but it will be easier to keep track of things if we do our work over there.
  2. When you open that new issue, would you please share the full error messages and backtraces that you're encountering? Even if they seem like noise to you, they're very helpful from a debugging perspective because they show what code was running when the error occurred. Alternatively, you could share a full replication script and I could grab the backtrace and error message from that.

See you there!