项目作者: antoniojps

项目描述 :
GraphQL wrapper for the PUBG API (deprecated)
高级语言: JavaScript
项目地址: git://github.com/antoniojps/graphql-pubg.git
创建时间: 2018-06-20T08:55:09Z
项目社区:https://github.com/antoniojps/graphql-pubg

开源协议:MIT License

下载


  1. - Warning: this project is not being maintained and it's usage is not recommended.

graphql-pubg

GraphQL-pubg

PUBG API aggregator on top of GraphQL

How to start the server?

  1. Clone the repository
    1. $ git clone https://github.com/antoniojps/graphql-pubg.git
    2. $ cd graphql-pubg
  2. Paste your API KEY to .env

    • create .env file from .env.example (just remove .example) and add your API KEY
  3. Install dependencies and start the server
  1. $ npm install
  2. // Starts both the webpack server as well as the graphQL server on 2 different ports
  3. $ npm start

GraphQL API

http://localhost:9000/graphql
.

Access GraphiQL

http://localhost:9000/graphiql

Example Queries:

The last 2 games of the player “shroud” in the North American server

  1. {
  2. player(name:"shroud",shards:"pc-na",matchesLimit:2){
  3. matches{
  4. id
  5. gameMode
  6. createdAt
  7. map
  8. isCustomMatch
  9. duration
  10. totalParticipants
  11. rosters{
  12. id
  13. slot
  14. stats{
  15. rank
  16. kills
  17. damage
  18. dbnos
  19. }
  20. participants{
  21. id
  22. name
  23. kills
  24. damage
  25. dbnos
  26. }
  27. }
  28. }
  29. }
  30. }

Get single match data

  1. {
  2. match(id:"47529205-1e29-4149-ac67-90907027c5f0",shards:"pc-eu"){
  3. id
  4. map
  5. isCustomMatch
  6. rosters{
  7. stats{
  8. rank
  9. kills
  10. damage
  11. }
  12. participants{
  13. name
  14. kills
  15. damage
  16. }
  17. }
  18. }
  19. }

Notes

  • Shards is defaulted to “pc-eu” on all queries
  • matchesLimit in the Player query is capped at 5 as of now (you can change this at Utils/filter/player.js on the function getPlayerMatchesArr
  • Error handling is really limited
  • No telemetry data

Docs for the Utils