verfehlix / follower-info-graphql-api

GraphQL API based on Java Spring that serves follower information saved to a database by "follower-info-polling"

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

follower-info-graphql-api

GraphQL API based on Java Spring that serves follower information saved to a database by "follower-info-polling"

How to use

  • Have follower-info-polling running in the background
  • configure spring.datasource.url, spring.datasource.username and spring.datasource.password
    • either in resources/application.properties
    • or as command line parameter (e.g. --spring.datasource.url=jdbc:postgresql://localhost:5433/followerDB)

GraphQL Schema

type Query {
  followerInfo(
    startTimestamp: String,
    endTimestamp: String
  ) : [FollowerInfo]
}

type FollowerInfo {
    id: ID!
    timestamp: String!
    followerCount: Int
    followerList: [String]
}

Example

Call:

{
  followerInfo {
    timestamp
    followerCount
  }
}

Result:

{
  "data": {
    "followerInfo": [
      {
        "timestamp": "2019-02-19 18:13:46.47",
        "followerCount": 131
      },
      {
        "timestamp": "2019-02-19 18:12:46.47",
        "followerCount": 131
      },
      {
        "timestamp": "2019-02-19 18:11:46.47",
        "followerCount": 130
      },
      {
        "timestamp": "2019-02-19 18:09:46.471",
        "followerCount": 129
      }
    ]
  }
}

About

GraphQL API based on Java Spring that serves follower information saved to a database by "follower-info-polling"


Languages

Language:Java 100.0%