Skip to content

Commit 295c134

Browse files
committed
Fixed
1 parent e8e773a commit 295c134

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

lib/caido/instance.rb

+14
Original file line numberDiff line numberDiff line change
@@ -43,5 +43,19 @@ def format_authorization(auth)
4343
def auth_from_env
4444
@auth_from_env ||= ENV.fetch('CAIDO_AUTH_TOKEN', 'Bearer ')
4545
end
46+
47+
def query(query)
48+
res = HTTParty.post(
49+
graphql_url,
50+
body: { query: }.to_json,
51+
headers: {
52+
'Content-Type' => 'application/json',
53+
'Authorization' => authorization
54+
}
55+
)
56+
57+
obj = JSON.parse(res.body)
58+
obj['data']
59+
end
4660
end
4761
end

0 commit comments

Comments
 (0)