srob2
June 21, 2023, 9:30am
1
script code in google app script lang with err in the last line (fetch func):
const API_KEY = “BQ…Lv”
function MyTest(){
let query = query{ bitcoin{ blocks{ count } } }
;
let opts = {
method: “POST”,
headers: {“Content-Type”: “application/json”, “X-API-KEY”: API_KEY},
body: JSON.stringify(query)
};
let response = UrlFetchApp.fetch(‘https://graphql.bitquery.io ’, opts)
}
err mes:
Exception: Request failed for https://graphql.bitquery.io returned code 500. Truncated server response: {“errors”:[{“message”:"undefined method size' for nil:NilClass","backtrace":["/app/lib/util/requests_complexity.rb:10:in
pre_calculate_complexity… (use muteHttpExceptions option to examine full response)
help pls thanks
Divya
June 21, 2023, 2:52pm
2
@srob2 thanks for bringing it to our notice. This seems to be an error on our side. Will get back to you soon with the fix.
Divya
June 22, 2023, 12:52pm
3
@srob2 Here’s how we should use it:
let opts = {
method: "post",
muteHttpExceptions:true,
headers: {
"Content-Type": "application/json",
"X-API-KEY": API_KEY,
},
payload: JSON.stringify({
"query":query
,"variables" : "{}"
})
};
set the query in the payload parameter and it works
srob2
June 22, 2023, 4:28pm
4
it works. thx
here is err in help info i used.
fix it pls
In this article, we will show how to call GraphQL APIs using different programming languages such as Python, Javascript and Ruby.
Est. reading time: 4 minutes
In this tutorial, we are going to make API calls to Bitquery using a variety of programming languages which have utility across all technology domain.
Python
Python is a high-level, general-purpose programming language. Its design philosophy emphasizes code readability with the use of significant indentation. Its language constructs and object-oriented approach aim to help programmers write clear, logical code for small- and large-scale projects. Python is extensively used in :-
AI and Machi…
1 Like