├── .gitignore ├── README.md ├── extend-client-fields-and-directives ├── .graphqlconfig ├── README.md ├── client-schema-extensions.js ├── component.js └── server-schema.js ├── gatsby ├── .graphqlconfig └── README.md ├── github-api-v4 ├── .graphqlconfig ├── README.md ├── github-introspection.png ├── github-query.graphql └── github-schema.graphql ├── relay ├── .graphqlconfig ├── README.md ├── components │ └── relay-component.jsx ├── relay-detection-notification.png ├── relay-detection.png ├── relay-schema.graphql └── relay-settings.png ├── remote-schema-introspection ├── .graphqlconfig ├── README.md ├── graphql-config-introspect.png ├── introspect-endpoint.png ├── introspect-re-run.png ├── introspect-startup.png └── remote-schema.graphql └── two-schemas-plus-shared-using-projects ├── .graphqlconfig ├── README.md ├── alpha └── alpha.graphql ├── beta └── beta.graphql └── shared └── shared.graphql /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | two-schemas-plus-shared-using-projects/.idea 3 | *.iml -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # GraphQL Config Project Examples for JS GraphQL IntelliJ Plugin 2.x 2 | 3 | The folders in this repository demonstrate how to setup schema discovery for JS GraphQL IntelliJ Plugin using graphql-config v2 `.graphqlconfig` files. 4 | 5 | See the `README.md` in each project folder for details. 6 | 7 | For additional information see: 8 | - https://github.com/kamilkisiela/graphql-config/tree/legacy 9 | - https://github.com/jimkyndemeyer/js-graphql-intellij-plugin 10 | -------------------------------------------------------------------------------- /extend-client-fields-and-directives/.graphqlconfig: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Client Extended GraphQL Schema", 3 | "includes": ["*"], 4 | "extensions": { 5 | "endpoints": { 6 | 7 | } 8 | } 9 | } -------------------------------------------------------------------------------- /extend-client-fields-and-directives/README.md: -------------------------------------------------------------------------------- 1 | # GraphQL Config Example: Client Fields and Directives 2 | 3 | This example demonstrates how to extend a server schema with client-only fields and demonstrates how to declare custom framework directives such as `@client`. 4 | 5 | See https://www.apollographql.com/docs/ for a popular GraphQL framework that uses this approach. -------------------------------------------------------------------------------- /extend-client-fields-and-directives/client-schema-extensions.js: -------------------------------------------------------------------------------- 1 | import gql from 'graphql-tag'; 2 | 3 | const clientSchemaExtensions = gql` 4 | 5 | "Indicates that the client should resolve the field value locally as part of a query, e.g. in a React component" 6 | directive @client on FIELD 7 | 8 | extend type Query { 9 | "Client-only field that indicates whether the user is logged in" 10 | isLoggedIn: Boolean 11 | } 12 | `; -------------------------------------------------------------------------------- /extend-client-fields-and-directives/component.js: -------------------------------------------------------------------------------- 1 | import gql from 'graphql-tag'; 2 | 3 | // declares a component query that wants to consume a client-only field 4 | const query = gql` 5 | query ComponentQuery { 6 | 7 | # returned by the client, e.g. via Apollo Link State or Apollo Core 2.5+ -- https://www.apollographql.com/docs/tutorial/local-state.html 8 | isLoggedIn @client 9 | 10 | # returned by the server 11 | serverData { 12 | valueFromServer 13 | } 14 | } 15 | `; -------------------------------------------------------------------------------- /extend-client-fields-and-directives/server-schema.js: -------------------------------------------------------------------------------- 1 | import gql from 'graphql-tag'; 2 | 3 | // defines the server schema using SDL 4 | // see https://www.apollographql.com/docs/ for a tutorial for building a GraphQL Server 5 | const schema = gql` 6 | type ServerType { 7 | valueFromServer: String! 8 | } 9 | 10 | type Query { 11 | serverData: ServerType 12 | } 13 | `; 14 | -------------------------------------------------------------------------------- /gatsby/.graphqlconfig: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Gatsby Schema", 3 | "schemaPath": "schema.graphql", 4 | "extensions": { 5 | "endpoints": { 6 | "Gatsby GraphQL Endpoint": { 7 | "url": "http://localhost:8000/___graphql", 8 | "headers": { 9 | "user-agent": "JS GraphQL" 10 | }, 11 | "introspect": true 12 | } 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /gatsby/README.md: -------------------------------------------------------------------------------- 1 | # GraphQL Config Example: Gatsby 2 | 3 | This example demonstrates how to connect to Gatsby GraphQL endpoint. 4 | Before connection make sure gatsby project is run in dev mode: `gatsby develop` 5 | -------------------------------------------------------------------------------- /github-api-v4/.graphqlconfig: -------------------------------------------------------------------------------- 1 | { 2 | "name": "GitHub API V4 GraphQL Schema", 3 | "schemaPath": "github-schema.graphql", 4 | "extensions": { 5 | "endpoints": { 6 | "GitHub API V4 GraphQL Endpoint": { 7 | "url": "https://api.github.com/graphql", 8 | "headers": { 9 | "Authorization": "Bearer ${env:GITHUB-ACCESS-TOKEN}", 10 | "user-agent": "JS GraphQL" 11 | }, 12 | "introspect": false 13 | } 14 | } 15 | } 16 | } -------------------------------------------------------------------------------- /github-api-v4/README.md: -------------------------------------------------------------------------------- 1 | # GraphQL Config Example: GitHub API V4 2 | 3 | This example demonstrates how to authenticate against the GitHub API by defining a bearer token as an environment variable 4 | in the `.graphqlconfig` file. 5 | 6 | __Notes and comments__ 7 | - If you're authoring a schema using GraphQL SDL, you should modularize it into multiple files to ensure a performant editing experience 8 | as the schema grows. 9 | -------------------------------------------------------------------------------- /github-api-v4/github-introspection.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jimkyndemeyer/graphql-config-examples/b417cbc065f8dbcbbef83cb727b616976f731f7f/github-api-v4/github-introspection.png -------------------------------------------------------------------------------- /github-api-v4/github-query.graphql: -------------------------------------------------------------------------------- 1 | { 2 | viewer { 3 | name 4 | login 5 | repositories(first: 10) { 6 | edges { 7 | node { 8 | name 9 | isFork 10 | } 11 | } 12 | } 13 | } 14 | } -------------------------------------------------------------------------------- /relay/.graphqlconfig: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Relay GraphQL Schema", 3 | "schemaPath": "relay-schema.graphql", 4 | "includes": ["components/**"], 5 | "extensions": { 6 | "endpoints": { 7 | "Default GraphQL Endpoint": { 8 | "url": "http://localhost:8080/graphql", 9 | "headers": { 10 | "user-agent": "JS GraphQL" 11 | }, 12 | "introspect": false 13 | } 14 | } 15 | } 16 | } -------------------------------------------------------------------------------- /relay/README.md: -------------------------------------------------------------------------------- 1 | # GraphQL Config Example: Relay (Modern) 2 | 3 | This example demonstrates how to setup a Relay Project -- https://facebook.github.io/relay/. 4 | 5 | 6 | At project startup the plugin looks for Relay Modern dependencies in `package.json` 7 | 8 | ![](relay-detection.png) 9 | 10 | You should then see the following notification 11 | 12 | ![](relay-detection-notification.png) 13 | 14 | This enables Relay framework support which can also be toggled in the settings panel: 15 | 16 | ![](relay-settings.png) 17 | 18 | Enabling Relay adjusts the behavior of error highlighting since Relay "polyfills" GraphQL 19 | with directives that have dynamic arguments. The Relay directives are automatically 20 | included in schema discovery when the setting is enabled. 21 | 22 | __Notes and comments__ 23 | - Relay component files (js, jsx, ts, tsx) must be explicitly allowed by the "includes" glob if one is specified to be associated with their schema. 24 | Note that you can use `*` and `**` in the globs since only file types supported by the plugin will be processed. 25 | - For the official Relay example see https://github.com/relayjs/relay-examples -------------------------------------------------------------------------------- /relay/components/relay-component.jsx: -------------------------------------------------------------------------------- 1 | // Note! Relay must be enabled in the Languages & Frameworks > GraphQL Settings for the directives to be enabled 2 | // See https://facebook.github.io/relay/docs/en/fragment-container.html 3 | const UserListContainer = createFragmentContainer( 4 | UserList, 5 | { 6 | viewer: graphql` 7 | fragment UserList_viewer on Viewer @argumentDefinitions( 8 | count: { type: "Int", defaultValue: 10 } 9 | cursor: { type: "String" } 10 | ) { 11 | id 12 | } 13 | `, 14 | } 15 | ); 16 | -------------------------------------------------------------------------------- /relay/relay-detection-notification.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jimkyndemeyer/graphql-config-examples/b417cbc065f8dbcbbef83cb727b616976f731f7f/relay/relay-detection-notification.png -------------------------------------------------------------------------------- /relay/relay-detection.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jimkyndemeyer/graphql-config-examples/b417cbc065f8dbcbbef83cb727b616976f731f7f/relay/relay-detection.png -------------------------------------------------------------------------------- /relay/relay-schema.graphql: -------------------------------------------------------------------------------- 1 | interface Node { 2 | id: ID! 3 | } 4 | 5 | type Viewer implements Node { 6 | id: ID! 7 | userName: String! 8 | } 9 | 10 | type Query { 11 | """ 12 | The currently logged in user that is viewing the product 13 | """ 14 | viewer : Viewer 15 | } -------------------------------------------------------------------------------- /relay/relay-settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jimkyndemeyer/graphql-config-examples/b417cbc065f8dbcbbef83cb727b616976f731f7f/relay/relay-settings.png -------------------------------------------------------------------------------- /remote-schema-introspection/.graphqlconfig: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Remote Schema", 3 | "schemaPath": "remote-schema.graphql", 4 | "extensions": { 5 | "endpoints": { 6 | "Remote SWAPI GraphQL Endpoint": { 7 | "url": "https://swapi-graphql.netlify.app/.netlify/functions/index", 8 | "headers": { 9 | "user-agent": "JS GraphQL" 10 | }, 11 | "introspect": true 12 | } 13 | } 14 | } 15 | } -------------------------------------------------------------------------------- /remote-schema-introspection/README.md: -------------------------------------------------------------------------------- 1 | # GraphQL Config Example: Remote Schema Introspection 2 | 3 | This example demonstrates how to use the endpoints configured in `.graphqlconfig` to fetch an existing remote schema. 4 | 5 | ![](graphql-config-introspect.png) 6 | 7 | With `introspect: true` the plugin asks at project startup whether to update the local schema using the configured endpoint. 8 | 9 | ![](introspect-startup.png) 10 | 11 | The update works by sending an introspection query to the endpoint, and then writing the result to the configured `schemaPath`. 12 | 13 | The latest introspection query can easily be re-run using the schemas panel: 14 | 15 | ![](introspect-re-run.png) 16 | 17 | Introspection queries can also be executed by double-clicking endpoints in the schemas tree view: 18 | 19 | ![](introspect-endpoint.png) 20 | 21 | __Notes and comments__ 22 | - If you're both developing the server schema and consuming it in a client, e.g. via component queries, you'll get the best tooling by having your schema expressed using GraphQL Schema Definition Language directly in your project. With that setup the plugin immediately discovers your schema, and you don't have to perform an introspection after server schema changes. 23 | - Tip: The re-run introspection action can be bound to a keyboard shortcut for convenience 24 | -------------------------------------------------------------------------------- /remote-schema-introspection/graphql-config-introspect.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jimkyndemeyer/graphql-config-examples/b417cbc065f8dbcbbef83cb727b616976f731f7f/remote-schema-introspection/graphql-config-introspect.png -------------------------------------------------------------------------------- /remote-schema-introspection/introspect-endpoint.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jimkyndemeyer/graphql-config-examples/b417cbc065f8dbcbbef83cb727b616976f731f7f/remote-schema-introspection/introspect-endpoint.png -------------------------------------------------------------------------------- /remote-schema-introspection/introspect-re-run.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jimkyndemeyer/graphql-config-examples/b417cbc065f8dbcbbef83cb727b616976f731f7f/remote-schema-introspection/introspect-re-run.png -------------------------------------------------------------------------------- /remote-schema-introspection/introspect-startup.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jimkyndemeyer/graphql-config-examples/b417cbc065f8dbcbbef83cb727b616976f731f7f/remote-schema-introspection/introspect-startup.png -------------------------------------------------------------------------------- /remote-schema-introspection/remote-schema.graphql: -------------------------------------------------------------------------------- 1 | # This file was generated based on ".graphqlconfig". Do not edit manually. 2 | 3 | schema { 4 | query: Root 5 | } 6 | 7 | "An object with an ID" 8 | interface Node { 9 | "The id of the object." 10 | id: ID! 11 | } 12 | 13 | "A single film." 14 | type Film implements Node { 15 | characterConnection(after: String, before: String, first: Int, last: Int): FilmCharactersConnection 16 | "The ISO 8601 date format of the time that this resource was created." 17 | created: String 18 | "The name of the director of this film." 19 | director: String 20 | "The ISO 8601 date format of the time that this resource was edited." 21 | edited: String 22 | "The episode number of this film." 23 | episodeID: Int 24 | "The ID of an object" 25 | id: ID! 26 | "The opening paragraphs at the beginning of this film." 27 | openingCrawl: String 28 | planetConnection(after: String, before: String, first: Int, last: Int): FilmPlanetsConnection 29 | "The name(s) of the producer(s) of this film." 30 | producers: [String] 31 | "The ISO 8601 date format of film release at original creator country." 32 | releaseDate: String 33 | speciesConnection(after: String, before: String, first: Int, last: Int): FilmSpeciesConnection 34 | starshipConnection(after: String, before: String, first: Int, last: Int): FilmStarshipsConnection 35 | "The title of this film." 36 | title: String 37 | vehicleConnection(after: String, before: String, first: Int, last: Int): FilmVehiclesConnection 38 | } 39 | 40 | "A connection to a list of items." 41 | type FilmCharactersConnection { 42 | """ 43 | A list of all of the objects returned in the connection. This is a convenience 44 | field provided for quickly exploring the API; rather than querying for 45 | \"{ edges { node } }\" when no edge data is needed, this field can be be used 46 | instead. Note that when clients like Relay need to fetch the \"cursor\" field on 47 | the edge to enable efficient pagination, this shortcut cannot be used, and the 48 | full \"{ edges { node } }\" version should be used instead. 49 | """ 50 | characters: [Person] 51 | "A list of edges." 52 | edges: [FilmCharactersEdge] 53 | "Information to aid in pagination." 54 | pageInfo: PageInfo! 55 | """ 56 | A count of the total number of objects in this connection, ignoring pagination. 57 | This allows a client to fetch the first five objects by passing \"5\" as the 58 | argument to \"first\", then fetch the total count so it could display \"5 of 83\", 59 | for example. 60 | """ 61 | totalCount: Int 62 | } 63 | 64 | "An edge in a connection." 65 | type FilmCharactersEdge { 66 | "A cursor for use in pagination" 67 | cursor: String! 68 | "The item at the end of the edge" 69 | node: Person 70 | } 71 | 72 | "A connection to a list of items." 73 | type FilmPlanetsConnection { 74 | "A list of edges." 75 | edges: [FilmPlanetsEdge] 76 | "Information to aid in pagination." 77 | pageInfo: PageInfo! 78 | """ 79 | A list of all of the objects returned in the connection. This is a convenience 80 | field provided for quickly exploring the API; rather than querying for 81 | \"{ edges { node } }\" when no edge data is needed, this field can be be used 82 | instead. Note that when clients like Relay need to fetch the \"cursor\" field on 83 | the edge to enable efficient pagination, this shortcut cannot be used, and the 84 | full \"{ edges { node } }\" version should be used instead. 85 | """ 86 | planets: [Planet] 87 | """ 88 | A count of the total number of objects in this connection, ignoring pagination. 89 | This allows a client to fetch the first five objects by passing \"5\" as the 90 | argument to \"first\", then fetch the total count so it could display \"5 of 83\", 91 | for example. 92 | """ 93 | totalCount: Int 94 | } 95 | 96 | "An edge in a connection." 97 | type FilmPlanetsEdge { 98 | "A cursor for use in pagination" 99 | cursor: String! 100 | "The item at the end of the edge" 101 | node: Planet 102 | } 103 | 104 | "A connection to a list of items." 105 | type FilmSpeciesConnection { 106 | "A list of edges." 107 | edges: [FilmSpeciesEdge] 108 | "Information to aid in pagination." 109 | pageInfo: PageInfo! 110 | """ 111 | A list of all of the objects returned in the connection. This is a convenience 112 | field provided for quickly exploring the API; rather than querying for 113 | \"{ edges { node } }\" when no edge data is needed, this field can be be used 114 | instead. Note that when clients like Relay need to fetch the \"cursor\" field on 115 | the edge to enable efficient pagination, this shortcut cannot be used, and the 116 | full \"{ edges { node } }\" version should be used instead. 117 | """ 118 | species: [Species] 119 | """ 120 | A count of the total number of objects in this connection, ignoring pagination. 121 | This allows a client to fetch the first five objects by passing \"5\" as the 122 | argument to \"first\", then fetch the total count so it could display \"5 of 83\", 123 | for example. 124 | """ 125 | totalCount: Int 126 | } 127 | 128 | "An edge in a connection." 129 | type FilmSpeciesEdge { 130 | "A cursor for use in pagination" 131 | cursor: String! 132 | "The item at the end of the edge" 133 | node: Species 134 | } 135 | 136 | "A connection to a list of items." 137 | type FilmStarshipsConnection { 138 | "A list of edges." 139 | edges: [FilmStarshipsEdge] 140 | "Information to aid in pagination." 141 | pageInfo: PageInfo! 142 | """ 143 | A list of all of the objects returned in the connection. This is a convenience 144 | field provided for quickly exploring the API; rather than querying for 145 | \"{ edges { node } }\" when no edge data is needed, this field can be be used 146 | instead. Note that when clients like Relay need to fetch the \"cursor\" field on 147 | the edge to enable efficient pagination, this shortcut cannot be used, and the 148 | full \"{ edges { node } }\" version should be used instead. 149 | """ 150 | starships: [Starship] 151 | """ 152 | A count of the total number of objects in this connection, ignoring pagination. 153 | This allows a client to fetch the first five objects by passing \"5\" as the 154 | argument to \"first\", then fetch the total count so it could display \"5 of 83\", 155 | for example. 156 | """ 157 | totalCount: Int 158 | } 159 | 160 | "An edge in a connection." 161 | type FilmStarshipsEdge { 162 | "A cursor for use in pagination" 163 | cursor: String! 164 | "The item at the end of the edge" 165 | node: Starship 166 | } 167 | 168 | "A connection to a list of items." 169 | type FilmVehiclesConnection { 170 | "A list of edges." 171 | edges: [FilmVehiclesEdge] 172 | "Information to aid in pagination." 173 | pageInfo: PageInfo! 174 | """ 175 | A count of the total number of objects in this connection, ignoring pagination. 176 | This allows a client to fetch the first five objects by passing \"5\" as the 177 | argument to \"first\", then fetch the total count so it could display \"5 of 83\", 178 | for example. 179 | """ 180 | totalCount: Int 181 | """ 182 | A list of all of the objects returned in the connection. This is a convenience 183 | field provided for quickly exploring the API; rather than querying for 184 | \"{ edges { node } }\" when no edge data is needed, this field can be be used 185 | instead. Note that when clients like Relay need to fetch the \"cursor\" field on 186 | the edge to enable efficient pagination, this shortcut cannot be used, and the 187 | full \"{ edges { node } }\" version should be used instead. 188 | """ 189 | vehicles: [Vehicle] 190 | } 191 | 192 | "An edge in a connection." 193 | type FilmVehiclesEdge { 194 | "A cursor for use in pagination" 195 | cursor: String! 196 | "The item at the end of the edge" 197 | node: Vehicle 198 | } 199 | 200 | "A connection to a list of items." 201 | type FilmsConnection { 202 | "A list of edges." 203 | edges: [FilmsEdge] 204 | """ 205 | A list of all of the objects returned in the connection. This is a convenience 206 | field provided for quickly exploring the API; rather than querying for 207 | \"{ edges { node } }\" when no edge data is needed, this field can be be used 208 | instead. Note that when clients like Relay need to fetch the \"cursor\" field on 209 | the edge to enable efficient pagination, this shortcut cannot be used, and the 210 | full \"{ edges { node } }\" version should be used instead. 211 | """ 212 | films: [Film] 213 | "Information to aid in pagination." 214 | pageInfo: PageInfo! 215 | """ 216 | A count of the total number of objects in this connection, ignoring pagination. 217 | This allows a client to fetch the first five objects by passing \"5\" as the 218 | argument to \"first\", then fetch the total count so it could display \"5 of 83\", 219 | for example. 220 | """ 221 | totalCount: Int 222 | } 223 | 224 | "An edge in a connection." 225 | type FilmsEdge { 226 | "A cursor for use in pagination" 227 | cursor: String! 228 | "The item at the end of the edge" 229 | node: Film 230 | } 231 | 232 | "Information about pagination in a connection." 233 | type PageInfo { 234 | "When paginating forwards, the cursor to continue." 235 | endCursor: String 236 | "When paginating forwards, are there more items?" 237 | hasNextPage: Boolean! 238 | "When paginating backwards, are there more items?" 239 | hasPreviousPage: Boolean! 240 | "When paginating backwards, the cursor to continue." 241 | startCursor: String 242 | } 243 | 244 | "A connection to a list of items." 245 | type PeopleConnection { 246 | "A list of edges." 247 | edges: [PeopleEdge] 248 | "Information to aid in pagination." 249 | pageInfo: PageInfo! 250 | """ 251 | A list of all of the objects returned in the connection. This is a convenience 252 | field provided for quickly exploring the API; rather than querying for 253 | \"{ edges { node } }\" when no edge data is needed, this field can be be used 254 | instead. Note that when clients like Relay need to fetch the \"cursor\" field on 255 | the edge to enable efficient pagination, this shortcut cannot be used, and the 256 | full \"{ edges { node } }\" version should be used instead. 257 | """ 258 | people: [Person] 259 | """ 260 | A count of the total number of objects in this connection, ignoring pagination. 261 | This allows a client to fetch the first five objects by passing \"5\" as the 262 | argument to \"first\", then fetch the total count so it could display \"5 of 83\", 263 | for example. 264 | """ 265 | totalCount: Int 266 | } 267 | 268 | "An edge in a connection." 269 | type PeopleEdge { 270 | "A cursor for use in pagination" 271 | cursor: String! 272 | "The item at the end of the edge" 273 | node: Person 274 | } 275 | 276 | "An individual person or character within the Star Wars universe." 277 | type Person implements Node { 278 | """ 279 | The birth year of the person, using the in-universe standard of BBY or ABY - 280 | Before the Battle of Yavin or After the Battle of Yavin. The Battle of Yavin is 281 | a battle that occurs at the end of Star Wars episode IV: A New Hope. 282 | """ 283 | birthYear: String 284 | "The ISO 8601 date format of the time that this resource was created." 285 | created: String 286 | "The ISO 8601 date format of the time that this resource was edited." 287 | edited: String 288 | """ 289 | The eye color of this person. Will be \"unknown\" if not known or \"n/a\" if the 290 | person does not have an eye. 291 | """ 292 | eyeColor: String 293 | filmConnection(after: String, before: String, first: Int, last: Int): PersonFilmsConnection 294 | """ 295 | The gender of this person. Either \"Male\", \"Female\" or \"unknown\", 296 | \"n/a\" if the person does not have a gender. 297 | """ 298 | gender: String 299 | """ 300 | The hair color of this person. Will be \"unknown\" if not known or \"n/a\" if the 301 | person does not have hair. 302 | """ 303 | hairColor: String 304 | "The height of the person in centimeters." 305 | height: Int 306 | "A planet that this person was born on or inhabits." 307 | homeworld: Planet 308 | "The ID of an object" 309 | id: ID! 310 | "The mass of the person in kilograms." 311 | mass: Float 312 | "The name of this person." 313 | name: String 314 | "The skin color of this person." 315 | skinColor: String 316 | "The species that this person belongs to, or null if unknown." 317 | species: Species 318 | starshipConnection(after: String, before: String, first: Int, last: Int): PersonStarshipsConnection 319 | vehicleConnection(after: String, before: String, first: Int, last: Int): PersonVehiclesConnection 320 | } 321 | 322 | "A connection to a list of items." 323 | type PersonFilmsConnection { 324 | "A list of edges." 325 | edges: [PersonFilmsEdge] 326 | """ 327 | A list of all of the objects returned in the connection. This is a convenience 328 | field provided for quickly exploring the API; rather than querying for 329 | \"{ edges { node } }\" when no edge data is needed, this field can be be used 330 | instead. Note that when clients like Relay need to fetch the \"cursor\" field on 331 | the edge to enable efficient pagination, this shortcut cannot be used, and the 332 | full \"{ edges { node } }\" version should be used instead. 333 | """ 334 | films: [Film] 335 | "Information to aid in pagination." 336 | pageInfo: PageInfo! 337 | """ 338 | A count of the total number of objects in this connection, ignoring pagination. 339 | This allows a client to fetch the first five objects by passing \"5\" as the 340 | argument to \"first\", then fetch the total count so it could display \"5 of 83\", 341 | for example. 342 | """ 343 | totalCount: Int 344 | } 345 | 346 | "An edge in a connection." 347 | type PersonFilmsEdge { 348 | "A cursor for use in pagination" 349 | cursor: String! 350 | "The item at the end of the edge" 351 | node: Film 352 | } 353 | 354 | "A connection to a list of items." 355 | type PersonStarshipsConnection { 356 | "A list of edges." 357 | edges: [PersonStarshipsEdge] 358 | "Information to aid in pagination." 359 | pageInfo: PageInfo! 360 | """ 361 | A list of all of the objects returned in the connection. This is a convenience 362 | field provided for quickly exploring the API; rather than querying for 363 | \"{ edges { node } }\" when no edge data is needed, this field can be be used 364 | instead. Note that when clients like Relay need to fetch the \"cursor\" field on 365 | the edge to enable efficient pagination, this shortcut cannot be used, and the 366 | full \"{ edges { node } }\" version should be used instead. 367 | """ 368 | starships: [Starship] 369 | """ 370 | A count of the total number of objects in this connection, ignoring pagination. 371 | This allows a client to fetch the first five objects by passing \"5\" as the 372 | argument to \"first\", then fetch the total count so it could display \"5 of 83\", 373 | for example. 374 | """ 375 | totalCount: Int 376 | } 377 | 378 | "An edge in a connection." 379 | type PersonStarshipsEdge { 380 | "A cursor for use in pagination" 381 | cursor: String! 382 | "The item at the end of the edge" 383 | node: Starship 384 | } 385 | 386 | "A connection to a list of items." 387 | type PersonVehiclesConnection { 388 | "A list of edges." 389 | edges: [PersonVehiclesEdge] 390 | "Information to aid in pagination." 391 | pageInfo: PageInfo! 392 | """ 393 | A count of the total number of objects in this connection, ignoring pagination. 394 | This allows a client to fetch the first five objects by passing \"5\" as the 395 | argument to \"first\", then fetch the total count so it could display \"5 of 83\", 396 | for example. 397 | """ 398 | totalCount: Int 399 | """ 400 | A list of all of the objects returned in the connection. This is a convenience 401 | field provided for quickly exploring the API; rather than querying for 402 | \"{ edges { node } }\" when no edge data is needed, this field can be be used 403 | instead. Note that when clients like Relay need to fetch the \"cursor\" field on 404 | the edge to enable efficient pagination, this shortcut cannot be used, and the 405 | full \"{ edges { node } }\" version should be used instead. 406 | """ 407 | vehicles: [Vehicle] 408 | } 409 | 410 | "An edge in a connection." 411 | type PersonVehiclesEdge { 412 | "A cursor for use in pagination" 413 | cursor: String! 414 | "The item at the end of the edge" 415 | node: Vehicle 416 | } 417 | 418 | """ 419 | A large mass, planet or planetoid in the Star Wars Universe, at the time of 420 | 0 ABY. 421 | """ 422 | type Planet implements Node { 423 | "The climates of this planet." 424 | climates: [String] 425 | "The ISO 8601 date format of the time that this resource was created." 426 | created: String 427 | "The diameter of this planet in kilometers." 428 | diameter: Int 429 | "The ISO 8601 date format of the time that this resource was edited." 430 | edited: String 431 | filmConnection(after: String, before: String, first: Int, last: Int): PlanetFilmsConnection 432 | """ 433 | A number denoting the gravity of this planet, where \"1\" is normal or 1 standard 434 | G. \"2\" is twice or 2 standard Gs. \"0.5\" is half or 0.5 standard Gs. 435 | """ 436 | gravity: String 437 | "The ID of an object" 438 | id: ID! 439 | "The name of this planet." 440 | name: String 441 | """ 442 | The number of standard days it takes for this planet to complete a single orbit 443 | of its local star. 444 | """ 445 | orbitalPeriod: Int 446 | "The average population of sentient beings inhabiting this planet." 447 | population: Float 448 | residentConnection(after: String, before: String, first: Int, last: Int): PlanetResidentsConnection 449 | """ 450 | The number of standard hours it takes for this planet to complete a single 451 | rotation on its axis. 452 | """ 453 | rotationPeriod: Int 454 | """ 455 | The percentage of the planet surface that is naturally occuring water or bodies 456 | of water. 457 | """ 458 | surfaceWater: Float 459 | "The terrains of this planet." 460 | terrains: [String] 461 | } 462 | 463 | "A connection to a list of items." 464 | type PlanetFilmsConnection { 465 | "A list of edges." 466 | edges: [PlanetFilmsEdge] 467 | """ 468 | A list of all of the objects returned in the connection. This is a convenience 469 | field provided for quickly exploring the API; rather than querying for 470 | \"{ edges { node } }\" when no edge data is needed, this field can be be used 471 | instead. Note that when clients like Relay need to fetch the \"cursor\" field on 472 | the edge to enable efficient pagination, this shortcut cannot be used, and the 473 | full \"{ edges { node } }\" version should be used instead. 474 | """ 475 | films: [Film] 476 | "Information to aid in pagination." 477 | pageInfo: PageInfo! 478 | """ 479 | A count of the total number of objects in this connection, ignoring pagination. 480 | This allows a client to fetch the first five objects by passing \"5\" as the 481 | argument to \"first\", then fetch the total count so it could display \"5 of 83\", 482 | for example. 483 | """ 484 | totalCount: Int 485 | } 486 | 487 | "An edge in a connection." 488 | type PlanetFilmsEdge { 489 | "A cursor for use in pagination" 490 | cursor: String! 491 | "The item at the end of the edge" 492 | node: Film 493 | } 494 | 495 | "A connection to a list of items." 496 | type PlanetResidentsConnection { 497 | "A list of edges." 498 | edges: [PlanetResidentsEdge] 499 | "Information to aid in pagination." 500 | pageInfo: PageInfo! 501 | """ 502 | A list of all of the objects returned in the connection. This is a convenience 503 | field provided for quickly exploring the API; rather than querying for 504 | \"{ edges { node } }\" when no edge data is needed, this field can be be used 505 | instead. Note that when clients like Relay need to fetch the \"cursor\" field on 506 | the edge to enable efficient pagination, this shortcut cannot be used, and the 507 | full \"{ edges { node } }\" version should be used instead. 508 | """ 509 | residents: [Person] 510 | """ 511 | A count of the total number of objects in this connection, ignoring pagination. 512 | This allows a client to fetch the first five objects by passing \"5\" as the 513 | argument to \"first\", then fetch the total count so it could display \"5 of 83\", 514 | for example. 515 | """ 516 | totalCount: Int 517 | } 518 | 519 | "An edge in a connection." 520 | type PlanetResidentsEdge { 521 | "A cursor for use in pagination" 522 | cursor: String! 523 | "The item at the end of the edge" 524 | node: Person 525 | } 526 | 527 | "A connection to a list of items." 528 | type PlanetsConnection { 529 | "A list of edges." 530 | edges: [PlanetsEdge] 531 | "Information to aid in pagination." 532 | pageInfo: PageInfo! 533 | """ 534 | A list of all of the objects returned in the connection. This is a convenience 535 | field provided for quickly exploring the API; rather than querying for 536 | \"{ edges { node } }\" when no edge data is needed, this field can be be used 537 | instead. Note that when clients like Relay need to fetch the \"cursor\" field on 538 | the edge to enable efficient pagination, this shortcut cannot be used, and the 539 | full \"{ edges { node } }\" version should be used instead. 540 | """ 541 | planets: [Planet] 542 | """ 543 | A count of the total number of objects in this connection, ignoring pagination. 544 | This allows a client to fetch the first five objects by passing \"5\" as the 545 | argument to \"first\", then fetch the total count so it could display \"5 of 83\", 546 | for example. 547 | """ 548 | totalCount: Int 549 | } 550 | 551 | "An edge in a connection." 552 | type PlanetsEdge { 553 | "A cursor for use in pagination" 554 | cursor: String! 555 | "The item at the end of the edge" 556 | node: Planet 557 | } 558 | 559 | type Root { 560 | allFilms(after: String, before: String, first: Int, last: Int): FilmsConnection 561 | allPeople(after: String, before: String, first: Int, last: Int): PeopleConnection 562 | allPlanets(after: String, before: String, first: Int, last: Int): PlanetsConnection 563 | allSpecies(after: String, before: String, first: Int, last: Int): SpeciesConnection 564 | allStarships(after: String, before: String, first: Int, last: Int): StarshipsConnection 565 | allVehicles(after: String, before: String, first: Int, last: Int): VehiclesConnection 566 | film(filmID: ID, id: ID): Film 567 | "Fetches an object given its ID" 568 | node( 569 | #The ID of an object 570 | id: ID! 571 | ): Node 572 | person(id: ID, personID: ID): Person 573 | planet(id: ID, planetID: ID): Planet 574 | species(id: ID, speciesID: ID): Species 575 | starship(id: ID, starshipID: ID): Starship 576 | vehicle(id: ID, vehicleID: ID): Vehicle 577 | } 578 | 579 | "A type of person or character within the Star Wars Universe." 580 | type Species implements Node { 581 | "The average height of this species in centimeters." 582 | averageHeight: Float 583 | "The average lifespan of this species in years, null if unknown." 584 | averageLifespan: Int 585 | "The classification of this species, such as \"mammal\" or \"reptile\"." 586 | classification: String 587 | "The ISO 8601 date format of the time that this resource was created." 588 | created: String 589 | "The designation of this species, such as \"sentient\"." 590 | designation: String 591 | "The ISO 8601 date format of the time that this resource was edited." 592 | edited: String 593 | """ 594 | Common eye colors for this species, null if this species does not typically 595 | have eyes. 596 | """ 597 | eyeColors: [String] 598 | filmConnection(after: String, before: String, first: Int, last: Int): SpeciesFilmsConnection 599 | """ 600 | Common hair colors for this species, null if this species does not typically 601 | have hair. 602 | """ 603 | hairColors: [String] 604 | "A planet that this species originates from." 605 | homeworld: Planet 606 | "The ID of an object" 607 | id: ID! 608 | "The language commonly spoken by this species." 609 | language: String 610 | "The name of this species." 611 | name: String 612 | personConnection(after: String, before: String, first: Int, last: Int): SpeciesPeopleConnection 613 | """ 614 | Common skin colors for this species, null if this species does not typically 615 | have skin. 616 | """ 617 | skinColors: [String] 618 | } 619 | 620 | "A connection to a list of items." 621 | type SpeciesConnection { 622 | "A list of edges." 623 | edges: [SpeciesEdge] 624 | "Information to aid in pagination." 625 | pageInfo: PageInfo! 626 | """ 627 | A list of all of the objects returned in the connection. This is a convenience 628 | field provided for quickly exploring the API; rather than querying for 629 | \"{ edges { node } }\" when no edge data is needed, this field can be be used 630 | instead. Note that when clients like Relay need to fetch the \"cursor\" field on 631 | the edge to enable efficient pagination, this shortcut cannot be used, and the 632 | full \"{ edges { node } }\" version should be used instead. 633 | """ 634 | species: [Species] 635 | """ 636 | A count of the total number of objects in this connection, ignoring pagination. 637 | This allows a client to fetch the first five objects by passing \"5\" as the 638 | argument to \"first\", then fetch the total count so it could display \"5 of 83\", 639 | for example. 640 | """ 641 | totalCount: Int 642 | } 643 | 644 | "An edge in a connection." 645 | type SpeciesEdge { 646 | "A cursor for use in pagination" 647 | cursor: String! 648 | "The item at the end of the edge" 649 | node: Species 650 | } 651 | 652 | "A connection to a list of items." 653 | type SpeciesFilmsConnection { 654 | "A list of edges." 655 | edges: [SpeciesFilmsEdge] 656 | """ 657 | A list of all of the objects returned in the connection. This is a convenience 658 | field provided for quickly exploring the API; rather than querying for 659 | \"{ edges { node } }\" when no edge data is needed, this field can be be used 660 | instead. Note that when clients like Relay need to fetch the \"cursor\" field on 661 | the edge to enable efficient pagination, this shortcut cannot be used, and the 662 | full \"{ edges { node } }\" version should be used instead. 663 | """ 664 | films: [Film] 665 | "Information to aid in pagination." 666 | pageInfo: PageInfo! 667 | """ 668 | A count of the total number of objects in this connection, ignoring pagination. 669 | This allows a client to fetch the first five objects by passing \"5\" as the 670 | argument to \"first\", then fetch the total count so it could display \"5 of 83\", 671 | for example. 672 | """ 673 | totalCount: Int 674 | } 675 | 676 | "An edge in a connection." 677 | type SpeciesFilmsEdge { 678 | "A cursor for use in pagination" 679 | cursor: String! 680 | "The item at the end of the edge" 681 | node: Film 682 | } 683 | 684 | "A connection to a list of items." 685 | type SpeciesPeopleConnection { 686 | "A list of edges." 687 | edges: [SpeciesPeopleEdge] 688 | "Information to aid in pagination." 689 | pageInfo: PageInfo! 690 | """ 691 | A list of all of the objects returned in the connection. This is a convenience 692 | field provided for quickly exploring the API; rather than querying for 693 | \"{ edges { node } }\" when no edge data is needed, this field can be be used 694 | instead. Note that when clients like Relay need to fetch the \"cursor\" field on 695 | the edge to enable efficient pagination, this shortcut cannot be used, and the 696 | full \"{ edges { node } }\" version should be used instead. 697 | """ 698 | people: [Person] 699 | """ 700 | A count of the total number of objects in this connection, ignoring pagination. 701 | This allows a client to fetch the first five objects by passing \"5\" as the 702 | argument to \"first\", then fetch the total count so it could display \"5 of 83\", 703 | for example. 704 | """ 705 | totalCount: Int 706 | } 707 | 708 | "An edge in a connection." 709 | type SpeciesPeopleEdge { 710 | "A cursor for use in pagination" 711 | cursor: String! 712 | "The item at the end of the edge" 713 | node: Person 714 | } 715 | 716 | "A single transport craft that has hyperdrive capability." 717 | type Starship implements Node { 718 | """ 719 | The Maximum number of Megalights this starship can travel in a standard hour. 720 | A \"Megalight\" is a standard unit of distance and has never been defined before 721 | within the Star Wars universe. This figure is only really useful for measuring 722 | the difference in speed of starships. We can assume it is similar to AU, the 723 | distance between our Sun (Sol) and Earth. 724 | """ 725 | MGLT: Int 726 | "The maximum number of kilograms that this starship can transport." 727 | cargoCapacity: Float 728 | """ 729 | The maximum length of time that this starship can provide consumables for its 730 | entire crew without having to resupply. 731 | """ 732 | consumables: String 733 | "The cost of this starship new, in galactic credits." 734 | costInCredits: Float 735 | "The ISO 8601 date format of the time that this resource was created." 736 | created: String 737 | "The number of personnel needed to run or pilot this starship." 738 | crew: String 739 | "The ISO 8601 date format of the time that this resource was edited." 740 | edited: String 741 | filmConnection(after: String, before: String, first: Int, last: Int): StarshipFilmsConnection 742 | "The class of this starships hyperdrive." 743 | hyperdriveRating: Float 744 | "The ID of an object" 745 | id: ID! 746 | "The length of this starship in meters." 747 | length: Float 748 | "The manufacturers of this starship." 749 | manufacturers: [String] 750 | """ 751 | The maximum speed of this starship in atmosphere. null if this starship is 752 | incapable of atmosphering flight. 753 | """ 754 | maxAtmospheringSpeed: Int 755 | """ 756 | The model or official name of this starship. Such as \"T-65 X-wing\" or \"DS-1 757 | Orbital Battle Station\". 758 | """ 759 | model: String 760 | "The name of this starship. The common name, such as \"Death Star\"." 761 | name: String 762 | "The number of non-essential people this starship can transport." 763 | passengers: String 764 | pilotConnection(after: String, before: String, first: Int, last: Int): StarshipPilotsConnection 765 | """ 766 | The class of this starship, such as \"Starfighter\" or \"Deep Space Mobile 767 | Battlestation\" 768 | """ 769 | starshipClass: String 770 | } 771 | 772 | "A connection to a list of items." 773 | type StarshipFilmsConnection { 774 | "A list of edges." 775 | edges: [StarshipFilmsEdge] 776 | """ 777 | A list of all of the objects returned in the connection. This is a convenience 778 | field provided for quickly exploring the API; rather than querying for 779 | \"{ edges { node } }\" when no edge data is needed, this field can be be used 780 | instead. Note that when clients like Relay need to fetch the \"cursor\" field on 781 | the edge to enable efficient pagination, this shortcut cannot be used, and the 782 | full \"{ edges { node } }\" version should be used instead. 783 | """ 784 | films: [Film] 785 | "Information to aid in pagination." 786 | pageInfo: PageInfo! 787 | """ 788 | A count of the total number of objects in this connection, ignoring pagination. 789 | This allows a client to fetch the first five objects by passing \"5\" as the 790 | argument to \"first\", then fetch the total count so it could display \"5 of 83\", 791 | for example. 792 | """ 793 | totalCount: Int 794 | } 795 | 796 | "An edge in a connection." 797 | type StarshipFilmsEdge { 798 | "A cursor for use in pagination" 799 | cursor: String! 800 | "The item at the end of the edge" 801 | node: Film 802 | } 803 | 804 | "A connection to a list of items." 805 | type StarshipPilotsConnection { 806 | "A list of edges." 807 | edges: [StarshipPilotsEdge] 808 | "Information to aid in pagination." 809 | pageInfo: PageInfo! 810 | """ 811 | A list of all of the objects returned in the connection. This is a convenience 812 | field provided for quickly exploring the API; rather than querying for 813 | \"{ edges { node } }\" when no edge data is needed, this field can be be used 814 | instead. Note that when clients like Relay need to fetch the \"cursor\" field on 815 | the edge to enable efficient pagination, this shortcut cannot be used, and the 816 | full \"{ edges { node } }\" version should be used instead. 817 | """ 818 | pilots: [Person] 819 | """ 820 | A count of the total number of objects in this connection, ignoring pagination. 821 | This allows a client to fetch the first five objects by passing \"5\" as the 822 | argument to \"first\", then fetch the total count so it could display \"5 of 83\", 823 | for example. 824 | """ 825 | totalCount: Int 826 | } 827 | 828 | "An edge in a connection." 829 | type StarshipPilotsEdge { 830 | "A cursor for use in pagination" 831 | cursor: String! 832 | "The item at the end of the edge" 833 | node: Person 834 | } 835 | 836 | "A connection to a list of items." 837 | type StarshipsConnection { 838 | "A list of edges." 839 | edges: [StarshipsEdge] 840 | "Information to aid in pagination." 841 | pageInfo: PageInfo! 842 | """ 843 | A list of all of the objects returned in the connection. This is a convenience 844 | field provided for quickly exploring the API; rather than querying for 845 | \"{ edges { node } }\" when no edge data is needed, this field can be be used 846 | instead. Note that when clients like Relay need to fetch the \"cursor\" field on 847 | the edge to enable efficient pagination, this shortcut cannot be used, and the 848 | full \"{ edges { node } }\" version should be used instead. 849 | """ 850 | starships: [Starship] 851 | """ 852 | A count of the total number of objects in this connection, ignoring pagination. 853 | This allows a client to fetch the first five objects by passing \"5\" as the 854 | argument to \"first\", then fetch the total count so it could display \"5 of 83\", 855 | for example. 856 | """ 857 | totalCount: Int 858 | } 859 | 860 | "An edge in a connection." 861 | type StarshipsEdge { 862 | "A cursor for use in pagination" 863 | cursor: String! 864 | "The item at the end of the edge" 865 | node: Starship 866 | } 867 | 868 | "A single transport craft that does not have hyperdrive capability" 869 | type Vehicle implements Node { 870 | "The maximum number of kilograms that this vehicle can transport." 871 | cargoCapacity: Float 872 | """ 873 | The maximum length of time that this vehicle can provide consumables for its 874 | entire crew without having to resupply. 875 | """ 876 | consumables: String 877 | "The cost of this vehicle new, in Galactic Credits." 878 | costInCredits: Float 879 | "The ISO 8601 date format of the time that this resource was created." 880 | created: String 881 | "The number of personnel needed to run or pilot this vehicle." 882 | crew: String 883 | "The ISO 8601 date format of the time that this resource was edited." 884 | edited: String 885 | filmConnection(after: String, before: String, first: Int, last: Int): VehicleFilmsConnection 886 | "The ID of an object" 887 | id: ID! 888 | "The length of this vehicle in meters." 889 | length: Float 890 | "The manufacturers of this vehicle." 891 | manufacturers: [String] 892 | "The maximum speed of this vehicle in atmosphere." 893 | maxAtmospheringSpeed: Int 894 | """ 895 | The model or official name of this vehicle. Such as \"All-Terrain Attack 896 | Transport\". 897 | """ 898 | model: String 899 | """ 900 | The name of this vehicle. The common name, such as \"Sand Crawler\" or \"Speeder 901 | bike\". 902 | """ 903 | name: String 904 | "The number of non-essential people this vehicle can transport." 905 | passengers: String 906 | pilotConnection(after: String, before: String, first: Int, last: Int): VehiclePilotsConnection 907 | "The class of this vehicle, such as \"Wheeled\" or \"Repulsorcraft\"." 908 | vehicleClass: String 909 | } 910 | 911 | "A connection to a list of items." 912 | type VehicleFilmsConnection { 913 | "A list of edges." 914 | edges: [VehicleFilmsEdge] 915 | """ 916 | A list of all of the objects returned in the connection. This is a convenience 917 | field provided for quickly exploring the API; rather than querying for 918 | \"{ edges { node } }\" when no edge data is needed, this field can be be used 919 | instead. Note that when clients like Relay need to fetch the \"cursor\" field on 920 | the edge to enable efficient pagination, this shortcut cannot be used, and the 921 | full \"{ edges { node } }\" version should be used instead. 922 | """ 923 | films: [Film] 924 | "Information to aid in pagination." 925 | pageInfo: PageInfo! 926 | """ 927 | A count of the total number of objects in this connection, ignoring pagination. 928 | This allows a client to fetch the first five objects by passing \"5\" as the 929 | argument to \"first\", then fetch the total count so it could display \"5 of 83\", 930 | for example. 931 | """ 932 | totalCount: Int 933 | } 934 | 935 | "An edge in a connection." 936 | type VehicleFilmsEdge { 937 | "A cursor for use in pagination" 938 | cursor: String! 939 | "The item at the end of the edge" 940 | node: Film 941 | } 942 | 943 | "A connection to a list of items." 944 | type VehiclePilotsConnection { 945 | "A list of edges." 946 | edges: [VehiclePilotsEdge] 947 | "Information to aid in pagination." 948 | pageInfo: PageInfo! 949 | """ 950 | A list of all of the objects returned in the connection. This is a convenience 951 | field provided for quickly exploring the API; rather than querying for 952 | \"{ edges { node } }\" when no edge data is needed, this field can be be used 953 | instead. Note that when clients like Relay need to fetch the \"cursor\" field on 954 | the edge to enable efficient pagination, this shortcut cannot be used, and the 955 | full \"{ edges { node } }\" version should be used instead. 956 | """ 957 | pilots: [Person] 958 | """ 959 | A count of the total number of objects in this connection, ignoring pagination. 960 | This allows a client to fetch the first five objects by passing \"5\" as the 961 | argument to \"first\", then fetch the total count so it could display \"5 of 83\", 962 | for example. 963 | """ 964 | totalCount: Int 965 | } 966 | 967 | "An edge in a connection." 968 | type VehiclePilotsEdge { 969 | "A cursor for use in pagination" 970 | cursor: String! 971 | "The item at the end of the edge" 972 | node: Person 973 | } 974 | 975 | "A connection to a list of items." 976 | type VehiclesConnection { 977 | "A list of edges." 978 | edges: [VehiclesEdge] 979 | "Information to aid in pagination." 980 | pageInfo: PageInfo! 981 | """ 982 | A count of the total number of objects in this connection, ignoring pagination. 983 | This allows a client to fetch the first five objects by passing \"5\" as the 984 | argument to \"first\", then fetch the total count so it could display \"5 of 83\", 985 | for example. 986 | """ 987 | totalCount: Int 988 | """ 989 | A list of all of the objects returned in the connection. This is a convenience 990 | field provided for quickly exploring the API; rather than querying for 991 | \"{ edges { node } }\" when no edge data is needed, this field can be be used 992 | instead. Note that when clients like Relay need to fetch the \"cursor\" field on 993 | the edge to enable efficient pagination, this shortcut cannot be used, and the 994 | full \"{ edges { node } }\" version should be used instead. 995 | """ 996 | vehicles: [Vehicle] 997 | } 998 | 999 | "An edge in a connection." 1000 | type VehiclesEdge { 1001 | "A cursor for use in pagination" 1002 | cursor: String! 1003 | "The item at the end of the edge" 1004 | node: Vehicle 1005 | } 1006 | -------------------------------------------------------------------------------- /two-schemas-plus-shared-using-projects/.graphqlconfig: -------------------------------------------------------------------------------- 1 | { 2 | "name": "GraphQL Schemas with Shared Types", 3 | "projects": { 4 | "shared": { 5 | "includes": ["shared/**"] 6 | }, 7 | "alpha": { 8 | "includes": ["alpha/**", "shared/**"] 9 | }, 10 | "beta": { 11 | "includes": ["beta/**", "shared/**"] 12 | } 13 | }, 14 | "extensions": { 15 | "endpoints": { 16 | "Default GraphQL Endpoint": { 17 | "url": "http://localhost:8080/graphql", 18 | "headers": { 19 | "user-agent": "JS GraphQL" 20 | }, 21 | "introspect": false 22 | } 23 | } 24 | } 25 | } -------------------------------------------------------------------------------- /two-schemas-plus-shared-using-projects/README.md: -------------------------------------------------------------------------------- 1 | # GraphQL Config Example: Two Schemas and Shared Types using Projects 2 | 3 | This example uses a single `.graphqlconfig` to setup two schemas that both rely on 4 | types in a shared folder. 5 | 6 | __Things to note__: 7 | - The `shared` folder is configured as the first project with includes to ensure schema discovery is isolated within the shared folder. 8 | - The `alpha` and `beta` schemas both reference the shared folder via their includes. 9 | - Using a single config in the root is required for this structure as GraphQL files find their associated `.graphqlconfig` 10 | by looking in their current and parent directories. -------------------------------------------------------------------------------- /two-schemas-plus-shared-using-projects/alpha/alpha.graphql: -------------------------------------------------------------------------------- 1 | type Query { 2 | sharedAlpha: Shared 3 | } -------------------------------------------------------------------------------- /two-schemas-plus-shared-using-projects/beta/beta.graphql: -------------------------------------------------------------------------------- 1 | type Query { 2 | sharedBeta: Shared 3 | betaAnother: BetaType 4 | } 5 | 6 | type BetaType { 7 | foo: Boolean 8 | } -------------------------------------------------------------------------------- /two-schemas-plus-shared-using-projects/shared/shared.graphql: -------------------------------------------------------------------------------- 1 | type Shared { 2 | shared: Boolean 3 | } --------------------------------------------------------------------------------