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 result = 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 result = 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.append("Accept", "application/json");3myHeaders.append("Content-Type", "application/json");45const raw = JSON.stringify({6"query": "{ health }"7});89const requestOptions = {10メソッド: "POST",11ヘッダー: myHeaders,12本文: raw,13リダイレクト: "follow"14};1516fetch(「https://docs-demo.fuel-mainnet.quiknode.pro/v1/graphql」, requestOptions)17.その後((レスポンス) => レスポンス.text())18.その後((結果) => コンソール.log(result))19.catchcatch((エラー) => コンソール.エラー(エラー));
1const myHeaders = new Headers();2myHeaders.append("Accept", "application/json");3myHeaders.append("Content-Type", "application/json");45const raw = JSON.stringify({6"query": "{ health }"7});89const requestOptions = {10メソッド: "POST",11ヘッダー: myHeaders,12本文: raw,13リダイレクト: "follow"14};1516fetch(「https://docs-demo.fuel-mainnet.quiknode.pro/v1/graphql」, requestOptions)17.その後((レスポンス) => レスポンス.text())18.その後((結果) => コンソール.log(result))19.catchcatch((エラー) => コンソール.エラー(エラー));
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.error('エラー:', エラー));
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.error('エラー:', エラー));
1import リクエスト2import json34url = "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, データ=ペイロード)1516印刷(レスポンス.text)17
1import リクエスト2import json34url = "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, データ=ペイロード)1516印刷(レスポンス.text)17
1require "uri"2require "json"3require "net/http"45url = URI("https://docs-demo.fuel-mainnet.quiknode.pro/v1/graphql")67https = ネット::HTTP.new(url.ホスト, url.ポート)8https.use_ssl = true910リクエスト = ネット::HTTP::POST.new(URL)11リクエスト[「承諾」] = "application/json"12リクエスト["Content-Type"] = "application/json"13リクエスト.本文 = JSON.dump({14"query": "{ health }"15})1617回答 = https.リクエスト(リクエスト)18レスポンスを格納する.read_body19
1require "uri"2require "json"3require "net/http"45url = URI("https://docs-demo.fuel-mainnet.quiknode.pro/v1/graphql")67https = ネット::HTTP.new(url.ホスト, url.ポート)8https.use_ssl = true910リクエスト = ネット::HTTP::POST.new(URL)11リクエスト[「承諾」] = "application/json"12リクエスト["Content-Type"] = "application/json"13リクエスト.本文 = JSON.dump({14"query": "{ health }"15})1617回答 = https.リクエスト(リクエスト)18レスポンスを格納する.read_body19