lib/bunny_app/client.rb in bunny_app-1.20.0 vs lib/bunny_app/client.rb in bunny_app-1.22.0
- old
+ new
@@ -56,10 +56,10 @@
res = self.class.post('/graphql', headers: @headers, body:)
case res.code.to_s
when /2[0-9][0-9]/ # HTTP 2xx
- res.body
+ JSON.parse(res.body)
when /401/ # Access Token Expired
raise AuthorizationError, 'Invalid access token' unless BunnyApp.retryable
raise AuthorizationError, 'Invalid api credentials' if retries >= 1
BunnyApp.access_token = fetch_access_token