Migrate to Netlify Today

Netlify announces the next evolution of Gatsby Cloud. Learn more

ContactSign Up
Community Plugin
View plugin on GitHub

gatsby-source-ttlive

This is a Gatsby source plugin that sources nodes from TT-Live.

An example site that uses this plugin can be found here: https://tt-live-scores.netlify.app/.

How to install

  1. Install dependency

    npm install --save gatsby-source-ttlive
  2. Add to gatsby-config.js

      {
          plugins: [
          `gatsby-source-ttlive`,
        ],
      }

Example query

This is an example query for loading all fixtures of a league sorted by date in descending order:

query LatestFixturesByLeagueId($leagueId: String!) {
  allFixture(
    filter: { league: { id: { eq: $leagueId } } }
    sort: { order: DESC, fields: date }
  ) {
    nodes {
      date
      link
      note
      nr
      homeTeam {
        name
      }
      guestTeam {
        name
      }
      result
    }
  }
}
© 2024 Gatsby, Inc.