android 如何获取leetcode图形模式

xriantvc  于 2023-01-03  发布在  Android
关注(0)|答案(2)|浏览(117)

图纸代码图Ql链接:https://leetcode.com/graphql
我正在使用apollo android sendBox请求架构:https://studio.apollographql.com/sandbox/explorer
我的疑问:

query getUserProfile($username: String!) {
  matchedUser(username: $username) {
    username
    submitStats: submitStatsGlobal {
      acSubmissionNum {
        difficulty
        count
        submissions
      }
    }
  }
}

但当我输入上面的网址它给无法到达服务器

kqqjbcuj

kqqjbcuj1#

?query=query 
{ 
    matchedUser(username: "user4029ok") 
    {
        username
        submitStats: submitStatsGlobal 
        {
            acSubmissionNum 
            {
                difficulty
                count
                submissions
            }
        }
    }
}

//在www.example.com之后尝试此操作leetcode.com/graphql/

cnjp1d6j

cnjp1d6j2#

查看浏览器的网络选项卡后,我能够确定几个端点:

https://leetcode.com/graphql?query=query
{     
      userContestRanking(username:  "YOUR_USERNAME") 
      {
        attendedContestsCount
        rating
        globalRanking
        totalParticipants
        topPercentage    
      }
      userContestRankingHistory(username: "YOUR_USERNAME")
      {
        attended
        trendDirection
        problemsSolved
        totalProblems
        finishTimeInSeconds
        rating
        ranking
        contest 
        {
          title
          startTime
        }
      }
}

回答样本e:

"data": {
    "userContestRanking": {
      "attendedContestsCount": 60,
      "rating": 1745.1129418722594,
      "globalRanking": 32151,
      "totalParticipants": 350123,
      "topPercentage": 9.59
    },
    "userContestRankingHistory": [
      {
        "attended": false,
        "trendDirection": "NONE",
        "problemsSolved": 0,
        "totalProblems": 3,
        "finishTimeInSeconds": 0,
        "rating": 1500.0,
        "ranking": 0,
        "contest": {
          "title": "Weekly Contest 2",
          "startTime": 1472347800
        }
      },
      {
        "attended": false,
        "trendDirection": "NONE",
        "problemsSolved": 0,
        "totalProblems": 4,
        "finishTimeInSeconds": 0,
        "rating": 1500.0,
        "ranking": 0,
        "contest": {
          "title": "Weekly Contest 3",
          "startTime": 1472990400
        }
      }
}

相关问题