getNodeVersion 查询
参数
该方法不接受任何参数
退货
数据
对象
正在加载...
nodeInfo
对象
正在加载...
nodeVersion
字符串
正在加载...
请求
1curl --location 'https://docs-demo.fuel-mainnet.quiknode.pro/v1/graphql' \2--header 'Accept: application/json' \3--header 'Content-Type: application/json' \4--data '{5"query": "{ nodeInfo { nodeVersion } }"6}'
1curl --location 'https://docs-demo.fuel-mainnet.quiknode.pro/v1/graphql' \2--header 'Accept: application/json' \3--header 'Content-Type: application/json' \4--data '{5"query": "{ nodeInfo { nodeVersion } }"6}'
1const NODE_INFO_QUERY = `2query {3nodeInfo {4nodeVersion5}6}7`;89const fetchNodeInfo = async (): Promise<void> => {10试一试 {11const response = await fetch('https://docs-demo.fuel-mainnet.quiknode.pro/v1/graphql', {12方法: 'POST',13headers: {14“接受”: 'application/json',15“Content-Type”: 'application/json',16},17body: JSON.stringify({18查询: NODE_INFO_QUERY,19}),20});2122如果 (!响应.ok) {23throw new Error(`HTTP error! status: ${response.status}`);24}2526const 结果 = await response.json();27控制台.日志('Node 版本:', result.data.nodeInfo.节点版本);28} catch (error) {29控制台.错误('获取节点信息时出错:', 错误);30}31};3233fetchNodeInfo();34
1const NODE_INFO_QUERY = `2query {3nodeInfo {4nodeVersion5}6}7`;89const fetchNodeInfo = async (): Promise<void> => {10试一试 {11const response = await fetch('https://docs-demo.fuel-mainnet.quiknode.pro/v1/graphql', {12方法: 'POST',13headers: {14“接受”: 'application/json',15“Content-Type”: 'application/json',16},17body: JSON.stringify({18查询: NODE_INFO_QUERY,19}),20});2122如果 (!响应.ok) {23throw new Error(`HTTP error! status: ${response.status}`);24}2526const 结果 = await response.json();27控制台.日志('Node 版本:', result.data.nodeInfo.节点版本);28} catch (error) {29控制台.错误('获取节点信息时出错:', 错误);30}31};3233fetchNodeInfo();34
1const myHeaders = new Headers();2myHeaders.append("Accept", "application/json");3myHeaders.追加("Content-Type", "application/json");45const raw = JSON.stringify({6"query": "{ nodeInfo { nodeVersion } }"7});89const requestOptions = {10方法: "POST",11标题: myHeaders,12正文: raw,13重定向: "follow"14};1516fetch(“https://docs-demo.fuel-mainnet.quiknode.pro/v1/graphql”, requestOptions)17.然后((响应) => 响应.文本())18.然后((结果) => 控制台.log(result))19.catch((error) => 控制台.错误(error));
1const myHeaders = new Headers();2myHeaders.append("Accept", "application/json");3myHeaders.追加("Content-Type", "application/json");45const raw = JSON.stringify({6"query": "{ nodeInfo { nodeVersion } }"7});89const requestOptions = {10方法: "POST",11标题: myHeaders,12正文: raw,13重定向: "follow"14};1516fetch(“https://docs-demo.fuel-mainnet.quiknode.pro/v1/graphql”, requestOptions)17.然后((响应) => 响应.文本())18.然后((结果) => 控制台.log(result))19.catch((error) => 控制台.错误(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 内存缓存(),7fetch: fetch,8headers: {9“接受”: 'application/json',10“Content-Type”: 'application/json'11}12});1314const NODE_VERSION_QUERY = gql`15{16nodeInfo {17nodeVersion18}19}20`;2122客户.查询({23查询: NODE_VERSION_QUERY24})25.然后(结果 => {26控制台.日志('Node 版本:', result.data.nodeInfo.节点版本);27})28.catch(error => 控制台.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 内存缓存(),7fetch: fetch,8headers: {9“接受”: 'application/json',10“Content-Type”: 'application/json'11}12});1314const NODE_VERSION_QUERY = gql`15{16nodeInfo {17nodeVersion18}19}20`;2122客户.查询({23查询: NODE_VERSION_QUERY24})25.然后(结果 => {26控制台.日志('Node 版本:', result.data.nodeInfo.节点版本);27})28.catch(error => 控制台.error('错误:', 错误));
1导入 请求2import json34url = "https://docs-demo.fuel-mainnet.quiknode.pro/v1/graphql"56有效载荷 = json.dumps({7"query": "{ nodeInfo { nodeVersion } }"8})9标题 = {10“接受”: 'application/json',11“Content-Type”: 'application/json'12}1314回复 = 请求.请求("POST", url, headers=headers, data=有效载荷)1516打印(响应.text)17
1导入 请求2import json34url = "https://docs-demo.fuel-mainnet.quiknode.pro/v1/graphql"56有效载荷 = json.dumps({7"query": "{ nodeInfo { nodeVersion } }"8})9标题 = {10“接受”: 'application/json',11“Content-Type”: 'application/json'12}1314回复 = 请求.请求("POST", url, headers=headers, data=有效载荷)1516打印(响应.text)17
1require "uri"2require "json"3require "net/http"45url = URI("https://docs-demo.fuel-mainnet.quiknode.pro/v1/graphql")67https = Net::HTTP.new(url.主机, url.端口)8https.use_ssl = true910请求 = Net::HTTP::POST.new(url)11请求[“接受”] = "application/json"12请求["Content-Type"] = "application/json"13请求.请求体 = JSON.dump({14"query": "{ nodeInfo { nodeVersion } }"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 = Net::HTTP.new(url.主机, url.端口)8https.use_ssl = true910请求 = Net::HTTP::POST.new(url)11请求[“接受”] = "application/json"12请求["Content-Type"] = "application/json"13请求.请求体 = JSON.dump({14"query": "{ nodeInfo { nodeVersion } }"15})1617回复 = https.请求(请求)18返回响应.read_body19