-
Notifications
You must be signed in to change notification settings - Fork 376
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* added graphql module * added graphql module Co-authored-by: Konstantin Metto <[email protected]>
- Loading branch information
Showing
4 changed files
with
227 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
.idea/ | ||
.dcignore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,200 @@ | ||
# Assignment: Graphql Service | ||
|
||
## Description | ||
|
||
Imagine we have a couple of microservices that is created for the service Musicify, a new wikipedia for Music. We need to provide a confortable and convinient service for our users for managing and retrieving data for different entities. | ||
|
||
The following entities exists: | ||
|
||
```typescript | ||
interface Artist { | ||
_id: string; | ||
firstName: string; | ||
secondName: string; | ||
middleName: string; | ||
birthDate: string; | ||
birthPlace: string; | ||
deathDate: string; | ||
deathPlace: string; | ||
country: string; | ||
bandsIds: string[] | ||
instruments: string[]; | ||
pseudonims: string[] | ||
labels: string[]; | ||
} | ||
``` | ||
|
||
```typescript | ||
interface User { | ||
_id: string; | ||
firstName: string; | ||
secondName: string; | ||
middleName: string; | ||
password: string; | ||
email: string; | ||
} | ||
``` | ||
|
||
```typescript | ||
interface Band { | ||
_id: string; | ||
name: string; | ||
origin: string; | ||
yearsActive: string[]; | ||
labels: string[]; | ||
membersIds: string[]; | ||
pastMembers: string; | ||
website: string; | ||
genresIds: string[]; | ||
logo: string; | ||
} | ||
``` | ||
|
||
```typescript | ||
interface Genre { | ||
_id: string; | ||
name: string; | ||
description: string; | ||
country: string; | ||
year: string; | ||
subGenresIds: string[]; | ||
} | ||
``` | ||
|
||
```typescript | ||
interface Track { | ||
_id: string; | ||
artists: Artist[]; | ||
bands: Band[]; | ||
year: number; | ||
albumId: string; | ||
name: string; | ||
description: string; | ||
lyrics: string; | ||
length: number; | ||
authorsIds: number; | ||
} | ||
``` | ||
|
||
|
||
**Details:** | ||
|
||
1. For each entity there is a separate microservice, you can find all microservices in corresponding repositories: | ||
|
||
- Artists service | ||
- Users service | ||
- Bands service | ||
- Genres service | ||
- Tracks service | ||
- Favourites service | ||
|
||
The instruction how to launch it you can find in service readme.md. | ||
|
||
2. The Following types should be created: | ||
|
||
```graphql | ||
type Artist { | ||
id: ID! | ||
firstName: String | ||
secondName: String | ||
middleName: String | ||
birthDate: String | ||
birthPlace: String | ||
deathDate: String | ||
deathPlace: String | ||
country: String | ||
bands: String | ||
instruments: String | ||
pseudonims: String | ||
labels: String | ||
} | ||
|
||
``` | ||
```graphql | ||
type Artist { | ||
id: ID! | ||
name: String | ||
origin: String | ||
yearsActive: String | ||
labels: String | ||
members: [Member] | ||
pastMembers: String | ||
website: String | ||
genres: String | ||
logo: String | ||
} | ||
|
||
``` | ||
```graphql | ||
type Genre { | ||
id: ID! | ||
name: String | ||
description: String | ||
country: String | ||
year: Int | ||
subGenres: [Genre] | ||
} | ||
|
||
``` | ||
|
||
type Favourites { | ||
id: ID! | ||
name: String | ||
description: String | ||
country: String | ||
year: Int | ||
subGenres: [Genre] | ||
} | ||
|
||
3. The following queries ahould be created: | ||
|
||
- artist | ||
- artists | ||
- genre | ||
- genres | ||
- track | ||
- tracks | ||
- band | ||
- bands | ||
- favourites (available only for logged in user) | ||
|
||
The following mutation should be created: | ||
|
||
- createArtist | ||
- deleteArtist | ||
- updateArtist | ||
- createGenre | ||
- deleteGenre | ||
- updateGenre | ||
- createBand | ||
- deleteBand | ||
- updateBand | ||
- createTrack | ||
- deleteTrack | ||
- updateTrack | ||
- addTrackToFavourites | ||
- addBandToFavourites | ||
- addArtistToFavourites | ||
- addGenreToFavourites | ||
|
||
**Mutation requests must be available only for logged in users.** | ||
|
||
4. Service port should be configured through env variable. | ||
|
||
5. Each entity must have a separate module. | ||
|
||
``` | ||
- app | ||
-modules | ||
- bands | ||
- artists | ||
- tracks | ||
- genres | ||
- favourites | ||
``` | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Scoring: Graphql Service | ||
|
||
## Basic Scope | ||
|
||
- **+20** The repository with the application contains a `Readme.md` file containing detailed instructions for installing, running and using the application | ||
- **+20** The application code that worked with `Users` instance divided into modules according to to its purpose and Nest.js architecture conventions (work with request and response in controller, business logic in service, etc.) | ||
- **+20** The application code that worked with `Tracks` instance instance divided into modules according to to its purpose and Nest.js architecture conventions (work with request and response in controller, business logic in service, etc.) | ||
- **+20** The application code that worked with `Albums` instance instance divided into modules according to to its purpose and Nest.js architecture conventions (work with request and response in controller, business logic in service, etc.) | ||
- **+20** The application code that worked with `Artists` instance instance divided into modules according to to its purpose and Nest.js architecture conventions (work with request and response in controller, business logic in service, etc.) | ||
- **+20** The application code that worked with `Favorites` instance instance divided into modules according to to its purpose and Nest.js architecture conventions (work with request and response in controller, business logic in service, etc.) | ||
|
||
## Forfeits | ||
|
||
- **-200** Changes in tests | ||
- **-150** Full link to repository differs from https://github.com/%your-gihub-id%/nodejs2022Q2-service | ||
- **-30% of max task score** Commits after deadline (except commits that affect only Readme.md, .gitignore, etc.) | ||
- **-20** No separate development branch | ||
- **-20** No Pull Request | ||
- **-10** Pull Request description is incorrect | ||
- **-10** Every lint error after npm run lint using local config (errors, not warnings) | ||
- **-20** Less than 3 commits in the development branch, not including commits that make changes only to `Readme.md` or similar files (`tsconfig.json`, `.gitignore`, `.prettierrc.json`, etc.) |