getNodeHealth Query
參數
此方法不接受任何參數
退貨
資料
物件
載入中...
健康
布林值
載入中...
請求
1curl --location 'https://docs-demo.fuel-mainnet.quiknode.pro/v1/graphql' \2--header 'Accept: application/json' \3--標頭 'Content-Type: application/json' \4--data '{5"query": "{ health }"6}'
1curl --location 'https://docs-demo.fuel-mainnet.quiknode.pro/v1/graphql' \2--header 'Accept: application/json' \3--標頭 'Content-Type: application/json' \4--data '{5"query": "{ health }"6}'
1const HEALTH_QUERY = `2query {3健康4}5`;67const fetchNodeHealth = async (): Promise<void> => {8試試看 {9const response = await fetch('https://docs-demo.fuel-mainnet.quiknode.pro/v1/graphql', {10方法: 'POST',11headers: {12「接受」: 'application/json',13「Content-Type」: 'application/json',14},15body: JSON.stringify({16query: HEALTH_QUERY,17}),18});1920如果 (!回應.ok) {21throw new Error(`HTTP error! status: ${response.status}`);22}2324const 結果 = await response.json();25console.log('Node Health:', result.data.health);26} catch (錯誤) {27console.error('Error fetching node health:', error);28}29};3031fetchNodeHealth();32
1const HEALTH_QUERY = `2query {3健康4}5`;67const fetchNodeHealth = async (): Promise<void> => {8試試看 {9const response = await fetch('https://docs-demo.fuel-mainnet.quiknode.pro/v1/graphql', {10方法: 'POST',11headers: {12「接受」: 'application/json',13「Content-Type」: 'application/json',14},15body: JSON.stringify({16query: HEALTH_QUERY,17}),18});1920如果 (!回應.ok) {21throw new Error(`HTTP error! status: ${response.status}`);22}2324const 結果 = await response.json();25console.log('Node Health:', result.data.health);26} catch (錯誤) {27console.error('Error fetching node health:', error);28}29};3031fetchNodeHealth();32
1const myHeaders = new Headers();2myHeaders.追加("Accept", "application/json");3myHeaders.追加("Content-Type", "application/json");45const raw = JSON.stringify({6"query": "{ health }"7});89const requestOptions = {10方法: 「POST」,11標題: myHeaders,12正文: 原始,13重定向: 「追蹤」14};1516取得(「https://docs-demo.fuel-mainnet.quiknode.pro/v1/graphql」, requestOptions)17.接著((回應) => 回應.文字())18.接著((結果) => 控制台.log(結果))19.catch((錯誤) => 控制台.錯誤(錯誤));
1const myHeaders = new Headers();2myHeaders.追加("Accept", "application/json");3myHeaders.追加("Content-Type", "application/json");45const raw = JSON.stringify({6"query": "{ health }"7});89const requestOptions = {10方法: 「POST」,11標題: myHeaders,12正文: 原始,13重定向: 「追蹤」14};1516取得(「https://docs-demo.fuel-mainnet.quiknode.pro/v1/graphql」, requestOptions)17.接著((回應) => 回應.文字())18.接著((結果) => 控制台.log(結果))19.catch((錯誤) => 控制台.錯誤(錯誤));
1const { ApolloClient, InMemoryCache, gql } = require('@apollo/client/core');2const fetch = require('cross-fetch');34const 客戶端 = new ApolloClient({5uri: 《https://docs-demo.fuel-mainnet.quiknode.pro/v1/graphql》,6快取: new InMemoryCache(),7fetch: fetch,8headers: {9「接受」: 'application/json',10「Content-Type」: 'application/json'11}12});1314const HEALTH_QUERY = gql`15{16健康17}18`;1920客戶.查詢({21query: HEALTH_QUERY22})23.接著(結果 => {24console.log('Node Health Status:', result.data.health);25})26.catchcatch(錯誤 => console.錯誤('錯誤:', 錯誤));
1const { ApolloClient, InMemoryCache, gql } = require('@apollo/client/core');2const fetch = require('cross-fetch');34const 客戶端 = new ApolloClient({5uri: 《https://docs-demo.fuel-mainnet.quiknode.pro/v1/graphql》,6快取: new InMemoryCache(),7fetch: fetch,8headers: {9「接受」: 'application/json',10「Content-Type」: 'application/json'11}12});1314const HEALTH_QUERY = gql`15{16健康17}18`;1920客戶.查詢({21query: HEALTH_QUERY22})23.接著(結果 => {24console.log('Node Health Status:', result.data.health);25})26.catchcatch(錯誤 => console.錯誤('錯誤:', 錯誤));
1匯入 請求2import json34網址 = "https://docs-demo.fuel-mainnet.quiknode.pro/v1/graphql"56有效載荷 = json.dumps({7"query": "{ health }"8})9標題 = {10「接受」: 'application/json',11「Content-Type」: 'application/json'12}1314回應 = 請求.請求("POST", url, headers=headers, data=有效載荷)1516列印(回應.text)17
1匯入 請求2import json34網址 = "https://docs-demo.fuel-mainnet.quiknode.pro/v1/graphql"56有效載荷 = json.dumps({7"query": "{ health }"8})9標題 = {10「接受」: 'application/json',11「Content-Type」: 'application/json'12}1314回應 = 請求.請求("POST", url, headers=headers, data=有效載荷)1516列印(回應.text)17
1需要 "uri"2require "json"3需要 "net/http"45網址 = URI("https://docs-demo.fuel-mainnet.quiknode.pro/v1/graphql")67https = 網::HTTP.new(url.主機, url.port)8https.use_ssl = true910請求 = 淨::HTTP::POST.new(網址)11請求[「接受」] = "application/json"12請求["Content-Type"] = "application/json"13請求。正文 = JSON.dump({14"query": "{ health }"15})1617回應 = https.請求(請求)18將回應。read_body19
1需要 "uri"2require "json"3需要 "net/http"45網址 = URI("https://docs-demo.fuel-mainnet.quiknode.pro/v1/graphql")67https = 網::HTTP.new(url.主機, url.port)8https.use_ssl = true910請求 = 淨::HTTP::POST.new(網址)11請求[「接受」] = "application/json"12請求["Content-Type"] = "application/json"13請求。正文 = JSON.dump({14"query": "{ health }"15})1617回應 = https.請求(請求)18將回應。read_body19