使用 Cognito 用户池 ID 在 AWS 上调用 graphql api

Calling graphql api on AWS with Cognito user pool id

我花了两天时间在谷歌上搜索解决方案。但找不到合适的解决方案。 我获得了以下信息。

Cognito Identity pool ids: 
INT: "us-east-1:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
CRT: "us-east-1:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
PSS: "us-east-1:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
PREPROD: "us-east-1:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
PROD: "us-east-1:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"

Api url : https://xxxxxxxxxxxxxxxx.appsync-api.us-east-2.amazonaws.com/graphql
Api id : 63xxxxxxxxxxxxxxxxxx
Appsync name : TheAppSyncName
Authorization mechanism : IAM auth

我发现在 Android、https://github.com/awslabs/aws-mobile-appsync-sdk-android

中有几种不同的方法可以做到这一点

但找不到 .net c# AWS sdk 的示例。

谁能解释一下上述值的含义以及如何在 .net C# 中调用 graphql API?

更新: 多次尝试后,我最终没有任何解决方案。然后我发现 appsync 不能与 c# .net 中的给定信息一起使用。除了上述之外,我还获得了 AWS 帐号和未授权角色 ARN。

答案 将为您提供有关 AWS SDK 的一些背景信息。

如该答案所述,AWS SDK 不提供调用您的 API 的方法。要调用你 API 就像向你的 API url 发出 post 请求一样简单。 关于AppSync使用postman的回答有很多,可以帮助大家理解题目:

  • how to send graphql query by postman
  • how do I integrate amazon cognito login in postman

一旦您了解您应该能够对您选择的任何 HTTP 客户端执行相同的操作。