GraphQL GHIN Wrapper

Posted by Greg Stephens on May 31, 2018 · 1 min read

graphql-ghin-wrapper

GraphQL wrapper API for the Golf Handicap and Information Network (GHIN). The GHIN system is used to track and calculate golfer handicaps.

This GraphQL server uses the Apollo Server with graphql-yoga.

Supported Functions

This version supports the following Queries:

  • getGolferById - Lookup golfer details by their GHIN number
  • getGolfers - Find golfers by name

Usage

git clone https://github.com/rgstephens/graphql-ghin-wrapper.git
cd graphql-ghin-wrapper
yarn
yarn start

Before running the server, you must set the GHIN password either by setting the GHIN_KEY environment variable or setting the it in the index.js file.

Example Queries

Find golfer by GHIN Number

{
  getGolferById(id: "331518") {
    ghinNum
    firstName
    lastName
    state
    handicapIndex
    trend
  }
}

Find golfer by Name & State

{
    getGolfers(state: "WA", lastName: "Smith", firstName: "B") {
        golferCount
        golfers {
          ghinNum
          firstName
          lastName
          trend
          handicapIndex
          email
          clubName
        }
    }
}