|
1 | 1 | # The query/queries to access data MUST extend the Query type. |
2 | 2 | extend type Query { |
3 | | - # TODO: rename and add a description of this query |
4 | | - YourDataSource( |
5 | | - # TODO: Describe this argument |
6 | | - id: ID! |
7 | | - ): PFX_YourDataSource |
8 | | -} |
9 | | - |
10 | | -# TODO: Choose a unique prefix and rename the type descriptively. |
11 | | -type PFX_YourDataSource { |
12 | | - # The unique ID of the thing. |
13 | | - id: ID! |
14 | | - # Describe each field to help people use the data more effectively. |
15 | | - name: String |
16 | | - lucky_numbers: [Int] |
| 3 | + # Search for a movie by its title and (optionally) release year. |
| 4 | + searchMoviesByTitle( |
| 5 | + # Argument object with the title and year to search for. |
| 6 | + options: IMDB_MovieSearchInput |
| 7 | + ): [IMDB_Movie] |
| 8 | + # Get a given movie by its IMDB ID. |
| 9 | + getMovieById( |
| 10 | + # The IMDB ID of the movie to be loaded (e.g. “tt1677720”). |
| 11 | + movie_id: String! |
| 12 | + ): IMDB_Movie |
| 13 | + # Search for a person by name. |
| 14 | + # |
| 15 | + # A quirk of the IMDB API is that it seems to only return a single result for |
| 16 | + # searches, so keep that in mind when using this query. |
| 17 | + searchPersonByName( |
| 18 | + # The name to search for (e.g. “Idris Elba”). |
| 19 | + name: String! |
| 20 | + ): [IMDB_Person] |
| 21 | + # Search for a person by their IMDB ID. |
| 22 | + getPersonById( |
| 23 | + # The IMDB ID to search for (e.g. “nm0252961”). |
| 24 | + person_id: String! |
| 25 | + ): IMDB_Person |
| 26 | +} |
| 27 | + |
| 28 | +input IMDB_MovieSearchInput { |
| 29 | + # The title of the movie to search for (e.g. “Ready Player One”). |
| 30 | + title: String! |
| 31 | + # (Optional) The year the movie was released. |
| 32 | + year: String |
| 33 | +} |
| 34 | + |
| 35 | +type IMDB_Movie { |
| 36 | + cast: [IMDB_Cast]! |
| 37 | + content_rating: String! |
| 38 | + description: String! |
| 39 | + director: String! |
| 40 | + genre: [String]! |
| 41 | + imdb_id: String! |
| 42 | + length: String! |
| 43 | + metadata: IMDB_Metadata! |
| 44 | + original_title: String! |
| 45 | + poster: IMDB_Poster! |
| 46 | + rating: String! |
| 47 | + rating_count: String! |
| 48 | + release_date: String! |
| 49 | + stars: [String]! |
| 50 | + storyline: String! |
| 51 | + title: String! |
| 52 | + trailer: [IMDB_Trailer]! |
| 53 | + url: IMDB_Url! |
| 54 | + writers: [String]! |
| 55 | + year: String! |
| 56 | +} |
| 57 | + |
| 58 | +type IMDB_Cast { |
| 59 | + character: String! |
| 60 | + image: String! |
| 61 | + link: String! |
| 62 | + name: String! |
| 63 | +} |
| 64 | + |
| 65 | +type IMDB_Metadata { |
| 66 | + also_known_as: [String]! |
| 67 | + # The aspect ratio of the film. |
| 68 | + # |
| 69 | + # NOTE: This field has a typo on the API (`asp_retio`). |
| 70 | + asp_ratio: String! |
| 71 | + budget: String! |
| 72 | + countries: [String]! |
| 73 | + filming_locations: [String]! |
| 74 | + gross: String! |
| 75 | + languages: [String]! |
| 76 | + sound_mix: [String]! |
| 77 | +} |
| 78 | + |
| 79 | +type IMDB_Poster { |
| 80 | + large: String! |
| 81 | + thumb: String! |
| 82 | +} |
| 83 | + |
| 84 | +type IMDB_Trailer { |
| 85 | + definition: String! |
| 86 | + mimeType: String! |
| 87 | + videoUrl: String! |
| 88 | +} |
| 89 | + |
| 90 | +type IMDB_Url { |
| 91 | + title: String |
| 92 | + url: String! |
| 93 | + year: String |
| 94 | +} |
| 95 | + |
| 96 | +type IMDB_Person { |
| 97 | + birthday: String! |
| 98 | + birthplace: String! |
| 99 | + description: String! |
| 100 | + filmography(filter: String = "all"): [IMDB_Filmography]! |
| 101 | + image: IMDB_PersonImage! |
| 102 | + person_id: String! |
| 103 | + photos: [String]! |
| 104 | + title: String! |
| 105 | + type: [String]! |
| 106 | +} |
| 107 | + |
| 108 | +type IMDB_Filmography { |
| 109 | + position: String! |
| 110 | + imdb_id: String! |
| 111 | + title: String! |
| 112 | + type: String! |
| 113 | + url: String! |
| 114 | + year: String! |
| 115 | +} |
| 116 | + |
| 117 | +type IMDB_PersonImage { |
| 118 | + poster: String! |
| 119 | + thumb: String! |
17 | 120 | } |
0 commit comments