首页
学习
活动
专区
圈层
工具
发布
    • 综合排序
    • 最热优先
    • 最新优先
    时间不限
  • 来自专栏大数据

    C# 一分钟浅谈:GraphQL 客户端调用

    GraphQL.Client.Http; public class GraphQLClientService { private readonly IGraphQLClient _graphQLClient ; public GraphQLClientService(string url) { _graphQLClient = new GraphQLHttpClient string Email { get; set; } } public class GraphQLClientService { private readonly IGraphQLClient _graphQLClient ; public GraphQLClientService(string url) { _graphQLClient = new GraphQLHttpClient(url ; public GraphQLClientService(string url) { _graphQLClient = new GraphQLHttpClient(url

    65010编辑于 2024-12-03
  • 来自专栏后端

    C# 一分钟浅谈:GraphQL 客户端调用

    GraphQL.Client.Http; public class GraphQLClientService { private readonly IGraphQLClient _graphQLClient ; public GraphQLClientService(string url) { _graphQLClient = new GraphQLHttpClient public string Email { get; set; }}public class GraphQLClientService{ private readonly IGraphQLClient _graphQLClient ; public GraphQLClientService(string url) { _graphQLClient = new GraphQLHttpClient(url, ; public GraphQLClientService(string url) { _graphQLClient = new GraphQLHttpClient(url,

    63210编辑于 2024-11-30
  • 来自专栏各类技术文章~

    如何使用 Nx、Next.js 和 TypeScript 构建 Monorepo

    ; const createClient = (initialState) => { return new GraphQLClient({ ssrMode: typeof window = = graphQLClient ?? ) { graphQLClient.cache = memCache({ initialState: Object.assign( graphQLClient.cache.getInitialState graphQLClient) { graphQLClient = _graphQLClient; } return _graphQLClient; }; export const useGraphQLClient /lib/graphql-client"; const NextApp = ({ Component, pageProps }: AppProps) => { const graphQLClient

    7K51发布于 2021-09-13
  • 来自专栏深入浅出区块链技术

    使用TheGraph 获取Uniswap数据(c#)

    public class Uniswap : IUniswap { private readonly IGraphQLClient _graphQLClient; public Uniswap (IGraphQLClient graphQLHttpClient) { _graphQLClient = graphQLHttpClient ?? 现在我们可以通过使用 GraphQL 客户端(SendQueryAsync.cs)中的SendQueryAsync方法来调用 API: GraphQLResponse<Pools> response = await _graphQLClient.SendQueryAsync ); }); services.AddSingleton<IUniswap>(ctx => { IGraphQLClient graphQLClient = ctx.GetRequiredService<IGraphQLClient>(); return new Uniswap(graphQLClient); }

    2.6K31发布于 2021-02-25
  • 来自专栏跨界架构师

    记一次通过c#运用GraphQL调用Github api

    }; var graphQLClient = new GraphQLClient("https://api.github.com/graphql"); graphQLClient.DefaultRequestHeaders.UserAgent.Add graphQLClient.DefaultRequestHeaders.Add("Authorization", "bearer token"); //这里的token是个占位,实际需要在Github var graphQLResponse = graphQLClient.PostAsync(heroRequest).Result;   关于token的生成以及其它的一些环境准备工作,在github上有详细的描述

    1.7K20发布于 2018-09-10
  • 来自专栏程序员分享

    从零到一:在 React 前端中集成 The Graph 查询 NFT 持有者数据实战

    install graphql-request graphql然后,创建一个服务文件 src/services/theGraph.ts:typescript 体验AI代码助手 代码解读复制代码import { GraphQLClient GRAPHQL_ENDPOINT = 'https://api.thegraph.com/subgraphs/name/your-username/coolcats-holders';const client = new GraphQLClient 前端查询服务 src/services/theGraph.ts (完整)typescript 体验AI代码助手 代码解读复制代码import { GraphQLClient, gql } from 'graphql-request GRAPHQL_ENDPOINT = 'https://api.thegraph.com/subgraphs/name/your-username/coolcats-subgraph';const client = new GraphQLClient

    24940编辑于 2026-03-30
  • Agent Toolkit大揭秘:Python实现智能体调用外部API的5种方案

    } }}"""# 设置GraphQL API的URLurl = 'https://example-blog-api.com/graphql'# 创建一个GraphQL客户端class GraphQLClient else: raise Exception("请求失败,状态码: " + str(response.status_code))# 创建客户端实例并执行查询client = GraphQLClient 创建 GraphQL 客户端类:GraphQLClient类封装了与 GraphQL API 交互的逻辑。在构造函数中,我们传入 API 的 URL。 执行查询并打印结果:创建GraphQLClient实例,传入之前设置的 URL,然后调用execute方法执行查询,并打印出结果。

    2.5K10编辑于 2025-03-24
  • 来自专栏深入浅出区块链技术

    Uniswap V2 源码学习 (四). 签名和路由

    export class V2SubgraphProvider implements IV2SubgraphProvider { private client: GraphQLClient; throw new Error(`No subgraph url for chain id: ${this.chainId}`); } this.client = new GraphQLClient

    1.6K20编辑于 2022-05-25
  • 来自专栏爪哇学习日记

    Github主页美化-基础构建

    GraphQL API] ​ GraphQL API为开发者提供了一个Explorer工具,可以授予Github账号相关权限便于请求API,通过侧边栏搜索API文档内容 图片 ​ 此处通过graphqlclient

    1.8K20编辑于 2022-08-30
领券