Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Double JSON Parsing Required for Monday::Client#api method #2

Open
dannysperry opened this issue Aug 1, 2023 · 1 comment
Open

Comments

@dannysperry
Copy link

Reproduction Steps

api_token = '' # get from Monday Administrate > Api
client = ::Monday::Client.new(options={token: api_token})
query = "query {
            boards {
              name
              state
              id
              board_kind
              permissions
            }
          }"
result = client.api(query)
puts result.class # => String

ex1 = JSON.parse result
puts ex1.class # => String

ex2 = JSON.parse ex1
puts ex2.class # => Hash
@izikaj
Copy link

izikaj commented Sep 1, 2023

There are some issues with the client code, I'm already working on the updates to fix this.
The correct way is to not parse the response at all (use Faraday middleware to parse the response automatically & do not convert to JSON string inside the client).
The PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants