This was created during my time as a student at Code Chrysalis
An API that will return NBA players with their current team.
npm install
npm run start
ornpm run dev
for the dev environment- Access localhost:4000/graphql for the graphql playground
DATABASE_URL
PORT
A NBA / basketball Player
Field | Type | Description |
---|---|---|
id | Int | Auto-incremented id |
firstName! | String | Player's first name |
lastName! | String | Player's last name |
height | Int | Player's height in centimeters |
weight | Int | Player's weight in kilograms |
currentTeam | Team | Player's current team |
dateOfBirth | DateTime | Player's date of birth |
A NBA / basketball team
Field | Type | Description |
---|---|---|
id | Int | Auto-incremented id |
name! | String | Team name |
abbreviation | String | Team abbreviation (eg: LAL) |
homeArena | String | Name of home arena |
players | [Player] | List of current NBA / basketball players |
Get all NBA / basketball players
Return Type: [Player]
Input: none
Get one NBA / basketball player by id
Return Type: Player
Input: (id: Int!)
Get NBA / basketball players by team id
Return Type: Player
Input: (teamId: Int!)
Get NBA / basketball players by name (firstName, lastName)
Return Type: Player
Input: (firstName: String!, lastName: String!)
Get NBA / basketball players by partial name (name in first or last name)
Return Type: Player
Input: (partialName: String!)
Get all NBA / basketball team
Return Type: [Team]
Input: none
Get one NBA / basketball team by id
Return Type: Team
Input: (id: Int!)
Get one NBA / basketball team by name
Return Type: Team
Input: (name: String!)
Create a NBA / basketball player
Return Type: Player
Input: (data: PlayerCreateInput!)
Update a NBA / basketball player by id
Return Type: Player
Input: (id: Int!, data: PlayerUpdateInput!)
Delete a NBA / basketball player by id
Return Type: Player
Input: (id: Int!)
Create a NBA / basketball team
Return Type: Team
Input: (data: TeamCreateInput!)
Update a NBA / basketball team by id
Return Type: Team
Input: (id: Int!, data: TeamUpdateInput!)
Delete a NBA / basketball Team
Return Type: Team
Input: (id: Int!)
Field | Type | Description |
---|---|---|
firstName! | String | Player's first name |
lastName! | String | Player's last name |
height | Int | Player's height in centimeters |
weight | Int | Player's weight in kilograms |
currentTeamId | Int | Player's current team's id |
Field | Type | Description |
---|---|---|
firstName! | String | Player's first name |
lastName! | String | Player's last name |
height | Int | Player's height in centimeters |
weight | Int | Player's weight in kilograms |
currentTeamId | Int | Player's current team's id |
Field | Type | Description |
---|---|---|
name! | String | Team name |
abbreviation | String | Team abbreviation (eg: LAL) |
homeArena | String | Name of home arena |
Field | Type | Description |
---|---|---|
name! | String | Team name |
abbreviation | String | Team abbreviation (eg: LAL) |
homeArena | String | Name of home arena |