diff --git a/Cargo.lock b/Cargo.lock index 34000afba..47a99ce70 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -7,6 +7,10 @@ name = "Inflector" version = "0.11.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fe438c63458706e03479442743baae6c88256498e6431708f6dfc520a26515d3" +dependencies = [ + "lazy_static", + "regex", +] [[package]] name = "addr2line" @@ -247,6 +251,12 @@ version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eab1c04a571841102f5345a8fc0f6bb3d31c315dec879b5c6e42e40ce7ffa34e" +[[package]] +name = "ascii_utils" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71938f30533e4d95a6d17aa530939da3842c2ab6f4f84b9dae68447e4129f74a" + [[package]] name = "assert-json-diff" version = "2.0.2" @@ -308,7 +318,7 @@ dependencies = [ "async-task", "concurrent-queue", "fastrand 1.9.0", - "futures-lite", + "futures-lite 1.13.0", "slab", ] @@ -323,10 +333,78 @@ dependencies = [ "async-io", "async-lock", "blocking", - "futures-lite", + "futures-lite 1.13.0", "once_cell", ] +[[package]] +name = "async-graphql" +version = "7.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ad990024653fd2d0321a568f64e620404a894047b2ab8c475f7452c8bb82cf6" +dependencies = [ + "async-graphql-derive", + "async-graphql-parser", + "async-graphql-value", + "async-stream", + "async-trait", + "base64 0.13.1", + "bytes 1.5.0", + "fast_chemail", + "fnv", + "futures-util", + "handlebars", + "http 1.1.0", + "indexmap 2.5.0", + "mime", + "multer", + "num-traits", + "once_cell", + "pin-project-lite", + "regex", + "serde", + "serde_json", + "serde_urlencoded", + "static_assertions", + "tempfile", + "thiserror", +] + +[[package]] +name = "async-graphql-axum" +version = "7.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb1c9aed04854fb55a9d3fbab94e013cfc7ca5e3cead0b49b439884f8a467039" +dependencies = [ + "async-graphql", + "async-trait", + "axum", + "bytes 1.5.0", + "futures-util", + "serde_json", + "tokio", + "tokio-stream", + "tokio-util", + "tower-service", +] + +[[package]] +name = "async-graphql-derive" +version = "7.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3909cc7228128099b603d057e5a920b9499ce24299f8f680d5d1f213d7b830c0" +dependencies = [ + "Inflector", + "async-graphql-parser", + "darling", + "proc-macro-crate 1.3.1", + "proc-macro2", + "quote", + "strum", + "syn 2.0.79", + "thiserror", +] + [[package]] name = "async-graphql-parser" version = "7.0.0" @@ -377,7 +455,7 @@ dependencies = [ "autocfg", "cfg-if", "concurrent-queue", - "futures-lite", + "futures-lite 1.13.0", "log", "parking", "polling", @@ -410,7 +488,7 @@ dependencies = [ "futures-channel", "futures-core", "futures-io", - "futures-lite", + "futures-lite 1.13.0", "gloo-timers", "kv-log-macro", "log", @@ -422,6 +500,28 @@ dependencies = [ "wasm-bindgen-futures", ] +[[package]] +name = "async-stream" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b5a71a6f37880a80d1d7f19efd781e4b5de42c88f0722cc13bcb6cc2cfe8476" +dependencies = [ + "async-stream-impl", + "futures-core", + "pin-project-lite", +] + +[[package]] +name = "async-stream-impl" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7c24de15d275a1ecfd47a380fb4d5ec9bfe0933f309ed5e705b775596a3574d" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.79", +] + [[package]] name = "async-task" version = "4.4.0" @@ -436,9 +536,9 @@ checksum = "d85a97c4a0ecce878efd3f945f119c78a646d8975340bca0398f9bb05c30cc52" dependencies = [ "futures-core", "futures-io", - "rustls 0.18.1", + "rustls", "webpki", - "webpki-roots 0.20.0", + "webpki-roots", ] [[package]] @@ -475,6 +575,64 @@ dependencies = [ "syn 2.0.79", ] +[[package]] +name = "axum" +version = "0.7.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "edca88bc138befd0323b20752846e6587272d3b03b0343c8ea28a6f819e6e71f" +dependencies = [ + "async-trait", + "axum-core", + "base64 0.22.1", + "bytes 1.5.0", + "futures-util", + "http 1.1.0", + "http-body 1.0.0", + "http-body-util", + "hyper 1.2.0", + "hyper-util", + "itoa", + "matchit", + "memchr", + "mime", + "percent-encoding", + "pin-project-lite", + "rustversion", + "serde", + "serde_json", + "serde_path_to_error", + "serde_urlencoded", + "sha1 0.10.6", + "sync_wrapper 1.0.2", + "tokio", + "tokio-tungstenite", + "tower 0.5.2", + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "axum-core" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09f2bd6146b97ae3359fa0cc6d6b376d9539582c7b4220f041a33ec24c226199" +dependencies = [ + "async-trait", + "bytes 1.5.0", + "futures-util", + "http 1.1.0", + "http-body 1.0.0", + "http-body-util", + "mime", + "pin-project-lite", + "rustversion", + "sync_wrapper 1.0.2", + "tower-layer", + "tower-service", + "tracing", +] + [[package]] name = "backtrace" version = "0.3.69" @@ -514,6 +672,12 @@ version = "0.21.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ba43ea6f343b788c8764558649e08df62f86c6ef251fdaeb1ffd010a9ae50a2" +[[package]] +name = "base64" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" + [[package]] name = "basic-toml" version = "0.1.4" @@ -562,6 +726,15 @@ dependencies = [ "generic-array", ] +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + [[package]] name = "blocking" version = "1.3.1" @@ -573,7 +746,7 @@ dependencies = [ "async-task", "atomic-waker", "fastrand 1.9.0", - "futures-lite", + "futures-lite 1.13.0", "log", ] @@ -867,7 +1040,7 @@ dependencies = [ "hmac", "percent-encoding", "rand 0.8.5", - "sha2", + "sha2 0.9.9", "time", "version_check", ] @@ -909,15 +1082,6 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dcb25d077389e53838a8158c8e99174c5a9d902dee4904320db714f3c653ffba" -[[package]] -name = "crc32fast" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" -dependencies = [ - "cfg-if", -] - [[package]] name = "crossbeam-channel" version = "0.5.8" @@ -971,6 +1135,16 @@ dependencies = [ "cfg-if", ] +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "typenum", +] + [[package]] name = "crypto-mac" version = "0.10.1" @@ -1088,6 +1262,7 @@ dependencies = [ "cynic", "cynic-codegen", "github-schema", + "graphql-mocks", "insta", "reqwest", "surf", @@ -1101,12 +1276,14 @@ dependencies = [ "assert_matches", "cynic", "cynic-codegen", + "graphql-mocks", "indenter", "insta", "maplit", "reqwest", "serde_json", "thiserror", + "tokio", ] [[package]] @@ -1227,6 +1404,12 @@ dependencies = [ "parking_lot_core", ] +[[package]] +name = "data-encoding" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8566979429cf69b49a5c740c60791108e86440e8be149bbea4fe54d2c32d6e2" + [[package]] name = "deadpool" version = "0.7.0" @@ -1250,6 +1433,16 @@ dependencies = [ "generic-array", ] +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer 0.10.4", + "crypto-common", +] + [[package]] name = "discard" version = "1.0.4" @@ -1347,6 +1540,15 @@ version = "2.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" +[[package]] +name = "fast_chemail" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "495a39d30d624c2caabe6312bfead73e7717692b44e0b32df168c275a2e8e9e4" +dependencies = [ + "ascii_utils", +] + [[package]] name = "fastrand" version = "1.9.0" @@ -1374,16 +1576,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "flate2" -version = "1.0.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6c98ee8095e9d1dcbf2fcc6d95acccb90d1c81db1e44725c6a984b1dbdfb010" -dependencies = [ - "crc32fast", - "miniz_oxide", -] - [[package]] name = "flume" version = "0.9.2" @@ -1494,6 +1686,19 @@ dependencies = [ "waker-fn", ] +[[package]] +name = "futures-lite" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cef40d21ae2c515b51041df9ed313ed21e572df340ea58a922a0aefe7e8891a1" +dependencies = [ + "fastrand 2.0.0", + "futures-core", + "futures-io", + "parking", + "pin-project-lite", +] + [[package]] name = "futures-macro" version = "0.3.30" @@ -1679,6 +1884,25 @@ dependencies = [ "web-sys", ] +[[package]] +name = "graphql-mocks" +version = "0.0.0" +dependencies = [ + "async-graphql", + "async-graphql-axum", + "async-trait", + "axum", + "crossbeam-queue", + "cynic-parser", + "futures-lite 2.5.0", + "headers", + "http 1.1.0", + "serde", + "serde_json", + "tokio", + "url", +] + [[package]] name = "graphql-parser" version = "0.4.0" @@ -1727,6 +1951,20 @@ dependencies = [ "tracing", ] +[[package]] +name = "handlebars" +version = "4.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "faa67bab9ff362228eb3d00bd024a4965d8231bbb7921167f0cfa66c6626b225" +dependencies = [ + "log", + "pest", + "pest_derive", + "serde", + "serde_json", + "thiserror", +] + [[package]] name = "hashbrown" version = "0.12.3" @@ -1751,6 +1989,30 @@ version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" +[[package]] +name = "headers" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "322106e6bd0cba2d5ead589ddb8150a13d7c4217cf80d7c4f682ca994ccc6aa9" +dependencies = [ + "base64 0.21.4", + "bytes 1.5.0", + "headers-core", + "http 1.1.0", + "httpdate", + "mime", + "sha1 0.10.6", +] + +[[package]] +name = "headers-core" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "54b4a22553d4242c49fddb9ba998a99962b5cc6f22cb5a3482bec22522403ce4" +dependencies = [ + "http 1.1.0", +] + [[package]] name = "heck" version = "0.4.1" @@ -1769,7 +2031,7 @@ version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "51ab2f639c231793c5f6114bdb9bbe50a7dbbfcd7c7c6bd8475dec2d991e964f" dependencies = [ - "digest", + "digest 0.9.0", "hmac", ] @@ -1780,7 +2042,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c1441c6b1e930e2817404b5046f1f989899143a12bf92de603b69f4e0aee1e15" dependencies = [ "crypto-mac", - "digest", + "digest 0.9.0", ] [[package]] @@ -1856,7 +2118,7 @@ dependencies = [ "http-types", "isahc", "log", - "rustls 0.18.1", + "rustls", ] [[package]] @@ -1870,7 +2132,7 @@ dependencies = [ "async-std", "base64 0.13.1", "cookie", - "futures-lite", + "futures-lite 1.13.0", "infer", "pin-project-lite", "rand 0.7.3", @@ -1945,6 +2207,7 @@ dependencies = [ "http 1.1.0", "http-body 1.0.0", "httparse", + "httpdate", "itoa", "pin-project-lite", "smallvec", @@ -1983,7 +2246,7 @@ dependencies = [ "pin-project-lite", "socket2 0.5.4", "tokio", - "tower", + "tower 0.4.13", "tower-service", "tracing", ] @@ -2134,7 +2397,7 @@ dependencies = [ "curl", "curl-sys", "flume", - "futures-lite", + "futures-lite 1.13.0", "http 0.2.9", "log", "once_cell", @@ -2320,6 +2583,12 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3e2e65a1a2e43cfcb47a895c4c8b10d1f4a61097f9f254f183aee60cad9c651d" +[[package]] +name = "matchit" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e7465ac9959cc2b1404e8e2367b43684a6d13790fe23056cc8c6c5a6b7bcb94" + [[package]] name = "memchr" version = "2.6.3" @@ -2390,6 +2659,23 @@ dependencies = [ "tokio", ] +[[package]] +name = "multer" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83e87776546dc87511aa5ee218730c92b666d7264ab6ed41f9d215af9cd5224b" +dependencies = [ + "bytes 1.5.0", + "encoding_rs", + "futures-util", + "http 1.1.0", + "httparse", + "memchr", + "mime", + "spin 0.9.8", + "version_check", +] + [[package]] name = "native-tls" version = "0.2.11" @@ -2590,6 +2876,40 @@ dependencies = [ "ucd-trie", ] +[[package]] +name = "pest_derive" +version = "2.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bcd6ab1236bbdb3a49027e920e693192ebfe8913f6d60e294de57463a493cfde" +dependencies = [ + "pest", + "pest_generator", +] + +[[package]] +name = "pest_generator" +version = "2.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a31940305ffc96863a735bef7c7994a00b325a7138fdbc5bda0f1a0476d3275" +dependencies = [ + "pest", + "pest_meta", + "proc-macro2", + "quote", + "syn 2.0.79", +] + +[[package]] +name = "pest_meta" +version = "2.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7ff62f5259e53b78d1af898941cdcdccfae7385cf7d793a6e55de5d05bb4b7d" +dependencies = [ + "once_cell", + "pest", + "sha2 0.10.8", +] + [[package]] name = "pin-project" version = "1.1.3" @@ -2681,13 +3001,23 @@ dependencies = [ "toml", ] +[[package]] +name = "proc-macro-crate" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" +dependencies = [ + "once_cell", + "toml_edit 0.19.15", +] + [[package]] name = "proc-macro-crate" version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ecf48c7ca261d60b74ab1a7b20da18bede46776b2e55535cb958eb595c5fa7b" dependencies = [ - "toml_edit", + "toml_edit 0.22.22", ] [[package]] @@ -2756,10 +3086,12 @@ dependencies = [ "cynic", "cynic-codegen", "cynic-querygen", + "graphql-mocks", "indoc", + "reqwest", "serde_json", + "tokio", "trybuild", - "ureq", ] [[package]] @@ -2986,7 +3318,7 @@ dependencies = [ "serde", "serde_json", "serde_urlencoded", - "sync_wrapper", + "sync_wrapper 0.1.2", "system-configuration", "tokio", "tokio-native-tls", @@ -3007,7 +3339,7 @@ dependencies = [ "cc", "libc", "once_cell", - "spin", + "spin 0.5.2", "untrusted", "web-sys", "winapi", @@ -3166,22 +3498,10 @@ dependencies = [ "base64 0.12.3", "log", "ring", - "sct 0.6.1", + "sct", "webpki", ] -[[package]] -name = "rustls" -version = "0.21.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd8d6c9f025a446bc4d18ad9632e69aec8f287aa84499ee335599fabd20c3fd8" -dependencies = [ - "log", - "ring", - "rustls-webpki 0.101.5", - "sct 0.7.0", -] - [[package]] name = "rustls-pemfile" version = "1.0.4" @@ -3191,26 +3511,6 @@ dependencies = [ "base64 0.21.4", ] -[[package]] -name = "rustls-webpki" -version = "0.100.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f6a5fc258f1c1276dfe3016516945546e2d5383911efc0fc4f1cdc5df3a4ae3" -dependencies = [ - "ring", - "untrusted", -] - -[[package]] -name = "rustls-webpki" -version = "0.101.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45a27e3b59326c16e23d30aeb7a36a24cc0d29e71d68ff611cdfb4a01d013bed" -dependencies = [ - "ring", - "untrusted", -] - [[package]] name = "rustversion" version = "1.0.18" @@ -3263,16 +3563,6 @@ dependencies = [ "untrusted", ] -[[package]] -name = "sct" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d53dcdb7c9f8158937a7981b48accfd39a43af418591a5d008c7b22b5e1b7ca4" -dependencies = [ - "ring", - "untrusted", -] - [[package]] name = "seahash" version = "4.1.0" @@ -3347,18 +3637,18 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" [[package]] name = "serde" -version = "1.0.188" +version = "1.0.210" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf9e0fcba69a370eed61bcf2b728575f726b50b55cba78064753d708ddc7549e" +checksum = "c8e3592472072e6e22e0a54d5904d9febf8508f65fb8552499a1abc7d1078c3a" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.188" +version = "1.0.210" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4eca7ac642d82aa35b60049a6eccb4be6be75e599bd2e9adb5f875a737654af2" +checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f" dependencies = [ "proc-macro2", "quote", @@ -3376,6 +3666,16 @@ dependencies = [ "serde", ] +[[package]] +name = "serde_path_to_error" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af99884400da37c88f5e9146b7f1fd0fbcae8f6eec4e9da38b67d05486f814a6" +dependencies = [ + "itoa", + "serde", +] + [[package]] name = "serde_qs" version = "0.8.5" @@ -3417,6 +3717,17 @@ dependencies = [ "sha1_smol", ] +[[package]] +name = "sha1" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest 0.10.7", +] + [[package]] name = "sha1_smol" version = "1.0.0" @@ -3429,13 +3740,24 @@ version = "0.9.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4d58a1e1bf39749807d89cf2d98ac2dfa0ff1cb3faa38fbb64dd88ac8013d800" dependencies = [ - "block-buffer", + "block-buffer 0.9.0", "cfg-if", "cpufeatures", - "digest", + "digest 0.9.0", "opaque-debug", ] +[[package]] +name = "sha2" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest 0.10.7", +] + [[package]] name = "shlex" version = "1.2.0" @@ -3560,6 +3882,12 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" +[[package]] +name = "spin" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" + [[package]] name = "spinning_top" version = "0.2.5" @@ -3623,7 +3951,7 @@ dependencies = [ "serde", "serde_derive", "serde_json", - "sha1", + "sha1 0.6.1", "syn 1.0.109", ] @@ -3645,6 +3973,28 @@ version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" +[[package]] +name = "strum" +version = "0.25.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "290d54ea6f91c969195bdbcd7442c8c2a2ba87da8bf60a7ee86a235d4bc1e125" +dependencies = [ + "strum_macros", +] + +[[package]] +name = "strum_macros" +version = "0.25.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23dc1fa9ac9c169a78ba62f0b841814b7abae11bdd047b9c58f893439e309ea0" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "rustversion", + "syn 2.0.79", +] + [[package]] name = "subtle" version = "2.4.1" @@ -3669,7 +4019,7 @@ dependencies = [ "mime_guess", "once_cell", "pin-project-lite", - "rustls 0.18.1", + "rustls", "serde", "serde_json", "web-sys", @@ -3703,6 +4053,12 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" +[[package]] +name = "sync_wrapper" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bf256ce5efdfa370213c1dabab5935a12e49f2c58d15e9eac2870d3b4f27263" + [[package]] name = "system-configuration" version = "0.5.1" @@ -3880,6 +4236,29 @@ dependencies = [ "tokio", ] +[[package]] +name = "tokio-stream" +version = "0.1.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eca58d7bba4a75707817a2c44174253f9236b2d5fbd055602e9d5c07c139a047" +dependencies = [ + "futures-core", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "tokio-tungstenite" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "edc5f74e248dc973e0dbb7b74c7e0d6fcc301c694ff50049504004ef4d0cdcd9" +dependencies = [ + "futures-util", + "log", + "tokio", + "tungstenite", +] + [[package]] name = "tokio-util" version = "0.7.8" @@ -3888,6 +4267,7 @@ checksum = "806fe8c2c87eccc8b3267cbae29ed3ab2d0bd37fca70ab622e46aaa9375ddb7d" dependencies = [ "bytes 1.5.0", "futures-core", + "futures-io", "futures-sink", "pin-project-lite", "tokio", @@ -3912,6 +4292,17 @@ dependencies = [ "serde", ] +[[package]] +name = "toml_edit" +version = "0.19.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" +dependencies = [ + "indexmap 2.5.0", + "toml_datetime", + "winnow 0.5.40", +] + [[package]] name = "toml_edit" version = "0.22.22" @@ -3922,7 +4313,7 @@ dependencies = [ "serde", "serde_spanned", "toml_datetime", - "winnow", + "winnow 0.6.20", ] [[package]] @@ -3941,17 +4332,33 @@ dependencies = [ "tracing", ] +[[package]] +name = "tower" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d039ad9159c98b70ecfd540b2573b97f7f52c3e8d9f8ad57a24b916a536975f9" +dependencies = [ + "futures-core", + "futures-util", + "pin-project-lite", + "sync_wrapper 1.0.2", + "tokio", + "tower-layer", + "tower-service", + "tracing", +] + [[package]] name = "tower-layer" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c20c8dbed6283a09604c3e69b4b7eeb54e298b8a600d4d5ecb5ad39de609f1d0" +checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" [[package]] name = "tower-service" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" +checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" [[package]] name = "tracing" @@ -4031,7 +4438,25 @@ dependencies = [ "serde", "shlex", "snapbox", - "toml_edit", + "toml_edit 0.22.22", +] + +[[package]] +name = "tungstenite" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18e5b8366ee7a95b16d32197d0b2604b43a0be89dc5fac9f8e96ccafbaedda8a" +dependencies = [ + "byteorder", + "bytes 1.5.0", + "data-encoding", + "http 1.1.0", + "httparse", + "log", + "rand 0.8.5", + "sha1 0.10.6", + "thiserror", + "utf-8", ] [[package]] @@ -4128,24 +4553,6 @@ version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" -[[package]] -name = "ureq" -version = "2.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b11c96ac7ee530603dcdf68ed1557050f374ce55a5a07193ebf8cbc9f8927e9" -dependencies = [ - "base64 0.21.4", - "flate2", - "log", - "once_cell", - "rustls 0.21.7", - "rustls-webpki 0.100.3", - "serde", - "serde_json", - "url", - "webpki-roots 0.23.1", -] - [[package]] name = "url" version = "2.4.1" @@ -4158,6 +4565,12 @@ dependencies = [ "serde", ] +[[package]] +name = "utf-8" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" + [[package]] name = "utf8parse" version = "0.2.1" @@ -4362,15 +4775,6 @@ dependencies = [ "webpki", ] -[[package]] -name = "webpki-roots" -version = "0.23.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b03058f88386e5ff5310d9111d53f48b17d732b401aeb83a8d5190f2ac459338" -dependencies = [ - "rustls-webpki 0.100.3", -] - [[package]] name = "winapi" version = "0.3.9" @@ -4616,6 +5020,15 @@ version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" +[[package]] +name = "winnow" +version = "0.5.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f593a95398737aeed53e489c785df13f3618e41dbcd6718c6addbf1395aa6876" +dependencies = [ + "memchr", +] + [[package]] name = "winnow" version = "0.6.20" diff --git a/Cargo.toml b/Cargo.toml index addd1a4bd..5ff8115c9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,6 +15,7 @@ members = [ "cynic-parser/ast-generator", "cynic-parser-deser", "cynic-parser-deser-macros", + "graphql-mocks", ] exclude = ["cynic-parser/parser-generator"] resolver = "2" @@ -42,6 +43,7 @@ rust-version = "1.76" cynic-parser = { path = "cynic-parser", version = "0.8.7" } cynic-parser-deser-macros = { path = "cynic-parser-deser-macros", version = "0.8.7" } darling = "0.20" +graphql-mocks.path = "graphql-mocks" rstest = "0.23" syn = "2" diff --git a/cynic-introspection/Cargo.toml b/cynic-introspection/Cargo.toml index 3df66e977..ccef4996a 100644 --- a/cynic-introspection/Cargo.toml +++ b/cynic-introspection/Cargo.toml @@ -27,8 +27,10 @@ version = "3" [dev-dependencies] assert_matches = "1.4" +graphql-mocks.workspace = true insta = "1.4" maplit = "1.0.2" +tokio = { version = "1", features = ["macros"] } reqwest = "0.12" serde_json = "1" diff --git a/cynic-introspection/src/detection.rs b/cynic-introspection/src/detection.rs index eafae3e06..b3ee97ec3 100644 --- a/cynic-introspection/src/detection.rs +++ b/cynic-introspection/src/detection.rs @@ -15,18 +15,25 @@ use super::query::schema; /// server has implemented support for. /// /// ```rust -/// use cynic::{QueryBuilder, http::ReqwestBlockingExt}; +/// use cynic::{QueryBuilder, http::ReqwestExt}; /// use cynic_introspection::CapabilitiesQuery; +/// # #[tokio::main] +/// # async fn main() { +/// # let server = graphql_mocks::mocks::swapi::serve().await; +/// # let url = server.url(); +/// # let url = url.as_ref(); /// -/// let data = reqwest::blocking::Client::new() -/// .post("https://swapi-graphql.netlify.app/.netlify/functions/index") +/// let data = reqwest::Client::new() +/// .post(url) /// .run_graphql(CapabilitiesQuery::build(())) +/// .await /// .unwrap() /// .data /// .unwrap(); /// /// let capabilities = data.capabilities(); /// println!("This server supports {capabilities:?}"); +/// # } /// ``` pub struct CapabilitiesQuery { #[cynic(rename = "__type")] diff --git a/cynic-introspection/src/lib.rs b/cynic-introspection/src/lib.rs index 7b87f62d0..d9bfd02ba 100644 --- a/cynic-introspection/src/lib.rs +++ b/cynic-introspection/src/lib.rs @@ -10,13 +10,19 @@ //! results directly. //! //! ```rust -//! use cynic::{QueryBuilder, http::ReqwestBlockingExt}; +//! use cynic::{QueryBuilder, http::ReqwestExt}; //! use cynic_introspection::IntrospectionQuery; +//! # #[tokio::main] +//! # async fn main() { +//! # let server = graphql_mocks::mocks::swapi::serve().await; +//! # let url = server.url(); +//! # let url = url.as_ref(); //! //! // We can run an introspection query and unwrap the data contained within -//! let introspection_data = reqwest::blocking::Client::new() -//! .post("https://swapi-graphql.netlify.app/.netlify/functions/index") +//! let introspection_data = reqwest::Client::new() +//! .post(url) //! .run_graphql(IntrospectionQuery::build(())) +//! .await //! .unwrap() //! .data //! .unwrap(); @@ -25,6 +31,7 @@ //! let schema = introspection_data.into_schema().unwrap(); //! //! assert_eq!(schema.query_type, "Root"); +//! # } //! ``` //! //! ### GraphQL Versions @@ -68,23 +75,29 @@ //! `Introspection::with_capabilities`: //! //! ```rust -//! -//! use cynic::{QueryBuilder, http::ReqwestBlockingExt}; +//! use cynic::{QueryBuilder, http::ReqwestExt}; //! use cynic_introspection::{CapabilitiesQuery, IntrospectionQuery}; +//! # #[tokio::main] +//! # async fn main() { +//! # let server = graphql_mocks::mocks::swapi::serve().await; +//! # let url = server.url(); +//! # let url = url.as_ref(); //! //! // First we run a capabilites query to check what the server supports -//! let capabilities = reqwest::blocking::Client::new() -//! .post("https://swapi-graphql.netlify.app/.netlify/functions/index") +//! let capabilities = reqwest::Client::new() +//! .post(url) //! .run_graphql(CapabilitiesQuery::build(())) +//! .await //! .unwrap() //! .data //! .unwrap() //! .capabilities(); //! //! // Now we can safely run introspection, only querying for what the server supports. -//! let introspection_data = reqwest::blocking::Client::new() -//! .post("https://swapi-graphql.netlify.app/.netlify/functions/index") +//! let introspection_data = reqwest::Client::new() +//! .post(url) //! .run_graphql(IntrospectionQuery::with_capabilities(capabilities)) +//! .await //! .unwrap() //! .data //! .unwrap(); @@ -93,6 +106,7 @@ //! let schema = introspection_data.into_schema().unwrap(); //! //! assert_eq!(schema.query_type, "Root"); +//! # } //! ``` //! //! [1]: http://spec.graphql.org/October2021/#sec-Introspection diff --git a/cynic-introspection/tests/sdl_tests.rs b/cynic-introspection/tests/sdl_tests.rs index 02bf2d96d..fe0577fba 100644 --- a/cynic-introspection/tests/sdl_tests.rs +++ b/cynic-introspection/tests/sdl_tests.rs @@ -1,15 +1,18 @@ +use cynic::http::ReqwestExt; use cynic_introspection::{IntrospectionQuery, SpecificationVersion}; +use graphql_mocks::mocks; -#[test] -fn test_starwars_sdl_conversion() { - use cynic::http::ReqwestBlockingExt; +#[tokio::test] +async fn test_starwars_sdl_conversion() { + let mock_server = mocks::swapi::serve().await; let query = IntrospectionQuery::with_capabilities(SpecificationVersion::June2018.capabilities()); - let result = reqwest::blocking::Client::new() - .post("https://swapi-graphql.netlify.app/.netlify/functions/index") + let result = reqwest::Client::new() + .post(mock_server.url()) .run_graphql(query) + .await .unwrap(); if result.errors.is_some() { diff --git a/cynic-introspection/tests/snapshots/sdl_tests__starwars_sdl_conversion.snap b/cynic-introspection/tests/snapshots/sdl_tests__starwars_sdl_conversion.snap index e86821ce2..03a1c8482 100644 --- a/cynic-introspection/tests/snapshots/sdl_tests__starwars_sdl_conversion.snap +++ b/cynic-introspection/tests/snapshots/sdl_tests__starwars_sdl_conversion.snap @@ -1,100 +1,11 @@ --- source: cynic-introspection/tests/sdl_tests.rs expression: result.data.unwrap().into_schema().unwrap().to_sdl() +snapshot_kind: text --- schema { query: Root } -type Root { - allFilms(after: String, first: Int, before: String, last: Int): FilmsConnection - film(id: ID, filmID: ID): Film - allPeople(after: String, first: Int, before: String, last: Int): PeopleConnection - person(id: ID, personID: ID): Person - allPlanets(after: String, first: Int, before: String, last: Int): PlanetsConnection - planet(id: ID, planetID: ID): Planet - allSpecies(after: String, first: Int, before: String, last: Int): SpeciesConnection - species(id: ID, speciesID: ID): Species - allStarships(after: String, first: Int, before: String, last: Int): StarshipsConnection - starship(id: ID, starshipID: ID): Starship - allVehicles(after: String, first: Int, before: String, last: Int): VehiclesConnection - vehicle(id: ID, vehicleID: ID): Vehicle - """ - Fetches an object given its ID - """ - node( - """ - The ID of an object - """ - id: ID! - ): Node -} - -""" -A connection to a list of items. -""" -type FilmsConnection { - """ - Information to aid in pagination. - """ - pageInfo: PageInfo! - """ - A list of edges. - """ - edges: [FilmsEdge] - """ - A count of the total number of objects in this connection, ignoring pagination. - This allows a client to fetch the first five objects by passing "5" as the - argument to "first", then fetch the total count so it could display "5 of 83", - for example. - """ - totalCount: Int - """ - A list of all of the objects returned in the connection. This is a convenience - field provided for quickly exploring the API; rather than querying for - "{ edges { node } }" when no edge data is needed, this field can be be used - instead. Note that when clients like Relay need to fetch the "cursor" field on - the edge to enable efficient pagination, this shortcut cannot be used, and the - full "{ edges { node } }" version should be used instead. - """ - films: [Film] -} - -""" -Information about pagination in a connection. -""" -type PageInfo { - """ - When paginating forwards, are there more items? - """ - hasNextPage: Boolean! - """ - When paginating backwards, are there more items? - """ - hasPreviousPage: Boolean! - """ - When paginating backwards, the cursor to continue. - """ - startCursor: String - """ - When paginating forwards, the cursor to continue. - """ - endCursor: String -} - -""" -An edge in a connection. -""" -type FilmsEdge { - """ - The item at the end of the edge - """ - node: Film - """ - A cursor for use in pagination - """ - cursor: String! -} - """ A single film. """ @@ -142,20 +53,10 @@ type Film implements Node { id: ID! } -""" -An object with an ID -""" -interface Node { - """ - The id of the object. - """ - id: ID! -} - """ A connection to a list of items. """ -type FilmSpeciesConnection { +type FilmCharactersConnection { """ Information to aid in pagination. """ @@ -163,7 +64,7 @@ type FilmSpeciesConnection { """ A list of edges. """ - edges: [FilmSpeciesEdge] + edges: [FilmCharactersEdge] """ A count of the total number of objects in this connection, ignoring pagination. This allows a client to fetch the first five objects by passing "5" as the @@ -179,17 +80,17 @@ type FilmSpeciesConnection { the edge to enable efficient pagination, this shortcut cannot be used, and the full "{ edges { node } }" version should be used instead. """ - species: [Species] + characters: [Person] } """ An edge in a connection. """ -type FilmSpeciesEdge { +type FilmCharactersEdge { """ The item at the end of the edge """ - node: Species + node: Person """ A cursor for use in pagination """ @@ -197,133 +98,53 @@ type FilmSpeciesEdge { } """ -A type of person or character within the Star Wars Universe. +A connection to a list of items. """ -type Species implements Node { - """ - The name of this species. - """ - name: String - """ - The classification of this species, such as "mammal" or "reptile". - """ - classification: String - """ - The designation of this species, such as "sentient". - """ - designation: String - """ - The average height of this species in centimeters. - """ - averageHeight: Float - """ - The average lifespan of this species in years, null if unknown. - """ - averageLifespan: Int - """ - Common eye colors for this species, null if this species does not typically - have eyes. - """ - eyeColors: [String] - """ - Common hair colors for this species, null if this species does not typically - have hair. - """ - hairColors: [String] - """ - Common skin colors for this species, null if this species does not typically - have skin. - """ - skinColors: [String] - """ - The language commonly spoken by this species. - """ - language: String +type FilmPlanetsConnection { """ - A planet that this species originates from. + Information to aid in pagination. """ - homeworld: Planet - personConnection(after: String, first: Int, before: String, last: Int): SpeciesPeopleConnection - filmConnection(after: String, first: Int, before: String, last: Int): SpeciesFilmsConnection + pageInfo: PageInfo! """ - The ISO 8601 date format of the time that this resource was created. + A list of edges. """ - created: String + edges: [FilmPlanetsEdge] """ - The ISO 8601 date format of the time that this resource was edited. + A count of the total number of objects in this connection, ignoring pagination. + This allows a client to fetch the first five objects by passing "5" as the + argument to "first", then fetch the total count so it could display "5 of 83", + for example. """ - edited: String + totalCount: Int """ - The ID of an object + A list of all of the objects returned in the connection. This is a convenience + field provided for quickly exploring the API; rather than querying for + "{ edges { node } }" when no edge data is needed, this field can be be used + instead. Note that when clients like Relay need to fetch the "cursor" field on + the edge to enable efficient pagination, this shortcut cannot be used, and the + full "{ edges { node } }" version should be used instead. """ - id: ID! + planets: [Planet] } """ -A large mass, planet or planetoid in the Star Wars Universe, at the time of -0 ABY. +An edge in a connection. """ -type Planet implements Node { - """ - The name of this planet. - """ - name: String - """ - The diameter of this planet in kilometers. - """ - diameter: Int - """ - The number of standard hours it takes for this planet to complete a single - rotation on its axis. - """ - rotationPeriod: Int - """ - The number of standard days it takes for this planet to complete a single orbit - of its local star. - """ - orbitalPeriod: Int - """ - A number denoting the gravity of this planet, where "1" is normal or 1 standard - G. "2" is twice or 2 standard Gs. "0.5" is half or 0.5 standard Gs. - """ - gravity: String - """ - The average population of sentient beings inhabiting this planet. - """ - population: Float - """ - The climates of this planet. - """ - climates: [String] - """ - The terrains of this planet. - """ - terrains: [String] - """ - The percentage of the planet surface that is naturally occurring water or bodies - of water. - """ - surfaceWater: Float - residentConnection(after: String, first: Int, before: String, last: Int): PlanetResidentsConnection - filmConnection(after: String, first: Int, before: String, last: Int): PlanetFilmsConnection - """ - The ISO 8601 date format of the time that this resource was created. - """ - created: String +type FilmPlanetsEdge { """ - The ISO 8601 date format of the time that this resource was edited. + The item at the end of the edge """ - edited: String + node: Planet """ - The ID of an object + A cursor for use in pagination """ - id: ID! + cursor: String! } """ A connection to a list of items. """ -type PlanetResidentsConnection { +type FilmSpeciesConnection { """ Information to aid in pagination. """ @@ -331,7 +152,7 @@ type PlanetResidentsConnection { """ A list of edges. """ - edges: [PlanetResidentsEdge] + edges: [FilmSpeciesEdge] """ A count of the total number of objects in this connection, ignoring pagination. This allows a client to fetch the first five objects by passing "5" as the @@ -347,17 +168,17 @@ type PlanetResidentsConnection { the edge to enable efficient pagination, this shortcut cannot be used, and the full "{ edges { node } }" version should be used instead. """ - residents: [Person] + species: [Species] } """ An edge in a connection. """ -type PlanetResidentsEdge { +type FilmSpeciesEdge { """ The item at the end of the edge """ - node: Person + node: Species """ A cursor for use in pagination """ @@ -365,75 +186,97 @@ type PlanetResidentsEdge { } """ -An individual person or character within the Star Wars universe. +A connection to a list of items. """ -type Person implements Node { - """ - The name of this person. - """ - name: String +type FilmStarshipsConnection { """ - The birth year of the person, using the in-universe standard of BBY or ABY - - Before the Battle of Yavin or After the Battle of Yavin. The Battle of Yavin is - a battle that occurs at the end of Star Wars episode IV: A New Hope. + Information to aid in pagination. """ - birthYear: String + pageInfo: PageInfo! """ - The eye color of this person. Will be "unknown" if not known or "n/a" if the - person does not have an eye. + A list of edges. """ - eyeColor: String + edges: [FilmStarshipsEdge] """ - The gender of this person. Either "Male", "Female" or "unknown", - "n/a" if the person does not have a gender. + A count of the total number of objects in this connection, ignoring pagination. + This allows a client to fetch the first five objects by passing "5" as the + argument to "first", then fetch the total count so it could display "5 of 83", + for example. """ - gender: String + totalCount: Int """ - The hair color of this person. Will be "unknown" if not known or "n/a" if the - person does not have hair. + A list of all of the objects returned in the connection. This is a convenience + field provided for quickly exploring the API; rather than querying for + "{ edges { node } }" when no edge data is needed, this field can be be used + instead. Note that when clients like Relay need to fetch the "cursor" field on + the edge to enable efficient pagination, this shortcut cannot be used, and the + full "{ edges { node } }" version should be used instead. """ - hairColor: String + starships: [Starship] +} + +""" +An edge in a connection. +""" +type FilmStarshipsEdge { """ - The height of the person in centimeters. + The item at the end of the edge """ - height: Int + node: Starship """ - The mass of the person in kilograms. + A cursor for use in pagination """ - mass: Float + cursor: String! +} + +""" +A connection to a list of items. +""" +type FilmVehiclesConnection { """ - The skin color of this person. + Information to aid in pagination. """ - skinColor: String + pageInfo: PageInfo! """ - A planet that this person was born on or inhabits. + A list of edges. """ - homeworld: Planet - filmConnection(after: String, first: Int, before: String, last: Int): PersonFilmsConnection + edges: [FilmVehiclesEdge] """ - The species that this person belongs to, or null if unknown. + A count of the total number of objects in this connection, ignoring pagination. + This allows a client to fetch the first five objects by passing "5" as the + argument to "first", then fetch the total count so it could display "5 of 83", + for example. """ - species: Species - starshipConnection(after: String, first: Int, before: String, last: Int): PersonStarshipsConnection - vehicleConnection(after: String, first: Int, before: String, last: Int): PersonVehiclesConnection + totalCount: Int """ - The ISO 8601 date format of the time that this resource was created. + A list of all of the objects returned in the connection. This is a convenience + field provided for quickly exploring the API; rather than querying for + "{ edges { node } }" when no edge data is needed, this field can be be used + instead. Note that when clients like Relay need to fetch the "cursor" field on + the edge to enable efficient pagination, this shortcut cannot be used, and the + full "{ edges { node } }" version should be used instead. """ - created: String + vehicles: [Vehicle] +} + +""" +An edge in a connection. +""" +type FilmVehiclesEdge { """ - The ISO 8601 date format of the time that this resource was edited. + The item at the end of the edge """ - edited: String + node: Vehicle """ - The ID of an object + A cursor for use in pagination """ - id: ID! + cursor: String! } """ A connection to a list of items. """ -type PersonFilmsConnection { +type FilmsConnection { """ Information to aid in pagination. """ @@ -441,7 +284,7 @@ type PersonFilmsConnection { """ A list of edges. """ - edges: [PersonFilmsEdge] + edges: [FilmsEdge] """ A count of the total number of objects in this connection, ignoring pagination. This allows a client to fetch the first five objects by passing "5" as the @@ -463,7 +306,7 @@ type PersonFilmsConnection { """ An edge in a connection. """ -type PersonFilmsEdge { +type FilmsEdge { """ The item at the end of the edge """ @@ -474,10 +317,39 @@ type PersonFilmsEdge { cursor: String! } +""" +An object with an ID +""" +interface Node { + id: ID! +} + +""" +Information about pagination in a connection. +""" +type PageInfo { + """ + When paginating forwards, are there more items? + """ + hasNextPage: Boolean! + """ + When paginating backwards, are there more items? + """ + hasPreviousPage: Boolean! + """ + When paginating backwards, the cursor to continue. + """ + startCursor: String + """ + When paginating forwards, the cursor to continue. + """ + endCursor: String +} + """ A connection to a list of items. """ -type PersonStarshipsConnection { +type PeopleConnection { """ Information to aid in pagination. """ @@ -485,7 +357,7 @@ type PersonStarshipsConnection { """ A list of edges. """ - edges: [PersonStarshipsEdge] + edges: [PeopleEdge] """ A count of the total number of objects in this connection, ignoring pagination. This allows a client to fetch the first five objects by passing "5" as the @@ -501,89 +373,75 @@ type PersonStarshipsConnection { the edge to enable efficient pagination, this shortcut cannot be used, and the full "{ edges { node } }" version should be used instead. """ - starships: [Starship] + people: [Person] } """ An edge in a connection. """ -type PersonStarshipsEdge { +type PeopleEdge { """ The item at the end of the edge """ - node: Starship - """ - A cursor for use in pagination - """ - cursor: String! -} - -""" -A single transport craft that has hyperdrive capability. -""" -type Starship implements Node { - """ - The name of this starship. The common name, such as "Death Star". - """ - name: String - """ - The model or official name of this starship. Such as "T-65 X-wing" or "DS-1 - Orbital Battle Station". - """ - model: String + node: Person """ - The class of this starship, such as "Starfighter" or "Deep Space Mobile - Battlestation" + A cursor for use in pagination """ - starshipClass: String + cursor: String! +} + +""" +An individual person or character within the Star Wars universe. +""" +type Person implements Node { """ - The manufacturers of this starship. + The name of this person. """ - manufacturers: [String] + name: String """ - The cost of this starship new, in galactic credits. + The birth year of the person, using the in-universe standard of BBY or ABY - + Before the Battle of Yavin or After the Battle of Yavin. The Battle of Yavin is + a battle that occurs at the end of Star Wars episode IV: A New Hope. """ - costInCredits: Float + birthYear: String """ - The length of this starship in meters. + The eye color of this person. Will be "unknown" if not known or "n/a" if the + person does not have an eye. """ - length: Float + eyeColor: String """ - The number of personnel needed to run or pilot this starship. + The gender of this person. Either "Male", "Female" or "unknown", + "n/a" if the person does not have a gender. """ - crew: String + gender: String """ - The number of non-essential people this starship can transport. + The hair color of this person. Will be "unknown" if not known or "n/a" if the + person does not have hair. """ - passengers: String + hairColor: String """ - The maximum speed of this starship in atmosphere. null if this starship is - incapable of atmosphering flight. + The height of the person in centimeters. """ - maxAtmospheringSpeed: Int + height: Int """ - The class of this starships hyperdrive. + The mass of the person in kilograms. """ - hyperdriveRating: Float + mass: Float """ - The Maximum number of Megalights this starship can travel in a standard hour. - A "Megalight" is a standard unit of distance and has never been defined before - within the Star Wars universe. This figure is only really useful for measuring - the difference in speed of starships. We can assume it is similar to AU, the - distance between our Sun (Sol) and Earth. + The skin color of this person. """ - MGLT: Int + skinColor: String """ - The maximum number of kilograms that this starship can transport. + A planet that this person was born on or inhabits. """ - cargoCapacity: Float + homeworld: Planet + filmConnection(after: String, first: Int, before: String, last: Int): PersonFilmsConnection """ - The maximum length of time that this starship can provide consumables for its - entire crew without having to resupply. + The species that this person belongs to, or null if unknown. """ - consumables: String - pilotConnection(after: String, first: Int, before: String, last: Int): StarshipPilotsConnection - filmConnection(after: String, first: Int, before: String, last: Int): StarshipFilmsConnection + species: Species + starshipConnection(after: String, first: Int, before: String, last: Int): PersonStarshipsConnection + vehicleConnection(after: String, first: Int, before: String, last: Int): PersonVehiclesConnection """ The ISO 8601 date format of the time that this resource was created. """ @@ -601,7 +459,7 @@ type Starship implements Node { """ A connection to a list of items. """ -type StarshipPilotsConnection { +type PersonFilmsConnection { """ Information to aid in pagination. """ @@ -609,7 +467,7 @@ type StarshipPilotsConnection { """ A list of edges. """ - edges: [StarshipPilotsEdge] + edges: [PersonFilmsEdge] """ A count of the total number of objects in this connection, ignoring pagination. This allows a client to fetch the first five objects by passing "5" as the @@ -625,17 +483,17 @@ type StarshipPilotsConnection { the edge to enable efficient pagination, this shortcut cannot be used, and the full "{ edges { node } }" version should be used instead. """ - pilots: [Person] + films: [Film] } """ An edge in a connection. """ -type StarshipPilotsEdge { +type PersonFilmsEdge { """ The item at the end of the edge """ - node: Person + node: Film """ A cursor for use in pagination """ @@ -645,7 +503,7 @@ type StarshipPilotsEdge { """ A connection to a list of items. """ -type StarshipFilmsConnection { +type PersonStarshipsConnection { """ Information to aid in pagination. """ @@ -653,7 +511,7 @@ type StarshipFilmsConnection { """ A list of edges. """ - edges: [StarshipFilmsEdge] + edges: [PersonStarshipsEdge] """ A count of the total number of objects in this connection, ignoring pagination. This allows a client to fetch the first five objects by passing "5" as the @@ -669,17 +527,17 @@ type StarshipFilmsConnection { the edge to enable efficient pagination, this shortcut cannot be used, and the full "{ edges { node } }" version should be used instead. """ - films: [Film] + starships: [Starship] } """ An edge in a connection. """ -type StarshipFilmsEdge { +type PersonStarshipsEdge { """ The item at the end of the edge """ - node: Film + node: Starship """ A cursor for use in pagination """ @@ -731,58 +589,52 @@ type PersonVehiclesEdge { } """ -A single transport craft that does not have hyperdrive capability +A large mass, planet or planetoid in the Star Wars Universe, at the time of +0 ABY. """ -type Vehicle implements Node { +type Planet implements Node { """ - The name of this vehicle. The common name, such as "Sand Crawler" or "Speeder - bike". + The name of this planet. """ name: String """ - The model or official name of this vehicle. Such as "All-Terrain Attack - Transport". - """ - model: String - """ - The class of this vehicle, such as "Wheeled" or "Repulsorcraft". - """ - vehicleClass: String - """ - The manufacturers of this vehicle. + The diameter of this planet in kilometers. """ - manufacturers: [String] + diameter: Int """ - The cost of this vehicle new, in Galactic Credits. + The number of standard hours it takes for this planet to complete a single + rotation on its axis. """ - costInCredits: Float + rotationPeriod: Int """ - The length of this vehicle in meters. + The number of standard days it takes for this planet to complete a single orbit + of its local star. """ - length: Float + orbitalPeriod: Int """ - The number of personnel needed to run or pilot this vehicle. + A number denoting the gravity of this planet, where "1" is normal or 1 standard + G. "2" is twice or 2 standard Gs. "0.5" is half or 0.5 standard Gs. """ - crew: String + gravity: String """ - The number of non-essential people this vehicle can transport. + The average population of sentient beings inhabiting this planet. """ - passengers: String + population: Float """ - The maximum speed of this vehicle in atmosphere. + The climates of this planet. """ - maxAtmospheringSpeed: Int + climates: [String] """ - The maximum number of kilograms that this vehicle can transport. + The terrains of this planet. """ - cargoCapacity: Float + terrains: [String] """ - The maximum length of time that this vehicle can provide consumables for its - entire crew without having to resupply. + The percentage of the planet surface that is naturally occurring water or bodies + of water. """ - consumables: String - pilotConnection(after: String, first: Int, before: String, last: Int): VehiclePilotsConnection - filmConnection(after: String, first: Int, before: String, last: Int): VehicleFilmsConnection + surfaceWater: Float + residentConnection(after: String, first: Int, before: String, last: Int): PlanetResidentsConnection + filmConnection(after: String, first: Int, before: String, last: Int): PlanetFilmsConnection """ The ISO 8601 date format of the time that this resource was created. """ @@ -800,7 +652,7 @@ type Vehicle implements Node { """ A connection to a list of items. """ -type VehiclePilotsConnection { +type PlanetFilmsConnection { """ Information to aid in pagination. """ @@ -808,7 +660,7 @@ type VehiclePilotsConnection { """ A list of edges. """ - edges: [VehiclePilotsEdge] + edges: [PlanetFilmsEdge] """ A count of the total number of objects in this connection, ignoring pagination. This allows a client to fetch the first five objects by passing "5" as the @@ -824,17 +676,17 @@ type VehiclePilotsConnection { the edge to enable efficient pagination, this shortcut cannot be used, and the full "{ edges { node } }" version should be used instead. """ - pilots: [Person] + films: [Film] } """ An edge in a connection. """ -type VehiclePilotsEdge { +type PlanetFilmsEdge { """ The item at the end of the edge """ - node: Person + node: Film """ A cursor for use in pagination """ @@ -844,7 +696,7 @@ type VehiclePilotsEdge { """ A connection to a list of items. """ -type VehicleFilmsConnection { +type PlanetResidentsConnection { """ Information to aid in pagination. """ @@ -852,7 +704,7 @@ type VehicleFilmsConnection { """ A list of edges. """ - edges: [VehicleFilmsEdge] + edges: [PlanetResidentsEdge] """ A count of the total number of objects in this connection, ignoring pagination. This allows a client to fetch the first five objects by passing "5" as the @@ -868,17 +720,17 @@ type VehicleFilmsConnection { the edge to enable efficient pagination, this shortcut cannot be used, and the full "{ edges { node } }" version should be used instead. """ - films: [Film] + residents: [Person] } """ An edge in a connection. """ -type VehicleFilmsEdge { +type PlanetResidentsEdge { """ The item at the end of the edge """ - node: Film + node: Person """ A cursor for use in pagination """ @@ -888,7 +740,7 @@ type VehicleFilmsEdge { """ A connection to a list of items. """ -type PlanetFilmsConnection { +type PlanetsConnection { """ Information to aid in pagination. """ @@ -896,7 +748,7 @@ type PlanetFilmsConnection { """ A list of edges. """ - edges: [PlanetFilmsEdge] + edges: [PlanetsEdge] """ A count of the total number of objects in this connection, ignoring pagination. This allows a client to fetch the first five objects by passing "5" as the @@ -912,27 +764,114 @@ type PlanetFilmsConnection { the edge to enable efficient pagination, this shortcut cannot be used, and the full "{ edges { node } }" version should be used instead. """ - films: [Film] + planets: [Planet] } """ An edge in a connection. """ -type PlanetFilmsEdge { +type PlanetsEdge { + """ + The item at the end of the edge + """ + node: Planet + """ + A cursor for use in pagination + """ + cursor: String! +} + +type Root { + allFilms(after: String, first: Int, before: String, last: Int): FilmsConnection + film(id: ID, filmID: ID): Film + allPeople(after: String, first: Int, before: String, last: Int): PeopleConnection + person(id: ID, personID: ID): Person + allPlanets(after: String, first: Int, before: String, last: Int): PlanetsConnection + planet(id: ID, planetID: ID): Planet + allSpecies(after: String, first: Int, before: String, last: Int): SpeciesConnection + species(id: ID, speciesID: ID): Species + allStarships(after: String, first: Int, before: String, last: Int): StarshipsConnection + starship(id: ID, starshipID: ID): Starship + allVehicles(after: String, first: Int, before: String, last: Int): VehiclesConnection + vehicle(id: ID, vehicleID: ID): Vehicle + """ + Fetches an object given its ID + """ + node( + """ + The ID of an object + """ + id: ID! + ): Node +} + +""" +A type of person or character within the Star Wars Universe. +""" +type Species implements Node { + """ + The name of this species. + """ + name: String + """ + The classification of this species, such as "mammal" or "reptile". + """ + classification: String + """ + The designation of this species, such as "sentient". + """ + designation: String + """ + The average height of this species in centimeters. + """ + averageHeight: Float + """ + The average lifespan of this species in years, null if unknown. + """ + averageLifespan: Int + """ + Common eye colors for this species, null if this species does not typically + have eyes. + """ + eyeColors: [String] + """ + Common hair colors for this species, null if this species does not typically + have hair. + """ + hairColors: [String] + """ + Common skin colors for this species, null if this species does not typically + have skin. + """ + skinColors: [String] + """ + The language commonly spoken by this species. + """ + language: String + """ + A planet that this species originates from. + """ + homeworld: Planet + personConnection(after: String, first: Int, before: String, last: Int): SpeciesPeopleConnection + filmConnection(after: String, first: Int, before: String, last: Int): SpeciesFilmsConnection """ - The item at the end of the edge + The ISO 8601 date format of the time that this resource was created. """ - node: Film + created: String """ - A cursor for use in pagination + The ISO 8601 date format of the time that this resource was edited. """ - cursor: String! + edited: String + """ + The ID of an object + """ + id: ID! } """ A connection to a list of items. """ -type SpeciesPeopleConnection { +type SpeciesConnection { """ Information to aid in pagination. """ @@ -940,7 +879,7 @@ type SpeciesPeopleConnection { """ A list of edges. """ - edges: [SpeciesPeopleEdge] + edges: [SpeciesEdge] """ A count of the total number of objects in this connection, ignoring pagination. This allows a client to fetch the first five objects by passing "5" as the @@ -956,17 +895,17 @@ type SpeciesPeopleConnection { the edge to enable efficient pagination, this shortcut cannot be used, and the full "{ edges { node } }" version should be used instead. """ - people: [Person] + species: [Species] } """ An edge in a connection. """ -type SpeciesPeopleEdge { +type SpeciesEdge { """ The item at the end of the edge """ - node: Person + node: Species """ A cursor for use in pagination """ @@ -1020,7 +959,7 @@ type SpeciesFilmsEdge { """ A connection to a list of items. """ -type FilmStarshipsConnection { +type SpeciesPeopleConnection { """ Information to aid in pagination. """ @@ -1028,7 +967,7 @@ type FilmStarshipsConnection { """ A list of edges. """ - edges: [FilmStarshipsEdge] + edges: [SpeciesPeopleEdge] """ A count of the total number of objects in this connection, ignoring pagination. This allows a client to fetch the first five objects by passing "5" as the @@ -1044,17 +983,17 @@ type FilmStarshipsConnection { the edge to enable efficient pagination, this shortcut cannot be used, and the full "{ edges { node } }" version should be used instead. """ - starships: [Starship] + people: [Person] } """ An edge in a connection. """ -type FilmStarshipsEdge { +type SpeciesPeopleEdge { """ The item at the end of the edge """ - node: Starship + node: Person """ A cursor for use in pagination """ @@ -1062,53 +1001,89 @@ type FilmStarshipsEdge { } """ -A connection to a list of items. +A single transport craft that has hyperdrive capability. """ -type FilmVehiclesConnection { +type Starship implements Node { """ - Information to aid in pagination. + The name of this starship. The common name, such as "Death Star". """ - pageInfo: PageInfo! + name: String """ - A list of edges. + The model or official name of this starship. Such as "T-65 X-wing" or "DS-1 + Orbital Battle Station". """ - edges: [FilmVehiclesEdge] + model: String """ - A count of the total number of objects in this connection, ignoring pagination. - This allows a client to fetch the first five objects by passing "5" as the - argument to "first", then fetch the total count so it could display "5 of 83", - for example. + The class of this starship, such as "Starfighter" or "Deep Space Mobile + Battlestation" """ - totalCount: Int + starshipClass: String """ - A list of all of the objects returned in the connection. This is a convenience - field provided for quickly exploring the API; rather than querying for - "{ edges { node } }" when no edge data is needed, this field can be be used - instead. Note that when clients like Relay need to fetch the "cursor" field on - the edge to enable efficient pagination, this shortcut cannot be used, and the - full "{ edges { node } }" version should be used instead. + The manufacturers of this starship. """ - vehicles: [Vehicle] -} - -""" -An edge in a connection. -""" -type FilmVehiclesEdge { + manufacturers: [String] """ - The item at the end of the edge + The cost of this starship new, in galactic credits. """ - node: Vehicle + costInCredits: Float """ - A cursor for use in pagination + The length of this starship in meters. """ - cursor: String! + length: Float + """ + The number of personnel needed to run or pilot this starship. + """ + crew: String + """ + The number of non-essential people this starship can transport. + """ + passengers: String + """ + The maximum speed of this starship in atmosphere. null if this starship is + incapable of atmosphering flight. + """ + maxAtmospheringSpeed: Int + """ + The class of this starships hyperdrive. + """ + hyperdriveRating: Float + """ + The Maximum number of Megalights this starship can travel in a standard hour. + A "Megalight" is a standard unit of distance and has never been defined before + within the Star Wars universe. This figure is only really useful for measuring + the difference in speed of starships. We can assume it is similar to AU, the + distance between our Sun (Sol) and Earth. + """ + MGLT: Int + """ + The maximum number of kilograms that this starship can transport. + """ + cargoCapacity: Float + """ + The maximum length of time that this starship can provide consumables for its + entire crew without having to resupply. + """ + consumables: String + pilotConnection(after: String, first: Int, before: String, last: Int): StarshipPilotsConnection + filmConnection(after: String, first: Int, before: String, last: Int): StarshipFilmsConnection + """ + The ISO 8601 date format of the time that this resource was created. + """ + created: String + """ + The ISO 8601 date format of the time that this resource was edited. + """ + edited: String + """ + The ID of an object + """ + id: ID! } """ A connection to a list of items. """ -type FilmCharactersConnection { +type StarshipFilmsConnection { """ Information to aid in pagination. """ @@ -1116,7 +1091,7 @@ type FilmCharactersConnection { """ A list of edges. """ - edges: [FilmCharactersEdge] + edges: [StarshipFilmsEdge] """ A count of the total number of objects in this connection, ignoring pagination. This allows a client to fetch the first five objects by passing "5" as the @@ -1132,17 +1107,17 @@ type FilmCharactersConnection { the edge to enable efficient pagination, this shortcut cannot be used, and the full "{ edges { node } }" version should be used instead. """ - characters: [Person] + films: [Film] } """ An edge in a connection. """ -type FilmCharactersEdge { +type StarshipFilmsEdge { """ The item at the end of the edge """ - node: Person + node: Film """ A cursor for use in pagination """ @@ -1152,7 +1127,7 @@ type FilmCharactersEdge { """ A connection to a list of items. """ -type FilmPlanetsConnection { +type StarshipPilotsConnection { """ Information to aid in pagination. """ @@ -1160,7 +1135,7 @@ type FilmPlanetsConnection { """ A list of edges. """ - edges: [FilmPlanetsEdge] + edges: [StarshipPilotsEdge] """ A count of the total number of objects in this connection, ignoring pagination. This allows a client to fetch the first five objects by passing "5" as the @@ -1176,17 +1151,17 @@ type FilmPlanetsConnection { the edge to enable efficient pagination, this shortcut cannot be used, and the full "{ edges { node } }" version should be used instead. """ - planets: [Planet] + pilots: [Person] } """ An edge in a connection. """ -type FilmPlanetsEdge { +type StarshipPilotsEdge { """ The item at the end of the edge """ - node: Planet + node: Person """ A cursor for use in pagination """ @@ -1196,7 +1171,7 @@ type FilmPlanetsEdge { """ A connection to a list of items. """ -type PeopleConnection { +type StarshipsConnection { """ Information to aid in pagination. """ @@ -1204,7 +1179,7 @@ type PeopleConnection { """ A list of edges. """ - edges: [PeopleEdge] + edges: [StarshipsEdge] """ A count of the total number of objects in this connection, ignoring pagination. This allows a client to fetch the first five objects by passing "5" as the @@ -1220,17 +1195,17 @@ type PeopleConnection { the edge to enable efficient pagination, this shortcut cannot be used, and the full "{ edges { node } }" version should be used instead. """ - people: [Person] + starships: [Starship] } """ An edge in a connection. """ -type PeopleEdge { +type StarshipsEdge { """ The item at the end of the edge """ - node: Person + node: Starship """ A cursor for use in pagination """ @@ -1238,53 +1213,76 @@ type PeopleEdge { } """ -A connection to a list of items. +A single transport craft that does not have hyperdrive capability """ -type PlanetsConnection { +type Vehicle implements Node { """ - Information to aid in pagination. + The name of this vehicle. The common name, such as "Sand Crawler" or "Speeder + bike". """ - pageInfo: PageInfo! + name: String """ - A list of edges. + The model or official name of this vehicle. Such as "All-Terrain Attack + Transport". """ - edges: [PlanetsEdge] + model: String """ - A count of the total number of objects in this connection, ignoring pagination. - This allows a client to fetch the first five objects by passing "5" as the - argument to "first", then fetch the total count so it could display "5 of 83", - for example. + The class of this vehicle, such as "Wheeled" or "Repulsorcraft". """ - totalCount: Int + vehicleClass: String """ - A list of all of the objects returned in the connection. This is a convenience - field provided for quickly exploring the API; rather than querying for - "{ edges { node } }" when no edge data is needed, this field can be be used - instead. Note that when clients like Relay need to fetch the "cursor" field on - the edge to enable efficient pagination, this shortcut cannot be used, and the - full "{ edges { node } }" version should be used instead. + The manufacturers of this vehicle. """ - planets: [Planet] -} - -""" -An edge in a connection. -""" -type PlanetsEdge { + manufacturers: [String] """ - The item at the end of the edge + The cost of this vehicle new, in Galactic Credits. """ - node: Planet + costInCredits: Float """ - A cursor for use in pagination + The length of this vehicle in meters. """ - cursor: String! + length: Float + """ + The number of personnel needed to run or pilot this vehicle. + """ + crew: String + """ + The number of non-essential people this vehicle can transport. + """ + passengers: String + """ + The maximum speed of this vehicle in atmosphere. + """ + maxAtmospheringSpeed: Int + """ + The maximum number of kilograms that this vehicle can transport. + """ + cargoCapacity: Float + """ + The maximum length of time that this vehicle can provide consumables for its + entire crew without having to resupply. + """ + consumables: String + pilotConnection(after: String, first: Int, before: String, last: Int): VehiclePilotsConnection + filmConnection(after: String, first: Int, before: String, last: Int): VehicleFilmsConnection + """ + The ISO 8601 date format of the time that this resource was created. + """ + created: String + """ + The ISO 8601 date format of the time that this resource was edited. + """ + edited: String + """ + The ID of an object + """ + id: ID! } """ A connection to a list of items. """ -type SpeciesConnection { +type VehicleFilmsConnection { """ Information to aid in pagination. """ @@ -1292,7 +1290,7 @@ type SpeciesConnection { """ A list of edges. """ - edges: [SpeciesEdge] + edges: [VehicleFilmsEdge] """ A count of the total number of objects in this connection, ignoring pagination. This allows a client to fetch the first five objects by passing "5" as the @@ -1308,17 +1306,17 @@ type SpeciesConnection { the edge to enable efficient pagination, this shortcut cannot be used, and the full "{ edges { node } }" version should be used instead. """ - species: [Species] + films: [Film] } """ An edge in a connection. """ -type SpeciesEdge { +type VehicleFilmsEdge { """ The item at the end of the edge """ - node: Species + node: Film """ A cursor for use in pagination """ @@ -1328,7 +1326,7 @@ type SpeciesEdge { """ A connection to a list of items. """ -type StarshipsConnection { +type VehiclePilotsConnection { """ Information to aid in pagination. """ @@ -1336,7 +1334,7 @@ type StarshipsConnection { """ A list of edges. """ - edges: [StarshipsEdge] + edges: [VehiclePilotsEdge] """ A count of the total number of objects in this connection, ignoring pagination. This allows a client to fetch the first five objects by passing "5" as the @@ -1352,17 +1350,17 @@ type StarshipsConnection { the edge to enable efficient pagination, this shortcut cannot be used, and the full "{ edges { node } }" version should be used instead. """ - starships: [Starship] + pilots: [Person] } """ An edge in a connection. """ -type StarshipsEdge { +type VehiclePilotsEdge { """ The item at the end of the edge """ - node: Starship + node: Person """ A cursor for use in pagination """ @@ -1412,5 +1410,3 @@ type VehiclesEdge { """ cursor: String! } - - diff --git a/cynic-introspection/tests/snapshots/tests__2018_schema_conversion.snap b/cynic-introspection/tests/snapshots/tests__2018_schema_conversion.snap index 63e799a0c..0a49b3b13 100644 --- a/cynic-introspection/tests/snapshots/tests__2018_schema_conversion.snap +++ b/cynic-introspection/tests/snapshots/tests__2018_schema_conversion.snap @@ -1,19 +1,103 @@ --- source: cynic-introspection/tests/tests.rs expression: result.data.unwrap().into_schema().unwrap() +snapshot_kind: text --- Schema { query_type: "Root", mutation_type: None, subscription_type: None, types: [ + Scalar( + ScalarType { + name: "Boolean", + description: Some( + "The `Boolean` scalar type represents `true` or `false`.", + ), + specified_by_url: None, + }, + ), Object( ObjectType { - name: "Root", - description: None, + name: "Film", + description: Some( + "A single film.", + ), fields: [ Field { - name: "allFilms", + name: "title", + description: Some( + "The title of this film.", + ), + args: [], + ty: FieldType { + wrapping: [], + name: "String", + }, + deprecated: No, + }, + Field { + name: "episodeID", + description: Some( + "The episode number of this film.", + ), + args: [], + ty: FieldType { + wrapping: [], + name: "Int", + }, + deprecated: No, + }, + Field { + name: "openingCrawl", + description: Some( + "The opening paragraphs at the beginning of this film.", + ), + args: [], + ty: FieldType { + wrapping: [], + name: "String", + }, + deprecated: No, + }, + Field { + name: "director", + description: Some( + "The name of the director of this film.", + ), + args: [], + ty: FieldType { + wrapping: [], + name: "String", + }, + deprecated: No, + }, + Field { + name: "producers", + description: Some( + "The name(s) of the producer(s) of this film.", + ), + args: [], + ty: FieldType { + wrapping: [List], + name: "String", + }, + deprecated: No, + }, + Field { + name: "releaseDate", + description: Some( + "The ISO 8601 date format of film release at original creator country.", + ), + args: [], + ty: FieldType { + wrapping: [], + name: "String", + }, + deprecated: No, + }, + Field { + name: "speciesConnection", description: None, args: [ InputValue { @@ -55,41 +139,12 @@ Schema { ], ty: FieldType { wrapping: [], - name: "FilmsConnection", - }, - deprecated: No, - }, - Field { - name: "film", - description: None, - args: [ - InputValue { - name: "id", - description: None, - ty: FieldType { - wrapping: [], - name: "ID", - }, - default_value: None, - }, - InputValue { - name: "filmID", - description: None, - ty: FieldType { - wrapping: [], - name: "ID", - }, - default_value: None, - }, - ], - ty: FieldType { - wrapping: [], - name: "Film", + name: "FilmSpeciesConnection", }, deprecated: No, }, Field { - name: "allPeople", + name: "starshipConnection", description: None, args: [ InputValue { @@ -131,41 +186,12 @@ Schema { ], ty: FieldType { wrapping: [], - name: "PeopleConnection", - }, - deprecated: No, - }, - Field { - name: "person", - description: None, - args: [ - InputValue { - name: "id", - description: None, - ty: FieldType { - wrapping: [], - name: "ID", - }, - default_value: None, - }, - InputValue { - name: "personID", - description: None, - ty: FieldType { - wrapping: [], - name: "ID", - }, - default_value: None, - }, - ], - ty: FieldType { - wrapping: [], - name: "Person", + name: "FilmStarshipsConnection", }, deprecated: No, }, Field { - name: "allPlanets", + name: "vehicleConnection", description: None, args: [ InputValue { @@ -207,41 +233,12 @@ Schema { ], ty: FieldType { wrapping: [], - name: "PlanetsConnection", - }, - deprecated: No, - }, - Field { - name: "planet", - description: None, - args: [ - InputValue { - name: "id", - description: None, - ty: FieldType { - wrapping: [], - name: "ID", - }, - default_value: None, - }, - InputValue { - name: "planetID", - description: None, - ty: FieldType { - wrapping: [], - name: "ID", - }, - default_value: None, - }, - ], - ty: FieldType { - wrapping: [], - name: "Planet", + name: "FilmVehiclesConnection", }, deprecated: No, }, Field { - name: "allSpecies", + name: "characterConnection", description: None, args: [ InputValue { @@ -283,41 +280,12 @@ Schema { ], ty: FieldType { wrapping: [], - name: "SpeciesConnection", - }, - deprecated: No, - }, - Field { - name: "species", - description: None, - args: [ - InputValue { - name: "id", - description: None, - ty: FieldType { - wrapping: [], - name: "ID", - }, - default_value: None, - }, - InputValue { - name: "speciesID", - description: None, - ty: FieldType { - wrapping: [], - name: "ID", - }, - default_value: None, - }, - ], - ty: FieldType { - wrapping: [], - name: "Species", + name: "FilmCharactersConnection", }, deprecated: No, }, Field { - name: "allStarships", + name: "planetConnection", description: None, args: [ InputValue { @@ -359,164 +327,55 @@ Schema { ], ty: FieldType { wrapping: [], - name: "StarshipsConnection", + name: "FilmPlanetsConnection", }, deprecated: No, }, Field { - name: "starship", - description: None, - args: [ - InputValue { - name: "id", - description: None, - ty: FieldType { - wrapping: [], - name: "ID", - }, - default_value: None, - }, - InputValue { - name: "starshipID", - description: None, - ty: FieldType { - wrapping: [], - name: "ID", - }, - default_value: None, - }, - ], + name: "created", + description: Some( + "The ISO 8601 date format of the time that this resource was created.", + ), + args: [], ty: FieldType { wrapping: [], - name: "Starship", + name: "String", }, deprecated: No, }, Field { - name: "allVehicles", - description: None, - args: [ - InputValue { - name: "after", - description: None, - ty: FieldType { - wrapping: [], - name: "String", - }, - default_value: None, - }, - InputValue { - name: "first", - description: None, - ty: FieldType { - wrapping: [], - name: "Int", - }, - default_value: None, - }, - InputValue { - name: "before", - description: None, - ty: FieldType { - wrapping: [], - name: "String", - }, - default_value: None, - }, - InputValue { - name: "last", - description: None, - ty: FieldType { - wrapping: [], - name: "Int", - }, - default_value: None, - }, - ], - ty: FieldType { - wrapping: [], - name: "VehiclesConnection", - }, - deprecated: No, - }, - Field { - name: "vehicle", - description: None, - args: [ - InputValue { - name: "id", - description: None, - ty: FieldType { - wrapping: [], - name: "ID", - }, - default_value: None, - }, - InputValue { - name: "vehicleID", - description: None, - ty: FieldType { - wrapping: [], - name: "ID", - }, - default_value: None, - }, - ], + name: "edited", + description: Some( + "The ISO 8601 date format of the time that this resource was edited.", + ), + args: [], ty: FieldType { wrapping: [], - name: "Vehicle", + name: "String", }, deprecated: No, }, Field { - name: "node", + name: "id", description: Some( - "Fetches an object given its ID", + "The ID of an object", ), - args: [ - InputValue { - name: "id", - description: Some( - "The ID of an object", - ), - ty: FieldType { - wrapping: [NonNull], - name: "ID", - }, - default_value: None, - }, - ], + args: [], ty: FieldType { - wrapping: [], - name: "Node", + wrapping: [NonNull], + name: "ID", }, deprecated: No, }, ], - interfaces: [], - }, - ), - Scalar( - ScalarType { - name: "String", - description: Some( - "The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.", - ), - specified_by_url: None, - }, - ), - Scalar( - ScalarType { - name: "Int", - description: Some( - "The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.", - ), - specified_by_url: None, + interfaces: [ + "Node", + ], }, ), Object( ObjectType { - name: "FilmsConnection", + name: "FilmCharactersConnection", description: Some( "A connection to a list of items.", ), @@ -541,7 +400,7 @@ Schema { args: [], ty: FieldType { wrapping: [List], - name: "FilmsEdge", + name: "FilmCharactersEdge", }, deprecated: No, }, @@ -558,14 +417,14 @@ Schema { deprecated: No, }, Field { - name: "films", + name: "characters", description: Some( "A list of all of the objects returned in the connection. This is a convenience\nfield provided for quickly exploring the API; rather than querying for\n\"{ edges { node } }\" when no edge data is needed, this field can be be used\ninstead. Note that when clients like Relay need to fetch the \"cursor\" field on\nthe edge to enable efficient pagination, this shortcut cannot be used, and the\nfull \"{ edges { node } }\" version should be used instead.", ), args: [], ty: FieldType { wrapping: [List], - name: "Film", + name: "Person", }, deprecated: No, }, @@ -575,56 +434,91 @@ Schema { ), Object( ObjectType { - name: "PageInfo", + name: "FilmCharactersEdge", description: Some( - "Information about pagination in a connection.", + "An edge in a connection.", ), fields: [ Field { - name: "hasNextPage", + name: "node", description: Some( - "When paginating forwards, are there more items?", + "The item at the end of the edge", + ), + args: [], + ty: FieldType { + wrapping: [], + name: "Person", + }, + deprecated: No, + }, + Field { + name: "cursor", + description: Some( + "A cursor for use in pagination", ), args: [], ty: FieldType { wrapping: [NonNull], - name: "Boolean", + name: "String", }, deprecated: No, }, + ], + interfaces: [], + }, + ), + Object( + ObjectType { + name: "FilmPlanetsConnection", + description: Some( + "A connection to a list of items.", + ), + fields: [ Field { - name: "hasPreviousPage", + name: "pageInfo", description: Some( - "When paginating backwards, are there more items?", + "Information to aid in pagination.", ), args: [], ty: FieldType { wrapping: [NonNull], - name: "Boolean", + name: "PageInfo", }, deprecated: No, }, Field { - name: "startCursor", + name: "edges", description: Some( - "When paginating backwards, the cursor to continue.", + "A list of edges.", ), args: [], ty: FieldType { - wrapping: [], - name: "String", + wrapping: [List], + name: "FilmPlanetsEdge", }, deprecated: No, }, Field { - name: "endCursor", + name: "totalCount", description: Some( - "When paginating forwards, the cursor to continue.", + "A count of the total number of objects in this connection, ignoring pagination.\nThis allows a client to fetch the first five objects by passing \"5\" as the\nargument to \"first\", then fetch the total count so it could display \"5 of 83\",\nfor example.", ), args: [], ty: FieldType { wrapping: [], - name: "String", + name: "Int", + }, + deprecated: No, + }, + Field { + name: "planets", + description: Some( + "A list of all of the objects returned in the connection. This is a convenience\nfield provided for quickly exploring the API; rather than querying for\n\"{ edges { node } }\" when no edge data is needed, this field can be be used\ninstead. Note that when clients like Relay need to fetch the \"cursor\" field on\nthe edge to enable efficient pagination, this shortcut cannot be used, and the\nfull \"{ edges { node } }\" version should be used instead.", + ), + args: [], + ty: FieldType { + wrapping: [List], + name: "Planet", }, deprecated: No, }, @@ -632,18 +526,9 @@ Schema { interfaces: [], }, ), - Scalar( - ScalarType { - name: "Boolean", - description: Some( - "The `Boolean` scalar type represents `true` or `false`.", - ), - specified_by_url: None, - }, - ), Object( ObjectType { - name: "FilmsEdge", + name: "FilmPlanetsEdge", description: Some( "An edge in a connection.", ), @@ -656,7 +541,7 @@ Schema { args: [], ty: FieldType { wrapping: [], - name: "Film", + name: "Planet", }, deprecated: No, }, @@ -678,403 +563,101 @@ Schema { ), Object( ObjectType { - name: "Film", + name: "FilmSpeciesConnection", description: Some( - "A single film.", + "A connection to a list of items.", ), fields: [ Field { - name: "title", + name: "pageInfo", description: Some( - "The title of this film.", + "Information to aid in pagination.", ), args: [], ty: FieldType { - wrapping: [], - name: "String", + wrapping: [NonNull], + name: "PageInfo", }, deprecated: No, }, Field { - name: "episodeID", + name: "edges", description: Some( - "The episode number of this film.", + "A list of edges.", ), args: [], ty: FieldType { - wrapping: [], - name: "Int", + wrapping: [List], + name: "FilmSpeciesEdge", }, deprecated: No, }, Field { - name: "openingCrawl", + name: "totalCount", description: Some( - "The opening paragraphs at the beginning of this film.", + "A count of the total number of objects in this connection, ignoring pagination.\nThis allows a client to fetch the first five objects by passing \"5\" as the\nargument to \"first\", then fetch the total count so it could display \"5 of 83\",\nfor example.", ), args: [], ty: FieldType { wrapping: [], - name: "String", + name: "Int", }, deprecated: No, }, Field { - name: "director", + name: "species", description: Some( - "The name of the director of this film.", + "A list of all of the objects returned in the connection. This is a convenience\nfield provided for quickly exploring the API; rather than querying for\n\"{ edges { node } }\" when no edge data is needed, this field can be be used\ninstead. Note that when clients like Relay need to fetch the \"cursor\" field on\nthe edge to enable efficient pagination, this shortcut cannot be used, and the\nfull \"{ edges { node } }\" version should be used instead.", ), args: [], ty: FieldType { - wrapping: [], - name: "String", + wrapping: [List], + name: "Species", }, deprecated: No, }, + ], + interfaces: [], + }, + ), + Object( + ObjectType { + name: "FilmSpeciesEdge", + description: Some( + "An edge in a connection.", + ), + fields: [ Field { - name: "producers", + name: "node", description: Some( - "The name(s) of the producer(s) of this film.", + "The item at the end of the edge", ), args: [], ty: FieldType { - wrapping: [List], - name: "String", + wrapping: [], + name: "Species", }, deprecated: No, }, Field { - name: "releaseDate", + name: "cursor", description: Some( - "The ISO 8601 date format of film release at original creator country.", - ), - args: [], - ty: FieldType { - wrapping: [], - name: "String", - }, - deprecated: No, - }, - Field { - name: "speciesConnection", - description: None, - args: [ - InputValue { - name: "after", - description: None, - ty: FieldType { - wrapping: [], - name: "String", - }, - default_value: None, - }, - InputValue { - name: "first", - description: None, - ty: FieldType { - wrapping: [], - name: "Int", - }, - default_value: None, - }, - InputValue { - name: "before", - description: None, - ty: FieldType { - wrapping: [], - name: "String", - }, - default_value: None, - }, - InputValue { - name: "last", - description: None, - ty: FieldType { - wrapping: [], - name: "Int", - }, - default_value: None, - }, - ], - ty: FieldType { - wrapping: [], - name: "FilmSpeciesConnection", - }, - deprecated: No, - }, - Field { - name: "starshipConnection", - description: None, - args: [ - InputValue { - name: "after", - description: None, - ty: FieldType { - wrapping: [], - name: "String", - }, - default_value: None, - }, - InputValue { - name: "first", - description: None, - ty: FieldType { - wrapping: [], - name: "Int", - }, - default_value: None, - }, - InputValue { - name: "before", - description: None, - ty: FieldType { - wrapping: [], - name: "String", - }, - default_value: None, - }, - InputValue { - name: "last", - description: None, - ty: FieldType { - wrapping: [], - name: "Int", - }, - default_value: None, - }, - ], - ty: FieldType { - wrapping: [], - name: "FilmStarshipsConnection", - }, - deprecated: No, - }, - Field { - name: "vehicleConnection", - description: None, - args: [ - InputValue { - name: "after", - description: None, - ty: FieldType { - wrapping: [], - name: "String", - }, - default_value: None, - }, - InputValue { - name: "first", - description: None, - ty: FieldType { - wrapping: [], - name: "Int", - }, - default_value: None, - }, - InputValue { - name: "before", - description: None, - ty: FieldType { - wrapping: [], - name: "String", - }, - default_value: None, - }, - InputValue { - name: "last", - description: None, - ty: FieldType { - wrapping: [], - name: "Int", - }, - default_value: None, - }, - ], - ty: FieldType { - wrapping: [], - name: "FilmVehiclesConnection", - }, - deprecated: No, - }, - Field { - name: "characterConnection", - description: None, - args: [ - InputValue { - name: "after", - description: None, - ty: FieldType { - wrapping: [], - name: "String", - }, - default_value: None, - }, - InputValue { - name: "first", - description: None, - ty: FieldType { - wrapping: [], - name: "Int", - }, - default_value: None, - }, - InputValue { - name: "before", - description: None, - ty: FieldType { - wrapping: [], - name: "String", - }, - default_value: None, - }, - InputValue { - name: "last", - description: None, - ty: FieldType { - wrapping: [], - name: "Int", - }, - default_value: None, - }, - ], - ty: FieldType { - wrapping: [], - name: "FilmCharactersConnection", - }, - deprecated: No, - }, - Field { - name: "planetConnection", - description: None, - args: [ - InputValue { - name: "after", - description: None, - ty: FieldType { - wrapping: [], - name: "String", - }, - default_value: None, - }, - InputValue { - name: "first", - description: None, - ty: FieldType { - wrapping: [], - name: "Int", - }, - default_value: None, - }, - InputValue { - name: "before", - description: None, - ty: FieldType { - wrapping: [], - name: "String", - }, - default_value: None, - }, - InputValue { - name: "last", - description: None, - ty: FieldType { - wrapping: [], - name: "Int", - }, - default_value: None, - }, - ], - ty: FieldType { - wrapping: [], - name: "FilmPlanetsConnection", - }, - deprecated: No, - }, - Field { - name: "created", - description: Some( - "The ISO 8601 date format of the time that this resource was created.", - ), - args: [], - ty: FieldType { - wrapping: [], - name: "String", - }, - deprecated: No, - }, - Field { - name: "edited", - description: Some( - "The ISO 8601 date format of the time that this resource was edited.", - ), - args: [], - ty: FieldType { - wrapping: [], - name: "String", - }, - deprecated: No, - }, - Field { - name: "id", - description: Some( - "The ID of an object", - ), - args: [], - ty: FieldType { - wrapping: [NonNull], - name: "ID", - }, - deprecated: No, - }, - ], - interfaces: [ - "Node", - ], - }, - ), - Interface( - InterfaceType { - name: "Node", - description: Some( - "An object with an ID", - ), - fields: [ - Field { - name: "id", - description: Some( - "The id of the object.", + "A cursor for use in pagination", ), args: [], ty: FieldType { wrapping: [NonNull], - name: "ID", + name: "String", }, deprecated: No, }, ], interfaces: [], - possible_types: [ - "Film", - "Species", - "Planet", - "Person", - "Starship", - "Vehicle", - ], - }, - ), - Scalar( - ScalarType { - name: "ID", - description: Some( - "The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `\"4\"`) or integer (such as `4`) input value will be accepted as an ID.", - ), - specified_by_url: None, }, ), Object( ObjectType { - name: "FilmSpeciesConnection", + name: "FilmStarshipsConnection", description: Some( "A connection to a list of items.", ), @@ -1094,575 +677,355 @@ Schema { Field { name: "edges", description: Some( - "A list of edges.", - ), - args: [], - ty: FieldType { - wrapping: [List], - name: "FilmSpeciesEdge", - }, - deprecated: No, - }, - Field { - name: "totalCount", - description: Some( - "A count of the total number of objects in this connection, ignoring pagination.\nThis allows a client to fetch the first five objects by passing \"5\" as the\nargument to \"first\", then fetch the total count so it could display \"5 of 83\",\nfor example.", - ), - args: [], - ty: FieldType { - wrapping: [], - name: "Int", - }, - deprecated: No, - }, - Field { - name: "species", - description: Some( - "A list of all of the objects returned in the connection. This is a convenience\nfield provided for quickly exploring the API; rather than querying for\n\"{ edges { node } }\" when no edge data is needed, this field can be be used\ninstead. Note that when clients like Relay need to fetch the \"cursor\" field on\nthe edge to enable efficient pagination, this shortcut cannot be used, and the\nfull \"{ edges { node } }\" version should be used instead.", - ), - args: [], - ty: FieldType { - wrapping: [List], - name: "Species", - }, - deprecated: No, - }, - ], - interfaces: [], - }, - ), - Object( - ObjectType { - name: "FilmSpeciesEdge", - description: Some( - "An edge in a connection.", - ), - fields: [ - Field { - name: "node", - description: Some( - "The item at the end of the edge", - ), - args: [], - ty: FieldType { - wrapping: [], - name: "Species", - }, - deprecated: No, - }, - Field { - name: "cursor", - description: Some( - "A cursor for use in pagination", - ), - args: [], - ty: FieldType { - wrapping: [NonNull], - name: "String", - }, - deprecated: No, - }, - ], - interfaces: [], - }, - ), - Object( - ObjectType { - name: "Species", - description: Some( - "A type of person or character within the Star Wars Universe.", - ), - fields: [ - Field { - name: "name", - description: Some( - "The name of this species.", - ), - args: [], - ty: FieldType { - wrapping: [], - name: "String", - }, - deprecated: No, - }, - Field { - name: "classification", - description: Some( - "The classification of this species, such as \"mammal\" or \"reptile\".", - ), - args: [], - ty: FieldType { - wrapping: [], - name: "String", - }, - deprecated: No, - }, - Field { - name: "designation", - description: Some( - "The designation of this species, such as \"sentient\".", - ), - args: [], - ty: FieldType { - wrapping: [], - name: "String", - }, - deprecated: No, - }, - Field { - name: "averageHeight", - description: Some( - "The average height of this species in centimeters.", - ), - args: [], - ty: FieldType { - wrapping: [], - name: "Float", - }, - deprecated: No, - }, - Field { - name: "averageLifespan", - description: Some( - "The average lifespan of this species in years, null if unknown.", - ), - args: [], - ty: FieldType { - wrapping: [], - name: "Int", - }, - deprecated: No, - }, - Field { - name: "eyeColors", - description: Some( - "Common eye colors for this species, null if this species does not typically\nhave eyes.", - ), - args: [], - ty: FieldType { - wrapping: [List], - name: "String", - }, - deprecated: No, - }, - Field { - name: "hairColors", - description: Some( - "Common hair colors for this species, null if this species does not typically\nhave hair.", + "A list of edges.", ), args: [], ty: FieldType { wrapping: [List], - name: "String", + name: "FilmStarshipsEdge", }, deprecated: No, }, Field { - name: "skinColors", + name: "totalCount", description: Some( - "Common skin colors for this species, null if this species does not typically\nhave skin.", + "A count of the total number of objects in this connection, ignoring pagination.\nThis allows a client to fetch the first five objects by passing \"5\" as the\nargument to \"first\", then fetch the total count so it could display \"5 of 83\",\nfor example.", ), args: [], ty: FieldType { - wrapping: [List], - name: "String", + wrapping: [], + name: "Int", }, deprecated: No, }, Field { - name: "language", + name: "starships", description: Some( - "The language commonly spoken by this species.", + "A list of all of the objects returned in the connection. This is a convenience\nfield provided for quickly exploring the API; rather than querying for\n\"{ edges { node } }\" when no edge data is needed, this field can be be used\ninstead. Note that when clients like Relay need to fetch the \"cursor\" field on\nthe edge to enable efficient pagination, this shortcut cannot be used, and the\nfull \"{ edges { node } }\" version should be used instead.", ), args: [], ty: FieldType { - wrapping: [], - name: "String", + wrapping: [List], + name: "Starship", }, deprecated: No, }, + ], + interfaces: [], + }, + ), + Object( + ObjectType { + name: "FilmStarshipsEdge", + description: Some( + "An edge in a connection.", + ), + fields: [ Field { - name: "homeworld", + name: "node", description: Some( - "A planet that this species originates from.", + "The item at the end of the edge", ), args: [], ty: FieldType { wrapping: [], - name: "Planet", + name: "Starship", }, deprecated: No, }, Field { - name: "personConnection", - description: None, - args: [ - InputValue { - name: "after", - description: None, - ty: FieldType { - wrapping: [], - name: "String", - }, - default_value: None, - }, - InputValue { - name: "first", - description: None, - ty: FieldType { - wrapping: [], - name: "Int", - }, - default_value: None, - }, - InputValue { - name: "before", - description: None, - ty: FieldType { - wrapping: [], - name: "String", - }, - default_value: None, - }, - InputValue { - name: "last", - description: None, - ty: FieldType { - wrapping: [], - name: "Int", - }, - default_value: None, - }, - ], + name: "cursor", + description: Some( + "A cursor for use in pagination", + ), + args: [], ty: FieldType { - wrapping: [], - name: "SpeciesPeopleConnection", + wrapping: [NonNull], + name: "String", }, deprecated: No, }, + ], + interfaces: [], + }, + ), + Object( + ObjectType { + name: "FilmVehiclesConnection", + description: Some( + "A connection to a list of items.", + ), + fields: [ Field { - name: "filmConnection", - description: None, - args: [ - InputValue { - name: "after", - description: None, - ty: FieldType { - wrapping: [], - name: "String", - }, - default_value: None, - }, - InputValue { - name: "first", - description: None, - ty: FieldType { - wrapping: [], - name: "Int", - }, - default_value: None, - }, - InputValue { - name: "before", - description: None, - ty: FieldType { - wrapping: [], - name: "String", - }, - default_value: None, - }, - InputValue { - name: "last", - description: None, - ty: FieldType { - wrapping: [], - name: "Int", - }, - default_value: None, - }, - ], + name: "pageInfo", + description: Some( + "Information to aid in pagination.", + ), + args: [], ty: FieldType { - wrapping: [], - name: "SpeciesFilmsConnection", + wrapping: [NonNull], + name: "PageInfo", }, deprecated: No, }, Field { - name: "created", + name: "edges", description: Some( - "The ISO 8601 date format of the time that this resource was created.", + "A list of edges.", ), args: [], ty: FieldType { - wrapping: [], - name: "String", + wrapping: [List], + name: "FilmVehiclesEdge", }, deprecated: No, }, Field { - name: "edited", + name: "totalCount", description: Some( - "The ISO 8601 date format of the time that this resource was edited.", + "A count of the total number of objects in this connection, ignoring pagination.\nThis allows a client to fetch the first five objects by passing \"5\" as the\nargument to \"first\", then fetch the total count so it could display \"5 of 83\",\nfor example.", ), args: [], ty: FieldType { wrapping: [], - name: "String", + name: "Int", }, deprecated: No, }, Field { - name: "id", + name: "vehicles", description: Some( - "The ID of an object", + "A list of all of the objects returned in the connection. This is a convenience\nfield provided for quickly exploring the API; rather than querying for\n\"{ edges { node } }\" when no edge data is needed, this field can be be used\ninstead. Note that when clients like Relay need to fetch the \"cursor\" field on\nthe edge to enable efficient pagination, this shortcut cannot be used, and the\nfull \"{ edges { node } }\" version should be used instead.", ), args: [], ty: FieldType { - wrapping: [NonNull], - name: "ID", + wrapping: [List], + name: "Vehicle", }, deprecated: No, }, ], - interfaces: [ - "Node", - ], - }, - ), - Scalar( - ScalarType { - name: "Float", - description: Some( - "The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](https://en.wikipedia.org/wiki/IEEE_floating_point).", - ), - specified_by_url: None, + interfaces: [], }, ), Object( ObjectType { - name: "Planet", + name: "FilmVehiclesEdge", description: Some( - "A large mass, planet or planetoid in the Star Wars Universe, at the time of\n0 ABY.", + "An edge in a connection.", ), fields: [ Field { - name: "name", - description: Some( - "The name of this planet.", - ), - args: [], - ty: FieldType { - wrapping: [], - name: "String", - }, - deprecated: No, - }, - Field { - name: "diameter", + name: "node", description: Some( - "The diameter of this planet in kilometers.", + "The item at the end of the edge", ), args: [], ty: FieldType { wrapping: [], - name: "Int", + name: "Vehicle", }, deprecated: No, }, Field { - name: "rotationPeriod", + name: "cursor", description: Some( - "The number of standard hours it takes for this planet to complete a single\nrotation on its axis.", + "A cursor for use in pagination", ), args: [], ty: FieldType { - wrapping: [], - name: "Int", + wrapping: [NonNull], + name: "String", }, deprecated: No, }, + ], + interfaces: [], + }, + ), + Object( + ObjectType { + name: "FilmsConnection", + description: Some( + "A connection to a list of items.", + ), + fields: [ Field { - name: "orbitalPeriod", + name: "pageInfo", description: Some( - "The number of standard days it takes for this planet to complete a single orbit\nof its local star.", + "Information to aid in pagination.", ), args: [], ty: FieldType { - wrapping: [], - name: "Int", + wrapping: [NonNull], + name: "PageInfo", }, deprecated: No, }, Field { - name: "gravity", + name: "edges", description: Some( - "A number denoting the gravity of this planet, where \"1\" is normal or 1 standard\nG. \"2\" is twice or 2 standard Gs. \"0.5\" is half or 0.5 standard Gs.", + "A list of edges.", ), args: [], ty: FieldType { - wrapping: [], - name: "String", + wrapping: [List], + name: "FilmsEdge", }, deprecated: No, }, Field { - name: "population", + name: "totalCount", description: Some( - "The average population of sentient beings inhabiting this planet.", + "A count of the total number of objects in this connection, ignoring pagination.\nThis allows a client to fetch the first five objects by passing \"5\" as the\nargument to \"first\", then fetch the total count so it could display \"5 of 83\",\nfor example.", ), args: [], ty: FieldType { wrapping: [], - name: "Float", + name: "Int", }, deprecated: No, }, Field { - name: "climates", + name: "films", description: Some( - "The climates of this planet.", + "A list of all of the objects returned in the connection. This is a convenience\nfield provided for quickly exploring the API; rather than querying for\n\"{ edges { node } }\" when no edge data is needed, this field can be be used\ninstead. Note that when clients like Relay need to fetch the \"cursor\" field on\nthe edge to enable efficient pagination, this shortcut cannot be used, and the\nfull \"{ edges { node } }\" version should be used instead.", ), args: [], ty: FieldType { wrapping: [List], - name: "String", + name: "Film", }, deprecated: No, }, + ], + interfaces: [], + }, + ), + Object( + ObjectType { + name: "FilmsEdge", + description: Some( + "An edge in a connection.", + ), + fields: [ Field { - name: "terrains", + name: "node", description: Some( - "The terrains of this planet.", + "The item at the end of the edge", ), args: [], ty: FieldType { - wrapping: [List], - name: "String", + wrapping: [], + name: "Film", }, deprecated: No, }, Field { - name: "surfaceWater", + name: "cursor", description: Some( - "The percentage of the planet surface that is naturally occurring water or bodies\nof water.", + "A cursor for use in pagination", ), args: [], ty: FieldType { - wrapping: [], - name: "Float", + wrapping: [NonNull], + name: "String", }, deprecated: No, }, + ], + interfaces: [], + }, + ), + Scalar( + ScalarType { + name: "Float", + description: Some( + "The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](https://en.wikipedia.org/wiki/IEEE_floating_point).", + ), + specified_by_url: None, + }, + ), + Scalar( + ScalarType { + name: "ID", + description: None, + specified_by_url: None, + }, + ), + Scalar( + ScalarType { + name: "Int", + description: Some( + "The `Int` scalar type represents non-fractional whole numeric values.", + ), + specified_by_url: None, + }, + ), + Interface( + InterfaceType { + name: "Node", + description: Some( + "An object with an ID", + ), + fields: [ Field { - name: "residentConnection", + name: "id", description: None, - args: [ - InputValue { - name: "after", - description: None, - ty: FieldType { - wrapping: [], - name: "String", - }, - default_value: None, - }, - InputValue { - name: "first", - description: None, - ty: FieldType { - wrapping: [], - name: "Int", - }, - default_value: None, - }, - InputValue { - name: "before", - description: None, - ty: FieldType { - wrapping: [], - name: "String", - }, - default_value: None, - }, - InputValue { - name: "last", - description: None, - ty: FieldType { - wrapping: [], - name: "Int", - }, - default_value: None, - }, - ], + args: [], ty: FieldType { - wrapping: [], - name: "PlanetResidentsConnection", + wrapping: [NonNull], + name: "ID", }, deprecated: No, }, + ], + interfaces: [], + possible_types: [ + "Film", + "Species", + "Planet", + "Person", + "Starship", + "Vehicle", + ], + }, + ), + Object( + ObjectType { + name: "PageInfo", + description: Some( + "Information about pagination in a connection.", + ), + fields: [ Field { - name: "filmConnection", - description: None, - args: [ - InputValue { - name: "after", - description: None, - ty: FieldType { - wrapping: [], - name: "String", - }, - default_value: None, - }, - InputValue { - name: "first", - description: None, - ty: FieldType { - wrapping: [], - name: "Int", - }, - default_value: None, - }, - InputValue { - name: "before", - description: None, - ty: FieldType { - wrapping: [], - name: "String", - }, - default_value: None, - }, - InputValue { - name: "last", - description: None, - ty: FieldType { - wrapping: [], - name: "Int", - }, - default_value: None, - }, - ], + name: "hasNextPage", + description: Some( + "When paginating forwards, are there more items?", + ), + args: [], ty: FieldType { - wrapping: [], - name: "PlanetFilmsConnection", + wrapping: [NonNull], + name: "Boolean", }, deprecated: No, }, Field { - name: "created", + name: "hasPreviousPage", description: Some( - "The ISO 8601 date format of the time that this resource was created.", + "When paginating backwards, are there more items?", ), args: [], ty: FieldType { - wrapping: [], - name: "String", + wrapping: [NonNull], + name: "Boolean", }, deprecated: No, }, Field { - name: "edited", + name: "startCursor", description: Some( - "The ISO 8601 date format of the time that this resource was edited.", + "When paginating backwards, the cursor to continue.", ), args: [], ty: FieldType { @@ -1672,26 +1035,24 @@ Schema { deprecated: No, }, Field { - name: "id", + name: "endCursor", description: Some( - "The ID of an object", + "When paginating forwards, the cursor to continue.", ), args: [], ty: FieldType { - wrapping: [NonNull], - name: "ID", + wrapping: [], + name: "String", }, deprecated: No, }, ], - interfaces: [ - "Node", - ], + interfaces: [], }, ), Object( ObjectType { - name: "PlanetResidentsConnection", + name: "PeopleConnection", description: Some( "A connection to a list of items.", ), @@ -1716,7 +1077,7 @@ Schema { args: [], ty: FieldType { wrapping: [List], - name: "PlanetResidentsEdge", + name: "PeopleEdge", }, deprecated: No, }, @@ -1733,7 +1094,7 @@ Schema { deprecated: No, }, Field { - name: "residents", + name: "people", description: Some( "A list of all of the objects returned in the connection. This is a convenience\nfield provided for quickly exploring the API; rather than querying for\n\"{ edges { node } }\" when no edge data is needed, this field can be be used\ninstead. Note that when clients like Relay need to fetch the \"cursor\" field on\nthe edge to enable efficient pagination, this shortcut cannot be used, and the\nfull \"{ edges { node } }\" version should be used instead.", ), @@ -1750,7 +1111,7 @@ Schema { ), Object( ObjectType { - name: "PlanetResidentsEdge", + name: "PeopleEdge", description: Some( "An edge in a connection.", ), @@ -2283,123 +1644,169 @@ Schema { ), Object( ObjectType { - name: "Starship", + name: "PersonVehiclesConnection", description: Some( - "A single transport craft that has hyperdrive capability.", + "A connection to a list of items.", ), fields: [ Field { - name: "name", + name: "pageInfo", description: Some( - "The name of this starship. The common name, such as \"Death Star\".", + "Information to aid in pagination.", ), args: [], ty: FieldType { - wrapping: [], - name: "String", + wrapping: [NonNull], + name: "PageInfo", }, deprecated: No, }, Field { - name: "model", + name: "edges", description: Some( - "The model or official name of this starship. Such as \"T-65 X-wing\" or \"DS-1\nOrbital Battle Station\".", + "A list of edges.", + ), + args: [], + ty: FieldType { + wrapping: [List], + name: "PersonVehiclesEdge", + }, + deprecated: No, + }, + Field { + name: "totalCount", + description: Some( + "A count of the total number of objects in this connection, ignoring pagination.\nThis allows a client to fetch the first five objects by passing \"5\" as the\nargument to \"first\", then fetch the total count so it could display \"5 of 83\",\nfor example.", ), args: [], ty: FieldType { wrapping: [], - name: "String", + name: "Int", }, deprecated: No, }, Field { - name: "starshipClass", + name: "vehicles", description: Some( - "The class of this starship, such as \"Starfighter\" or \"Deep Space Mobile\nBattlestation\"", + "A list of all of the objects returned in the connection. This is a convenience\nfield provided for quickly exploring the API; rather than querying for\n\"{ edges { node } }\" when no edge data is needed, this field can be be used\ninstead. Note that when clients like Relay need to fetch the \"cursor\" field on\nthe edge to enable efficient pagination, this shortcut cannot be used, and the\nfull \"{ edges { node } }\" version should be used instead.", + ), + args: [], + ty: FieldType { + wrapping: [List], + name: "Vehicle", + }, + deprecated: No, + }, + ], + interfaces: [], + }, + ), + Object( + ObjectType { + name: "PersonVehiclesEdge", + description: Some( + "An edge in a connection.", + ), + fields: [ + Field { + name: "node", + description: Some( + "The item at the end of the edge", ), args: [], ty: FieldType { wrapping: [], - name: "String", + name: "Vehicle", }, deprecated: No, }, Field { - name: "manufacturers", + name: "cursor", description: Some( - "The manufacturers of this starship.", + "A cursor for use in pagination", ), args: [], ty: FieldType { - wrapping: [List], + wrapping: [NonNull], name: "String", }, deprecated: No, }, + ], + interfaces: [], + }, + ), + Object( + ObjectType { + name: "Planet", + description: Some( + "A large mass, planet or planetoid in the Star Wars Universe, at the time of\n0 ABY.", + ), + fields: [ Field { - name: "costInCredits", + name: "name", description: Some( - "The cost of this starship new, in galactic credits.", + "The name of this planet.", ), args: [], ty: FieldType { wrapping: [], - name: "Float", + name: "String", }, deprecated: No, }, Field { - name: "length", + name: "diameter", description: Some( - "The length of this starship in meters.", + "The diameter of this planet in kilometers.", ), args: [], ty: FieldType { wrapping: [], - name: "Float", + name: "Int", }, deprecated: No, }, Field { - name: "crew", + name: "rotationPeriod", description: Some( - "The number of personnel needed to run or pilot this starship.", + "The number of standard hours it takes for this planet to complete a single\nrotation on its axis.", ), args: [], ty: FieldType { wrapping: [], - name: "String", + name: "Int", }, deprecated: No, }, Field { - name: "passengers", + name: "orbitalPeriod", description: Some( - "The number of non-essential people this starship can transport.", + "The number of standard days it takes for this planet to complete a single orbit\nof its local star.", ), args: [], ty: FieldType { wrapping: [], - name: "String", + name: "Int", }, deprecated: No, }, Field { - name: "maxAtmospheringSpeed", + name: "gravity", description: Some( - "The maximum speed of this starship in atmosphere. null if this starship is\nincapable of atmosphering flight.", + "A number denoting the gravity of this planet, where \"1\" is normal or 1 standard\nG. \"2\" is twice or 2 standard Gs. \"0.5\" is half or 0.5 standard Gs.", ), args: [], ty: FieldType { wrapping: [], - name: "Int", + name: "String", }, deprecated: No, }, Field { - name: "hyperdriveRating", + name: "population", description: Some( - "The class of this starships hyperdrive.", + "The average population of sentient beings inhabiting this planet.", ), args: [], ty: FieldType { @@ -2409,43 +1816,43 @@ Schema { deprecated: No, }, Field { - name: "MGLT", + name: "climates", description: Some( - "The Maximum number of Megalights this starship can travel in a standard hour.\nA \"Megalight\" is a standard unit of distance and has never been defined before\nwithin the Star Wars universe. This figure is only really useful for measuring\nthe difference in speed of starships. We can assume it is similar to AU, the\ndistance between our Sun (Sol) and Earth.", + "The climates of this planet.", ), args: [], ty: FieldType { - wrapping: [], - name: "Int", + wrapping: [List], + name: "String", }, deprecated: No, }, Field { - name: "cargoCapacity", + name: "terrains", description: Some( - "The maximum number of kilograms that this starship can transport.", + "The terrains of this planet.", ), args: [], ty: FieldType { - wrapping: [], - name: "Float", + wrapping: [List], + name: "String", }, deprecated: No, }, Field { - name: "consumables", + name: "surfaceWater", description: Some( - "The maximum length of time that this starship can provide consumables for its\nentire crew without having to resupply.", + "The percentage of the planet surface that is naturally occurring water or bodies\nof water.", ), args: [], ty: FieldType { wrapping: [], - name: "String", + name: "Float", }, deprecated: No, }, Field { - name: "pilotConnection", + name: "residentConnection", description: None, args: [ InputValue { @@ -2487,7 +1894,7 @@ Schema { ], ty: FieldType { wrapping: [], - name: "StarshipPilotsConnection", + name: "PlanetResidentsConnection", }, deprecated: No, }, @@ -2534,55 +1941,243 @@ Schema { ], ty: FieldType { wrapping: [], - name: "StarshipFilmsConnection", + name: "PlanetFilmsConnection", + }, + deprecated: No, + }, + Field { + name: "created", + description: Some( + "The ISO 8601 date format of the time that this resource was created.", + ), + args: [], + ty: FieldType { + wrapping: [], + name: "String", + }, + deprecated: No, + }, + Field { + name: "edited", + description: Some( + "The ISO 8601 date format of the time that this resource was edited.", + ), + args: [], + ty: FieldType { + wrapping: [], + name: "String", + }, + deprecated: No, + }, + Field { + name: "id", + description: Some( + "The ID of an object", + ), + args: [], + ty: FieldType { + wrapping: [NonNull], + name: "ID", + }, + deprecated: No, + }, + ], + interfaces: [ + "Node", + ], + }, + ), + Object( + ObjectType { + name: "PlanetFilmsConnection", + description: Some( + "A connection to a list of items.", + ), + fields: [ + Field { + name: "pageInfo", + description: Some( + "Information to aid in pagination.", + ), + args: [], + ty: FieldType { + wrapping: [NonNull], + name: "PageInfo", + }, + deprecated: No, + }, + Field { + name: "edges", + description: Some( + "A list of edges.", + ), + args: [], + ty: FieldType { + wrapping: [List], + name: "PlanetFilmsEdge", + }, + deprecated: No, + }, + Field { + name: "totalCount", + description: Some( + "A count of the total number of objects in this connection, ignoring pagination.\nThis allows a client to fetch the first five objects by passing \"5\" as the\nargument to \"first\", then fetch the total count so it could display \"5 of 83\",\nfor example.", + ), + args: [], + ty: FieldType { + wrapping: [], + name: "Int", + }, + deprecated: No, + }, + Field { + name: "films", + description: Some( + "A list of all of the objects returned in the connection. This is a convenience\nfield provided for quickly exploring the API; rather than querying for\n\"{ edges { node } }\" when no edge data is needed, this field can be be used\ninstead. Note that when clients like Relay need to fetch the \"cursor\" field on\nthe edge to enable efficient pagination, this shortcut cannot be used, and the\nfull \"{ edges { node } }\" version should be used instead.", + ), + args: [], + ty: FieldType { + wrapping: [List], + name: "Film", + }, + deprecated: No, + }, + ], + interfaces: [], + }, + ), + Object( + ObjectType { + name: "PlanetFilmsEdge", + description: Some( + "An edge in a connection.", + ), + fields: [ + Field { + name: "node", + description: Some( + "The item at the end of the edge", + ), + args: [], + ty: FieldType { + wrapping: [], + name: "Film", + }, + deprecated: No, + }, + Field { + name: "cursor", + description: Some( + "A cursor for use in pagination", + ), + args: [], + ty: FieldType { + wrapping: [NonNull], + name: "String", + }, + deprecated: No, + }, + ], + interfaces: [], + }, + ), + Object( + ObjectType { + name: "PlanetResidentsConnection", + description: Some( + "A connection to a list of items.", + ), + fields: [ + Field { + name: "pageInfo", + description: Some( + "Information to aid in pagination.", + ), + args: [], + ty: FieldType { + wrapping: [NonNull], + name: "PageInfo", + }, + deprecated: No, + }, + Field { + name: "edges", + description: Some( + "A list of edges.", + ), + args: [], + ty: FieldType { + wrapping: [List], + name: "PlanetResidentsEdge", + }, + deprecated: No, + }, + Field { + name: "totalCount", + description: Some( + "A count of the total number of objects in this connection, ignoring pagination.\nThis allows a client to fetch the first five objects by passing \"5\" as the\nargument to \"first\", then fetch the total count so it could display \"5 of 83\",\nfor example.", + ), + args: [], + ty: FieldType { + wrapping: [], + name: "Int", }, deprecated: No, }, Field { - name: "created", + name: "residents", description: Some( - "The ISO 8601 date format of the time that this resource was created.", + "A list of all of the objects returned in the connection. This is a convenience\nfield provided for quickly exploring the API; rather than querying for\n\"{ edges { node } }\" when no edge data is needed, this field can be be used\ninstead. Note that when clients like Relay need to fetch the \"cursor\" field on\nthe edge to enable efficient pagination, this shortcut cannot be used, and the\nfull \"{ edges { node } }\" version should be used instead.", ), args: [], ty: FieldType { - wrapping: [], - name: "String", + wrapping: [List], + name: "Person", }, deprecated: No, }, + ], + interfaces: [], + }, + ), + Object( + ObjectType { + name: "PlanetResidentsEdge", + description: Some( + "An edge in a connection.", + ), + fields: [ Field { - name: "edited", + name: "node", description: Some( - "The ISO 8601 date format of the time that this resource was edited.", + "The item at the end of the edge", ), args: [], ty: FieldType { wrapping: [], - name: "String", + name: "Person", }, deprecated: No, }, Field { - name: "id", + name: "cursor", description: Some( - "The ID of an object", + "A cursor for use in pagination", ), args: [], ty: FieldType { wrapping: [NonNull], - name: "ID", + name: "String", }, deprecated: No, }, ], - interfaces: [ - "Node", - ], + interfaces: [], }, ), Object( ObjectType { - name: "StarshipPilotsConnection", + name: "PlanetsConnection", description: Some( "A connection to a list of items.", ), @@ -2607,7 +2202,7 @@ Schema { args: [], ty: FieldType { wrapping: [List], - name: "StarshipPilotsEdge", + name: "PlanetsEdge", }, deprecated: No, }, @@ -2624,14 +2219,14 @@ Schema { deprecated: No, }, Field { - name: "pilots", + name: "planets", description: Some( "A list of all of the objects returned in the connection. This is a convenience\nfield provided for quickly exploring the API; rather than querying for\n\"{ edges { node } }\" when no edge data is needed, this field can be be used\ninstead. Note that when clients like Relay need to fetch the \"cursor\" field on\nthe edge to enable efficient pagination, this shortcut cannot be used, and the\nfull \"{ edges { node } }\" version should be used instead.", ), args: [], ty: FieldType { wrapping: [List], - name: "Person", + name: "Planet", }, deprecated: No, }, @@ -2641,7 +2236,7 @@ Schema { ), Object( ObjectType { - name: "StarshipPilotsEdge", + name: "PlanetsEdge", description: Some( "An edge in a connection.", ), @@ -2654,7 +2249,7 @@ Schema { args: [], ty: FieldType { wrapping: [], - name: "Person", + name: "Planet", }, deprecated: No, }, @@ -2676,170 +2271,459 @@ Schema { ), Object( ObjectType { - name: "StarshipFilmsConnection", - description: Some( - "A connection to a list of items.", - ), + name: "Root", + description: None, fields: [ Field { - name: "pageInfo", - description: Some( - "Information to aid in pagination.", - ), - args: [], + name: "allFilms", + description: None, + args: [ + InputValue { + name: "after", + description: None, + ty: FieldType { + wrapping: [], + name: "String", + }, + default_value: None, + }, + InputValue { + name: "first", + description: None, + ty: FieldType { + wrapping: [], + name: "Int", + }, + default_value: None, + }, + InputValue { + name: "before", + description: None, + ty: FieldType { + wrapping: [], + name: "String", + }, + default_value: None, + }, + InputValue { + name: "last", + description: None, + ty: FieldType { + wrapping: [], + name: "Int", + }, + default_value: None, + }, + ], ty: FieldType { - wrapping: [NonNull], - name: "PageInfo", + wrapping: [], + name: "FilmsConnection", }, deprecated: No, }, Field { - name: "edges", - description: Some( - "A list of edges.", - ), - args: [], + name: "film", + description: None, + args: [ + InputValue { + name: "id", + description: None, + ty: FieldType { + wrapping: [], + name: "ID", + }, + default_value: None, + }, + InputValue { + name: "filmID", + description: None, + ty: FieldType { + wrapping: [], + name: "ID", + }, + default_value: None, + }, + ], ty: FieldType { - wrapping: [List], - name: "StarshipFilmsEdge", + wrapping: [], + name: "Film", }, deprecated: No, }, Field { - name: "totalCount", - description: Some( - "A count of the total number of objects in this connection, ignoring pagination.\nThis allows a client to fetch the first five objects by passing \"5\" as the\nargument to \"first\", then fetch the total count so it could display \"5 of 83\",\nfor example.", - ), - args: [], + name: "allPeople", + description: None, + args: [ + InputValue { + name: "after", + description: None, + ty: FieldType { + wrapping: [], + name: "String", + }, + default_value: None, + }, + InputValue { + name: "first", + description: None, + ty: FieldType { + wrapping: [], + name: "Int", + }, + default_value: None, + }, + InputValue { + name: "before", + description: None, + ty: FieldType { + wrapping: [], + name: "String", + }, + default_value: None, + }, + InputValue { + name: "last", + description: None, + ty: FieldType { + wrapping: [], + name: "Int", + }, + default_value: None, + }, + ], ty: FieldType { wrapping: [], - name: "Int", + name: "PeopleConnection", }, deprecated: No, }, Field { - name: "films", - description: Some( - "A list of all of the objects returned in the connection. This is a convenience\nfield provided for quickly exploring the API; rather than querying for\n\"{ edges { node } }\" when no edge data is needed, this field can be be used\ninstead. Note that when clients like Relay need to fetch the \"cursor\" field on\nthe edge to enable efficient pagination, this shortcut cannot be used, and the\nfull \"{ edges { node } }\" version should be used instead.", - ), - args: [], + name: "person", + description: None, + args: [ + InputValue { + name: "id", + description: None, + ty: FieldType { + wrapping: [], + name: "ID", + }, + default_value: None, + }, + InputValue { + name: "personID", + description: None, + ty: FieldType { + wrapping: [], + name: "ID", + }, + default_value: None, + }, + ], + ty: FieldType { + wrapping: [], + name: "Person", + }, + deprecated: No, + }, + Field { + name: "allPlanets", + description: None, + args: [ + InputValue { + name: "after", + description: None, + ty: FieldType { + wrapping: [], + name: "String", + }, + default_value: None, + }, + InputValue { + name: "first", + description: None, + ty: FieldType { + wrapping: [], + name: "Int", + }, + default_value: None, + }, + InputValue { + name: "before", + description: None, + ty: FieldType { + wrapping: [], + name: "String", + }, + default_value: None, + }, + InputValue { + name: "last", + description: None, + ty: FieldType { + wrapping: [], + name: "Int", + }, + default_value: None, + }, + ], ty: FieldType { - wrapping: [List], - name: "Film", + wrapping: [], + name: "PlanetsConnection", }, deprecated: No, }, - ], - interfaces: [], - }, - ), - Object( - ObjectType { - name: "StarshipFilmsEdge", - description: Some( - "An edge in a connection.", - ), - fields: [ Field { - name: "node", - description: Some( - "The item at the end of the edge", - ), - args: [], + name: "planet", + description: None, + args: [ + InputValue { + name: "id", + description: None, + ty: FieldType { + wrapping: [], + name: "ID", + }, + default_value: None, + }, + InputValue { + name: "planetID", + description: None, + ty: FieldType { + wrapping: [], + name: "ID", + }, + default_value: None, + }, + ], ty: FieldType { wrapping: [], - name: "Film", + name: "Planet", }, deprecated: No, }, Field { - name: "cursor", - description: Some( - "A cursor for use in pagination", - ), - args: [], + name: "allSpecies", + description: None, + args: [ + InputValue { + name: "after", + description: None, + ty: FieldType { + wrapping: [], + name: "String", + }, + default_value: None, + }, + InputValue { + name: "first", + description: None, + ty: FieldType { + wrapping: [], + name: "Int", + }, + default_value: None, + }, + InputValue { + name: "before", + description: None, + ty: FieldType { + wrapping: [], + name: "String", + }, + default_value: None, + }, + InputValue { + name: "last", + description: None, + ty: FieldType { + wrapping: [], + name: "Int", + }, + default_value: None, + }, + ], ty: FieldType { - wrapping: [NonNull], - name: "String", + wrapping: [], + name: "SpeciesConnection", }, deprecated: No, }, - ], - interfaces: [], - }, - ), - Object( - ObjectType { - name: "PersonVehiclesConnection", - description: Some( - "A connection to a list of items.", - ), - fields: [ Field { - name: "pageInfo", - description: Some( - "Information to aid in pagination.", - ), - args: [], + name: "species", + description: None, + args: [ + InputValue { + name: "id", + description: None, + ty: FieldType { + wrapping: [], + name: "ID", + }, + default_value: None, + }, + InputValue { + name: "speciesID", + description: None, + ty: FieldType { + wrapping: [], + name: "ID", + }, + default_value: None, + }, + ], ty: FieldType { - wrapping: [NonNull], - name: "PageInfo", + wrapping: [], + name: "Species", }, deprecated: No, }, Field { - name: "edges", - description: Some( - "A list of edges.", - ), - args: [], + name: "allStarships", + description: None, + args: [ + InputValue { + name: "after", + description: None, + ty: FieldType { + wrapping: [], + name: "String", + }, + default_value: None, + }, + InputValue { + name: "first", + description: None, + ty: FieldType { + wrapping: [], + name: "Int", + }, + default_value: None, + }, + InputValue { + name: "before", + description: None, + ty: FieldType { + wrapping: [], + name: "String", + }, + default_value: None, + }, + InputValue { + name: "last", + description: None, + ty: FieldType { + wrapping: [], + name: "Int", + }, + default_value: None, + }, + ], ty: FieldType { - wrapping: [List], - name: "PersonVehiclesEdge", + wrapping: [], + name: "StarshipsConnection", }, deprecated: No, }, Field { - name: "totalCount", - description: Some( - "A count of the total number of objects in this connection, ignoring pagination.\nThis allows a client to fetch the first five objects by passing \"5\" as the\nargument to \"first\", then fetch the total count so it could display \"5 of 83\",\nfor example.", - ), - args: [], + name: "starship", + description: None, + args: [ + InputValue { + name: "id", + description: None, + ty: FieldType { + wrapping: [], + name: "ID", + }, + default_value: None, + }, + InputValue { + name: "starshipID", + description: None, + ty: FieldType { + wrapping: [], + name: "ID", + }, + default_value: None, + }, + ], ty: FieldType { wrapping: [], - name: "Int", + name: "Starship", }, deprecated: No, }, Field { - name: "vehicles", - description: Some( - "A list of all of the objects returned in the connection. This is a convenience\nfield provided for quickly exploring the API; rather than querying for\n\"{ edges { node } }\" when no edge data is needed, this field can be be used\ninstead. Note that when clients like Relay need to fetch the \"cursor\" field on\nthe edge to enable efficient pagination, this shortcut cannot be used, and the\nfull \"{ edges { node } }\" version should be used instead.", - ), - args: [], + name: "allVehicles", + description: None, + args: [ + InputValue { + name: "after", + description: None, + ty: FieldType { + wrapping: [], + name: "String", + }, + default_value: None, + }, + InputValue { + name: "first", + description: None, + ty: FieldType { + wrapping: [], + name: "Int", + }, + default_value: None, + }, + InputValue { + name: "before", + description: None, + ty: FieldType { + wrapping: [], + name: "String", + }, + default_value: None, + }, + InputValue { + name: "last", + description: None, + ty: FieldType { + wrapping: [], + name: "Int", + }, + default_value: None, + }, + ], ty: FieldType { - wrapping: [List], - name: "Vehicle", + wrapping: [], + name: "VehiclesConnection", }, deprecated: No, }, - ], - interfaces: [], - }, - ), - Object( - ObjectType { - name: "PersonVehiclesEdge", - description: Some( - "An edge in a connection.", - ), - fields: [ Field { - name: "node", - description: Some( - "The item at the end of the edge", - ), - args: [], + name: "vehicle", + description: None, + args: [ + InputValue { + name: "id", + description: None, + ty: FieldType { + wrapping: [], + name: "ID", + }, + default_value: None, + }, + InputValue { + name: "vehicleID", + description: None, + ty: FieldType { + wrapping: [], + name: "ID", + }, + default_value: None, + }, + ], ty: FieldType { wrapping: [], name: "Vehicle", @@ -2847,14 +2731,26 @@ Schema { deprecated: No, }, Field { - name: "cursor", + name: "node", description: Some( - "A cursor for use in pagination", + "Fetches an object given its ID", ), - args: [], + args: [ + InputValue { + name: "id", + description: Some( + "The ID of an object", + ), + ty: FieldType { + wrapping: [NonNull], + name: "ID", + }, + default_value: None, + }, + ], ty: FieldType { - wrapping: [NonNull], - name: "String", + wrapping: [], + name: "Node", }, deprecated: No, }, @@ -2864,15 +2760,15 @@ Schema { ), Object( ObjectType { - name: "Vehicle", + name: "Species", description: Some( - "A single transport craft that does not have hyperdrive capability", + "A type of person or character within the Star Wars Universe.", ), fields: [ Field { name: "name", description: Some( - "The name of this vehicle. The common name, such as \"Sand Crawler\" or \"Speeder\nbike\".", + "The name of this species.", ), args: [], ty: FieldType { @@ -2882,9 +2778,9 @@ Schema { deprecated: No, }, Field { - name: "model", + name: "classification", description: Some( - "The model or official name of this vehicle. Such as \"All-Terrain Attack\nTransport\".", + "The classification of this species, such as \"mammal\" or \"reptile\".", ), args: [], ty: FieldType { @@ -2894,9 +2790,9 @@ Schema { deprecated: No, }, Field { - name: "vehicleClass", + name: "designation", description: Some( - "The class of this vehicle, such as \"Wheeled\" or \"Repulsorcraft\".", + "The designation of this species, such as \"sentient\".", ), args: [], ty: FieldType { @@ -2906,21 +2802,9 @@ Schema { deprecated: No, }, Field { - name: "manufacturers", - description: Some( - "The manufacturers of this vehicle.", - ), - args: [], - ty: FieldType { - wrapping: [List], - name: "String", - }, - deprecated: No, - }, - Field { - name: "costInCredits", + name: "averageHeight", description: Some( - "The cost of this vehicle new, in Galactic Credits.", + "The average height of this species in centimeters.", ), args: [], ty: FieldType { @@ -2930,79 +2814,79 @@ Schema { deprecated: No, }, Field { - name: "length", + name: "averageLifespan", description: Some( - "The length of this vehicle in meters.", + "The average lifespan of this species in years, null if unknown.", ), args: [], ty: FieldType { wrapping: [], - name: "Float", + name: "Int", }, deprecated: No, }, Field { - name: "crew", + name: "eyeColors", description: Some( - "The number of personnel needed to run or pilot this vehicle.", + "Common eye colors for this species, null if this species does not typically\nhave eyes.", ), args: [], ty: FieldType { - wrapping: [], + wrapping: [List], name: "String", }, deprecated: No, }, Field { - name: "passengers", + name: "hairColors", description: Some( - "The number of non-essential people this vehicle can transport.", + "Common hair colors for this species, null if this species does not typically\nhave hair.", ), args: [], ty: FieldType { - wrapping: [], + wrapping: [List], name: "String", }, deprecated: No, }, Field { - name: "maxAtmospheringSpeed", + name: "skinColors", description: Some( - "The maximum speed of this vehicle in atmosphere.", + "Common skin colors for this species, null if this species does not typically\nhave skin.", ), args: [], ty: FieldType { - wrapping: [], - name: "Int", + wrapping: [List], + name: "String", }, deprecated: No, }, Field { - name: "cargoCapacity", + name: "language", description: Some( - "The maximum number of kilograms that this vehicle can transport.", + "The language commonly spoken by this species.", ), args: [], ty: FieldType { wrapping: [], - name: "Float", + name: "String", }, deprecated: No, }, Field { - name: "consumables", + name: "homeworld", description: Some( - "The maximum length of time that this vehicle can provide consumables for its\nentire crew without having to resupply.", + "A planet that this species originates from.", ), args: [], ty: FieldType { wrapping: [], - name: "String", + name: "Planet", }, deprecated: No, }, Field { - name: "pilotConnection", + name: "personConnection", description: None, args: [ InputValue { @@ -3044,7 +2928,7 @@ Schema { ], ty: FieldType { wrapping: [], - name: "VehiclePilotsConnection", + name: "SpeciesPeopleConnection", }, deprecated: No, }, @@ -3091,7 +2975,7 @@ Schema { ], ty: FieldType { wrapping: [], - name: "VehicleFilmsConnection", + name: "SpeciesFilmsConnection", }, deprecated: No, }, @@ -3139,7 +3023,7 @@ Schema { ), Object( ObjectType { - name: "VehiclePilotsConnection", + name: "SpeciesConnection", description: Some( "A connection to a list of items.", ), @@ -3164,7 +3048,7 @@ Schema { args: [], ty: FieldType { wrapping: [List], - name: "VehiclePilotsEdge", + name: "SpeciesEdge", }, deprecated: No, }, @@ -3181,14 +3065,14 @@ Schema { deprecated: No, }, Field { - name: "pilots", + name: "species", description: Some( "A list of all of the objects returned in the connection. This is a convenience\nfield provided for quickly exploring the API; rather than querying for\n\"{ edges { node } }\" when no edge data is needed, this field can be be used\ninstead. Note that when clients like Relay need to fetch the \"cursor\" field on\nthe edge to enable efficient pagination, this shortcut cannot be used, and the\nfull \"{ edges { node } }\" version should be used instead.", ), args: [], ty: FieldType { wrapping: [List], - name: "Person", + name: "Species", }, deprecated: No, }, @@ -3198,7 +3082,7 @@ Schema { ), Object( ObjectType { - name: "VehiclePilotsEdge", + name: "SpeciesEdge", description: Some( "An edge in a connection.", ), @@ -3211,7 +3095,7 @@ Schema { args: [], ty: FieldType { wrapping: [], - name: "Person", + name: "Species", }, deprecated: No, }, @@ -3233,7 +3117,7 @@ Schema { ), Object( ObjectType { - name: "VehicleFilmsConnection", + name: "SpeciesFilmsConnection", description: Some( "A connection to a list of items.", ), @@ -3258,7 +3142,7 @@ Schema { args: [], ty: FieldType { wrapping: [List], - name: "VehicleFilmsEdge", + name: "SpeciesFilmsEdge", }, deprecated: No, }, @@ -3292,7 +3176,7 @@ Schema { ), Object( ObjectType { - name: "VehicleFilmsEdge", + name: "SpeciesFilmsEdge", description: Some( "An edge in a connection.", ), @@ -3327,7 +3211,7 @@ Schema { ), Object( ObjectType { - name: "PlanetFilmsConnection", + name: "SpeciesPeopleConnection", description: Some( "A connection to a list of items.", ), @@ -3335,125 +3219,197 @@ Schema { Field { name: "pageInfo", description: Some( - "Information to aid in pagination.", + "Information to aid in pagination.", + ), + args: [], + ty: FieldType { + wrapping: [NonNull], + name: "PageInfo", + }, + deprecated: No, + }, + Field { + name: "edges", + description: Some( + "A list of edges.", + ), + args: [], + ty: FieldType { + wrapping: [List], + name: "SpeciesPeopleEdge", + }, + deprecated: No, + }, + Field { + name: "totalCount", + description: Some( + "A count of the total number of objects in this connection, ignoring pagination.\nThis allows a client to fetch the first five objects by passing \"5\" as the\nargument to \"first\", then fetch the total count so it could display \"5 of 83\",\nfor example.", + ), + args: [], + ty: FieldType { + wrapping: [], + name: "Int", + }, + deprecated: No, + }, + Field { + name: "people", + description: Some( + "A list of all of the objects returned in the connection. This is a convenience\nfield provided for quickly exploring the API; rather than querying for\n\"{ edges { node } }\" when no edge data is needed, this field can be be used\ninstead. Note that when clients like Relay need to fetch the \"cursor\" field on\nthe edge to enable efficient pagination, this shortcut cannot be used, and the\nfull \"{ edges { node } }\" version should be used instead.", + ), + args: [], + ty: FieldType { + wrapping: [List], + name: "Person", + }, + deprecated: No, + }, + ], + interfaces: [], + }, + ), + Object( + ObjectType { + name: "SpeciesPeopleEdge", + description: Some( + "An edge in a connection.", + ), + fields: [ + Field { + name: "node", + description: Some( + "The item at the end of the edge", + ), + args: [], + ty: FieldType { + wrapping: [], + name: "Person", + }, + deprecated: No, + }, + Field { + name: "cursor", + description: Some( + "A cursor for use in pagination", + ), + args: [], + ty: FieldType { + wrapping: [NonNull], + name: "String", + }, + deprecated: No, + }, + ], + interfaces: [], + }, + ), + Object( + ObjectType { + name: "Starship", + description: Some( + "A single transport craft that has hyperdrive capability.", + ), + fields: [ + Field { + name: "name", + description: Some( + "The name of this starship. The common name, such as \"Death Star\".", ), args: [], ty: FieldType { - wrapping: [NonNull], - name: "PageInfo", + wrapping: [], + name: "String", }, deprecated: No, }, Field { - name: "edges", + name: "model", description: Some( - "A list of edges.", + "The model or official name of this starship. Such as \"T-65 X-wing\" or \"DS-1\nOrbital Battle Station\".", ), args: [], ty: FieldType { - wrapping: [List], - name: "PlanetFilmsEdge", + wrapping: [], + name: "String", }, deprecated: No, }, Field { - name: "totalCount", + name: "starshipClass", description: Some( - "A count of the total number of objects in this connection, ignoring pagination.\nThis allows a client to fetch the first five objects by passing \"5\" as the\nargument to \"first\", then fetch the total count so it could display \"5 of 83\",\nfor example.", + "The class of this starship, such as \"Starfighter\" or \"Deep Space Mobile\nBattlestation\"", ), args: [], ty: FieldType { wrapping: [], - name: "Int", + name: "String", }, deprecated: No, }, Field { - name: "films", + name: "manufacturers", description: Some( - "A list of all of the objects returned in the connection. This is a convenience\nfield provided for quickly exploring the API; rather than querying for\n\"{ edges { node } }\" when no edge data is needed, this field can be be used\ninstead. Note that when clients like Relay need to fetch the \"cursor\" field on\nthe edge to enable efficient pagination, this shortcut cannot be used, and the\nfull \"{ edges { node } }\" version should be used instead.", + "The manufacturers of this starship.", ), args: [], ty: FieldType { wrapping: [List], - name: "Film", + name: "String", }, deprecated: No, }, - ], - interfaces: [], - }, - ), - Object( - ObjectType { - name: "PlanetFilmsEdge", - description: Some( - "An edge in a connection.", - ), - fields: [ Field { - name: "node", + name: "costInCredits", description: Some( - "The item at the end of the edge", + "The cost of this starship new, in galactic credits.", ), args: [], ty: FieldType { wrapping: [], - name: "Film", + name: "Float", }, deprecated: No, }, Field { - name: "cursor", + name: "length", description: Some( - "A cursor for use in pagination", + "The length of this starship in meters.", ), args: [], ty: FieldType { - wrapping: [NonNull], - name: "String", + wrapping: [], + name: "Float", }, deprecated: No, }, - ], - interfaces: [], - }, - ), - Object( - ObjectType { - name: "SpeciesPeopleConnection", - description: Some( - "A connection to a list of items.", - ), - fields: [ Field { - name: "pageInfo", + name: "crew", description: Some( - "Information to aid in pagination.", + "The number of personnel needed to run or pilot this starship.", ), args: [], ty: FieldType { - wrapping: [NonNull], - name: "PageInfo", + wrapping: [], + name: "String", }, deprecated: No, }, Field { - name: "edges", + name: "passengers", description: Some( - "A list of edges.", + "The number of non-essential people this starship can transport.", ), args: [], ty: FieldType { - wrapping: [List], - name: "SpeciesPeopleEdge", + wrapping: [], + name: "String", }, deprecated: No, }, Field { - name: "totalCount", + name: "maxAtmospheringSpeed", description: Some( - "A count of the total number of objects in this connection, ignoring pagination.\nThis allows a client to fetch the first five objects by passing \"5\" as the\nargument to \"first\", then fetch the total count so it could display \"5 of 83\",\nfor example.", + "The maximum speed of this starship in atmosphere. null if this starship is\nincapable of atmosphering flight.", ), args: [], ty: FieldType { @@ -3463,153 +3419,192 @@ Schema { deprecated: No, }, Field { - name: "people", + name: "hyperdriveRating", description: Some( - "A list of all of the objects returned in the connection. This is a convenience\nfield provided for quickly exploring the API; rather than querying for\n\"{ edges { node } }\" when no edge data is needed, this field can be be used\ninstead. Note that when clients like Relay need to fetch the \"cursor\" field on\nthe edge to enable efficient pagination, this shortcut cannot be used, and the\nfull \"{ edges { node } }\" version should be used instead.", + "The class of this starships hyperdrive.", ), args: [], ty: FieldType { - wrapping: [List], - name: "Person", + wrapping: [], + name: "Float", }, deprecated: No, }, - ], - interfaces: [], - }, - ), - Object( - ObjectType { - name: "SpeciesPeopleEdge", - description: Some( - "An edge in a connection.", - ), - fields: [ Field { - name: "node", + name: "MGLT", description: Some( - "The item at the end of the edge", + "The Maximum number of Megalights this starship can travel in a standard hour.\nA \"Megalight\" is a standard unit of distance and has never been defined before\nwithin the Star Wars universe. This figure is only really useful for measuring\nthe difference in speed of starships. We can assume it is similar to AU, the\ndistance between our Sun (Sol) and Earth.", ), args: [], ty: FieldType { wrapping: [], - name: "Person", + name: "Int", }, deprecated: No, }, Field { - name: "cursor", + name: "cargoCapacity", description: Some( - "A cursor for use in pagination", + "The maximum number of kilograms that this starship can transport.", ), args: [], ty: FieldType { - wrapping: [NonNull], - name: "String", + wrapping: [], + name: "Float", }, deprecated: No, }, - ], - interfaces: [], - }, - ), - Object( - ObjectType { - name: "SpeciesFilmsConnection", - description: Some( - "A connection to a list of items.", - ), - fields: [ Field { - name: "pageInfo", + name: "consumables", description: Some( - "Information to aid in pagination.", + "The maximum length of time that this starship can provide consumables for its\nentire crew without having to resupply.", ), args: [], ty: FieldType { - wrapping: [NonNull], - name: "PageInfo", + wrapping: [], + name: "String", }, deprecated: No, }, Field { - name: "edges", - description: Some( - "A list of edges.", - ), - args: [], + name: "pilotConnection", + description: None, + args: [ + InputValue { + name: "after", + description: None, + ty: FieldType { + wrapping: [], + name: "String", + }, + default_value: None, + }, + InputValue { + name: "first", + description: None, + ty: FieldType { + wrapping: [], + name: "Int", + }, + default_value: None, + }, + InputValue { + name: "before", + description: None, + ty: FieldType { + wrapping: [], + name: "String", + }, + default_value: None, + }, + InputValue { + name: "last", + description: None, + ty: FieldType { + wrapping: [], + name: "Int", + }, + default_value: None, + }, + ], ty: FieldType { - wrapping: [List], - name: "SpeciesFilmsEdge", + wrapping: [], + name: "StarshipPilotsConnection", }, deprecated: No, }, Field { - name: "totalCount", - description: Some( - "A count of the total number of objects in this connection, ignoring pagination.\nThis allows a client to fetch the first five objects by passing \"5\" as the\nargument to \"first\", then fetch the total count so it could display \"5 of 83\",\nfor example.", - ), - args: [], + name: "filmConnection", + description: None, + args: [ + InputValue { + name: "after", + description: None, + ty: FieldType { + wrapping: [], + name: "String", + }, + default_value: None, + }, + InputValue { + name: "first", + description: None, + ty: FieldType { + wrapping: [], + name: "Int", + }, + default_value: None, + }, + InputValue { + name: "before", + description: None, + ty: FieldType { + wrapping: [], + name: "String", + }, + default_value: None, + }, + InputValue { + name: "last", + description: None, + ty: FieldType { + wrapping: [], + name: "Int", + }, + default_value: None, + }, + ], ty: FieldType { wrapping: [], - name: "Int", + name: "StarshipFilmsConnection", }, deprecated: No, }, Field { - name: "films", + name: "created", description: Some( - "A list of all of the objects returned in the connection. This is a convenience\nfield provided for quickly exploring the API; rather than querying for\n\"{ edges { node } }\" when no edge data is needed, this field can be be used\ninstead. Note that when clients like Relay need to fetch the \"cursor\" field on\nthe edge to enable efficient pagination, this shortcut cannot be used, and the\nfull \"{ edges { node } }\" version should be used instead.", + "The ISO 8601 date format of the time that this resource was created.", ), args: [], ty: FieldType { - wrapping: [List], - name: "Film", + wrapping: [], + name: "String", }, deprecated: No, }, - ], - interfaces: [], - }, - ), - Object( - ObjectType { - name: "SpeciesFilmsEdge", - description: Some( - "An edge in a connection.", - ), - fields: [ Field { - name: "node", + name: "edited", description: Some( - "The item at the end of the edge", + "The ISO 8601 date format of the time that this resource was edited.", ), args: [], ty: FieldType { wrapping: [], - name: "Film", + name: "String", }, deprecated: No, }, Field { - name: "cursor", + name: "id", description: Some( - "A cursor for use in pagination", + "The ID of an object", ), args: [], ty: FieldType { wrapping: [NonNull], - name: "String", + name: "ID", }, deprecated: No, }, ], - interfaces: [], + interfaces: [ + "Node", + ], }, ), Object( ObjectType { - name: "FilmStarshipsConnection", + name: "StarshipFilmsConnection", description: Some( "A connection to a list of items.", ), @@ -3634,7 +3629,7 @@ Schema { args: [], ty: FieldType { wrapping: [List], - name: "FilmStarshipsEdge", + name: "StarshipFilmsEdge", }, deprecated: No, }, @@ -3651,14 +3646,14 @@ Schema { deprecated: No, }, Field { - name: "starships", + name: "films", description: Some( "A list of all of the objects returned in the connection. This is a convenience\nfield provided for quickly exploring the API; rather than querying for\n\"{ edges { node } }\" when no edge data is needed, this field can be be used\ninstead. Note that when clients like Relay need to fetch the \"cursor\" field on\nthe edge to enable efficient pagination, this shortcut cannot be used, and the\nfull \"{ edges { node } }\" version should be used instead.", ), args: [], ty: FieldType { wrapping: [List], - name: "Starship", + name: "Film", }, deprecated: No, }, @@ -3668,7 +3663,7 @@ Schema { ), Object( ObjectType { - name: "FilmStarshipsEdge", + name: "StarshipFilmsEdge", description: Some( "An edge in a connection.", ), @@ -3681,7 +3676,7 @@ Schema { args: [], ty: FieldType { wrapping: [], - name: "Starship", + name: "Film", }, deprecated: No, }, @@ -3703,7 +3698,7 @@ Schema { ), Object( ObjectType { - name: "FilmVehiclesConnection", + name: "StarshipPilotsConnection", description: Some( "A connection to a list of items.", ), @@ -3728,7 +3723,7 @@ Schema { args: [], ty: FieldType { wrapping: [List], - name: "FilmVehiclesEdge", + name: "StarshipPilotsEdge", }, deprecated: No, }, @@ -3745,14 +3740,14 @@ Schema { deprecated: No, }, Field { - name: "vehicles", + name: "pilots", description: Some( "A list of all of the objects returned in the connection. This is a convenience\nfield provided for quickly exploring the API; rather than querying for\n\"{ edges { node } }\" when no edge data is needed, this field can be be used\ninstead. Note that when clients like Relay need to fetch the \"cursor\" field on\nthe edge to enable efficient pagination, this shortcut cannot be used, and the\nfull \"{ edges { node } }\" version should be used instead.", ), args: [], ty: FieldType { wrapping: [List], - name: "Vehicle", + name: "Person", }, deprecated: No, }, @@ -3762,7 +3757,7 @@ Schema { ), Object( ObjectType { - name: "FilmVehiclesEdge", + name: "StarshipPilotsEdge", description: Some( "An edge in a connection.", ), @@ -3775,7 +3770,7 @@ Schema { args: [], ty: FieldType { wrapping: [], - name: "Vehicle", + name: "Person", }, deprecated: No, }, @@ -3797,7 +3792,7 @@ Schema { ), Object( ObjectType { - name: "FilmCharactersConnection", + name: "StarshipsConnection", description: Some( "A connection to a list of items.", ), @@ -3822,7 +3817,7 @@ Schema { args: [], ty: FieldType { wrapping: [List], - name: "FilmCharactersEdge", + name: "StarshipsEdge", }, deprecated: No, }, @@ -3839,14 +3834,14 @@ Schema { deprecated: No, }, Field { - name: "characters", + name: "starships", description: Some( "A list of all of the objects returned in the connection. This is a convenience\nfield provided for quickly exploring the API; rather than querying for\n\"{ edges { node } }\" when no edge data is needed, this field can be be used\ninstead. Note that when clients like Relay need to fetch the \"cursor\" field on\nthe edge to enable efficient pagination, this shortcut cannot be used, and the\nfull \"{ edges { node } }\" version should be used instead.", ), args: [], ty: FieldType { wrapping: [List], - name: "Person", + name: "Starship", }, deprecated: No, }, @@ -3856,7 +3851,7 @@ Schema { ), Object( ObjectType { - name: "FilmCharactersEdge", + name: "StarshipsEdge", description: Some( "An edge in a connection.", ), @@ -3869,7 +3864,7 @@ Schema { args: [], ty: FieldType { wrapping: [], - name: "Person", + name: "Starship", }, deprecated: No, }, @@ -3889,197 +3884,293 @@ Schema { interfaces: [], }, ), + Scalar( + ScalarType { + name: "String", + description: Some( + "The `String` scalar type represents textual data, represented as UTF-8\ncharacter sequences. The String type is most often used by GraphQL to\nrepresent free-form human-readable text.", + ), + specified_by_url: None, + }, + ), Object( ObjectType { - name: "FilmPlanetsConnection", + name: "Vehicle", description: Some( - "A connection to a list of items.", + "A single transport craft that does not have hyperdrive capability", ), fields: [ Field { - name: "pageInfo", + name: "name", description: Some( - "Information to aid in pagination.", + "The name of this vehicle. The common name, such as \"Sand Crawler\" or \"Speeder\nbike\".", ), args: [], ty: FieldType { - wrapping: [NonNull], - name: "PageInfo", + wrapping: [], + name: "String", }, deprecated: No, }, Field { - name: "edges", + name: "model", description: Some( - "A list of edges.", + "The model or official name of this vehicle. Such as \"All-Terrain Attack\nTransport\".", ), args: [], ty: FieldType { - wrapping: [List], - name: "FilmPlanetsEdge", + wrapping: [], + name: "String", }, deprecated: No, }, Field { - name: "totalCount", + name: "vehicleClass", description: Some( - "A count of the total number of objects in this connection, ignoring pagination.\nThis allows a client to fetch the first five objects by passing \"5\" as the\nargument to \"first\", then fetch the total count so it could display \"5 of 83\",\nfor example.", + "The class of this vehicle, such as \"Wheeled\" or \"Repulsorcraft\".", ), args: [], ty: FieldType { wrapping: [], - name: "Int", + name: "String", }, deprecated: No, }, Field { - name: "planets", + name: "manufacturers", description: Some( - "A list of all of the objects returned in the connection. This is a convenience\nfield provided for quickly exploring the API; rather than querying for\n\"{ edges { node } }\" when no edge data is needed, this field can be be used\ninstead. Note that when clients like Relay need to fetch the \"cursor\" field on\nthe edge to enable efficient pagination, this shortcut cannot be used, and the\nfull \"{ edges { node } }\" version should be used instead.", + "The manufacturers of this vehicle.", ), args: [], ty: FieldType { wrapping: [List], - name: "Planet", + name: "String", }, deprecated: No, }, - ], - interfaces: [], - }, - ), - Object( - ObjectType { - name: "FilmPlanetsEdge", - description: Some( - "An edge in a connection.", - ), - fields: [ Field { - name: "node", + name: "costInCredits", description: Some( - "The item at the end of the edge", + "The cost of this vehicle new, in Galactic Credits.", ), args: [], ty: FieldType { wrapping: [], - name: "Planet", + name: "Float", }, deprecated: No, }, Field { - name: "cursor", + name: "length", description: Some( - "A cursor for use in pagination", + "The length of this vehicle in meters.", ), args: [], ty: FieldType { - wrapping: [NonNull], + wrapping: [], + name: "Float", + }, + deprecated: No, + }, + Field { + name: "crew", + description: Some( + "The number of personnel needed to run or pilot this vehicle.", + ), + args: [], + ty: FieldType { + wrapping: [], name: "String", }, deprecated: No, }, - ], - interfaces: [], - }, - ), - Object( - ObjectType { - name: "PeopleConnection", - description: Some( - "A connection to a list of items.", - ), - fields: [ Field { - name: "pageInfo", + name: "passengers", description: Some( - "Information to aid in pagination.", + "The number of non-essential people this vehicle can transport.", ), args: [], ty: FieldType { - wrapping: [NonNull], - name: "PageInfo", + wrapping: [], + name: "String", }, deprecated: No, }, Field { - name: "edges", + name: "maxAtmospheringSpeed", description: Some( - "A list of edges.", + "The maximum speed of this vehicle in atmosphere.", ), args: [], ty: FieldType { - wrapping: [List], - name: "PeopleEdge", + wrapping: [], + name: "Int", }, deprecated: No, }, Field { - name: "totalCount", + name: "cargoCapacity", description: Some( - "A count of the total number of objects in this connection, ignoring pagination.\nThis allows a client to fetch the first five objects by passing \"5\" as the\nargument to \"first\", then fetch the total count so it could display \"5 of 83\",\nfor example.", + "The maximum number of kilograms that this vehicle can transport.", + ), + args: [], + ty: FieldType { + wrapping: [], + name: "Float", + }, + deprecated: No, + }, + Field { + name: "consumables", + description: Some( + "The maximum length of time that this vehicle can provide consumables for its\nentire crew without having to resupply.", ), args: [], ty: FieldType { wrapping: [], - name: "Int", + name: "String", + }, + deprecated: No, + }, + Field { + name: "pilotConnection", + description: None, + args: [ + InputValue { + name: "after", + description: None, + ty: FieldType { + wrapping: [], + name: "String", + }, + default_value: None, + }, + InputValue { + name: "first", + description: None, + ty: FieldType { + wrapping: [], + name: "Int", + }, + default_value: None, + }, + InputValue { + name: "before", + description: None, + ty: FieldType { + wrapping: [], + name: "String", + }, + default_value: None, + }, + InputValue { + name: "last", + description: None, + ty: FieldType { + wrapping: [], + name: "Int", + }, + default_value: None, + }, + ], + ty: FieldType { + wrapping: [], + name: "VehiclePilotsConnection", + }, + deprecated: No, + }, + Field { + name: "filmConnection", + description: None, + args: [ + InputValue { + name: "after", + description: None, + ty: FieldType { + wrapping: [], + name: "String", + }, + default_value: None, + }, + InputValue { + name: "first", + description: None, + ty: FieldType { + wrapping: [], + name: "Int", + }, + default_value: None, + }, + InputValue { + name: "before", + description: None, + ty: FieldType { + wrapping: [], + name: "String", + }, + default_value: None, + }, + InputValue { + name: "last", + description: None, + ty: FieldType { + wrapping: [], + name: "Int", + }, + default_value: None, + }, + ], + ty: FieldType { + wrapping: [], + name: "VehicleFilmsConnection", }, deprecated: No, }, Field { - name: "people", + name: "created", description: Some( - "A list of all of the objects returned in the connection. This is a convenience\nfield provided for quickly exploring the API; rather than querying for\n\"{ edges { node } }\" when no edge data is needed, this field can be be used\ninstead. Note that when clients like Relay need to fetch the \"cursor\" field on\nthe edge to enable efficient pagination, this shortcut cannot be used, and the\nfull \"{ edges { node } }\" version should be used instead.", + "The ISO 8601 date format of the time that this resource was created.", ), args: [], ty: FieldType { - wrapping: [List], - name: "Person", + wrapping: [], + name: "String", }, deprecated: No, }, - ], - interfaces: [], - }, - ), - Object( - ObjectType { - name: "PeopleEdge", - description: Some( - "An edge in a connection.", - ), - fields: [ Field { - name: "node", + name: "edited", description: Some( - "The item at the end of the edge", + "The ISO 8601 date format of the time that this resource was edited.", ), args: [], ty: FieldType { wrapping: [], - name: "Person", + name: "String", }, deprecated: No, }, Field { - name: "cursor", + name: "id", description: Some( - "A cursor for use in pagination", + "The ID of an object", ), args: [], ty: FieldType { wrapping: [NonNull], - name: "String", + name: "ID", }, deprecated: No, }, ], - interfaces: [], + interfaces: [ + "Node", + ], }, ), Object( ObjectType { - name: "PlanetsConnection", + name: "VehicleFilmsConnection", description: Some( "A connection to a list of items.", ), @@ -4104,7 +4195,7 @@ Schema { args: [], ty: FieldType { wrapping: [List], - name: "PlanetsEdge", + name: "VehicleFilmsEdge", }, deprecated: No, }, @@ -4121,14 +4212,14 @@ Schema { deprecated: No, }, Field { - name: "planets", + name: "films", description: Some( "A list of all of the objects returned in the connection. This is a convenience\nfield provided for quickly exploring the API; rather than querying for\n\"{ edges { node } }\" when no edge data is needed, this field can be be used\ninstead. Note that when clients like Relay need to fetch the \"cursor\" field on\nthe edge to enable efficient pagination, this shortcut cannot be used, and the\nfull \"{ edges { node } }\" version should be used instead.", ), args: [], ty: FieldType { wrapping: [List], - name: "Planet", + name: "Film", }, deprecated: No, }, @@ -4138,7 +4229,7 @@ Schema { ), Object( ObjectType { - name: "PlanetsEdge", + name: "VehicleFilmsEdge", description: Some( "An edge in a connection.", ), @@ -4151,7 +4242,7 @@ Schema { args: [], ty: FieldType { wrapping: [], - name: "Planet", + name: "Film", }, deprecated: No, }, @@ -4173,7 +4264,7 @@ Schema { ), Object( ObjectType { - name: "SpeciesConnection", + name: "VehiclePilotsConnection", description: Some( "A connection to a list of items.", ), @@ -4198,7 +4289,7 @@ Schema { args: [], ty: FieldType { wrapping: [List], - name: "SpeciesEdge", + name: "VehiclePilotsEdge", }, deprecated: No, }, @@ -4215,14 +4306,14 @@ Schema { deprecated: No, }, Field { - name: "species", + name: "pilots", description: Some( "A list of all of the objects returned in the connection. This is a convenience\nfield provided for quickly exploring the API; rather than querying for\n\"{ edges { node } }\" when no edge data is needed, this field can be be used\ninstead. Note that when clients like Relay need to fetch the \"cursor\" field on\nthe edge to enable efficient pagination, this shortcut cannot be used, and the\nfull \"{ edges { node } }\" version should be used instead.", ), args: [], ty: FieldType { wrapping: [List], - name: "Species", + name: "Person", }, deprecated: No, }, @@ -4232,7 +4323,7 @@ Schema { ), Object( ObjectType { - name: "SpeciesEdge", + name: "VehiclePilotsEdge", description: Some( "An edge in a connection.", ), @@ -4245,7 +4336,7 @@ Schema { args: [], ty: FieldType { wrapping: [], - name: "Species", + name: "Person", }, deprecated: No, }, @@ -4267,7 +4358,7 @@ Schema { ), Object( ObjectType { - name: "StarshipsConnection", + name: "VehiclesConnection", description: Some( "A connection to a list of items.", ), @@ -4292,7 +4383,7 @@ Schema { args: [], ty: FieldType { wrapping: [List], - name: "StarshipsEdge", + name: "VehiclesEdge", }, deprecated: No, }, @@ -4309,14 +4400,14 @@ Schema { deprecated: No, }, Field { - name: "starships", + name: "vehicles", description: Some( "A list of all of the objects returned in the connection. This is a convenience\nfield provided for quickly exploring the API; rather than querying for\n\"{ edges { node } }\" when no edge data is needed, this field can be be used\ninstead. Note that when clients like Relay need to fetch the \"cursor\" field on\nthe edge to enable efficient pagination, this shortcut cannot be used, and the\nfull \"{ edges { node } }\" version should be used instead.", ), args: [], ty: FieldType { wrapping: [List], - name: "Starship", + name: "Vehicle", }, deprecated: No, }, @@ -4326,7 +4417,7 @@ Schema { ), Object( ObjectType { - name: "StarshipsEdge", + name: "VehiclesEdge", description: Some( "An edge in a connection.", ), @@ -4339,7 +4430,7 @@ Schema { args: [], ty: FieldType { wrapping: [], - name: "Starship", + name: "Vehicle", }, deprecated: No, }, @@ -4361,56 +4452,58 @@ Schema { ), Object( ObjectType { - name: "VehiclesConnection", + name: "__Directive", description: Some( - "A connection to a list of items.", + "A Directive provides a way to describe alternate runtime execution and type\nvalidation behavior in a GraphQL document.\n\nIn some cases, you need to provide options to alter GraphQL's execution\nbehavior in ways field arguments will not suffice, such as conditionally\nincluding or skipping a field. Directives provide this by describing\nadditional information to the executor.", ), fields: [ Field { - name: "pageInfo", - description: Some( - "Information to aid in pagination.", - ), + name: "name", + description: None, args: [], ty: FieldType { wrapping: [NonNull], - name: "PageInfo", + name: "String", }, deprecated: No, }, Field { - name: "edges", - description: Some( - "A list of edges.", - ), + name: "description", + description: None, args: [], ty: FieldType { - wrapping: [List], - name: "VehiclesEdge", + wrapping: [], + name: "String", }, deprecated: No, }, Field { - name: "totalCount", - description: Some( - "A count of the total number of objects in this connection, ignoring pagination.\nThis allows a client to fetch the first five objects by passing \"5\" as the\nargument to \"first\", then fetch the total count so it could display \"5 of 83\",\nfor example.", - ), + name: "locations", + description: None, args: [], ty: FieldType { - wrapping: [], - name: "Int", + wrapping: [NonNull, List, NonNull], + name: "__DirectiveLocation", }, deprecated: No, }, Field { - name: "vehicles", - description: Some( - "A list of all of the objects returned in the connection. This is a convenience\nfield provided for quickly exploring the API; rather than querying for\n\"{ edges { node } }\" when no edge data is needed, this field can be be used\ninstead. Note that when clients like Relay need to fetch the \"cursor\" field on\nthe edge to enable efficient pagination, this shortcut cannot be used, and the\nfull \"{ edges { node } }\" version should be used instead.", - ), + name: "args", + description: None, args: [], ty: FieldType { - wrapping: [List], - name: "Vehicle", + wrapping: [NonNull, List, NonNull], + name: "__InputValue", + }, + deprecated: No, + }, + Field { + name: "isRepeatable", + description: None, + args: [], + ty: FieldType { + wrapping: [NonNull], + name: "Boolean", }, deprecated: No, }, @@ -4418,105 +4511,193 @@ Schema { interfaces: [], }, ), - Object( - ObjectType { - name: "VehiclesEdge", + Enum( + EnumType { + name: "__DirectiveLocation", description: Some( - "An edge in a connection.", + "A Directive can be adjacent to many parts of the GraphQL language, a\n__DirectiveLocation describes one such possible adjacencies.", ), - fields: [ - Field { - name: "node", + values: [ + EnumValue { + name: "QUERY", + description: Some( + "Location adjacent to a query operation.", + ), + deprecated: No, + }, + EnumValue { + name: "MUTATION", + description: Some( + "Location adjacent to a mutation operation.", + ), + deprecated: No, + }, + EnumValue { + name: "SUBSCRIPTION", + description: Some( + "Location adjacent to a subscription operation.", + ), + deprecated: No, + }, + EnumValue { + name: "FIELD", + description: Some( + "Location adjacent to a field.", + ), + deprecated: No, + }, + EnumValue { + name: "FRAGMENT_DEFINITION", + description: Some( + "Location adjacent to a fragment definition.", + ), + deprecated: No, + }, + EnumValue { + name: "FRAGMENT_SPREAD", + description: Some( + "Location adjacent to a fragment spread.", + ), + deprecated: No, + }, + EnumValue { + name: "INLINE_FRAGMENT", + description: Some( + "Location adjacent to an inline fragment.", + ), + deprecated: No, + }, + EnumValue { + name: "VARIABLE_DEFINITION", + description: Some( + "Location adjacent to a variable definition.", + ), + deprecated: No, + }, + EnumValue { + name: "SCHEMA", + description: Some( + "Location adjacent to a schema definition.", + ), + deprecated: No, + }, + EnumValue { + name: "SCALAR", + description: Some( + "Location adjacent to a scalar definition.", + ), + deprecated: No, + }, + EnumValue { + name: "OBJECT", + description: Some( + "Location adjacent to an object type definition.", + ), + deprecated: No, + }, + EnumValue { + name: "FIELD_DEFINITION", + description: Some( + "Location adjacent to a field definition.", + ), + deprecated: No, + }, + EnumValue { + name: "ARGUMENT_DEFINITION", + description: Some( + "Location adjacent to an argument definition.", + ), + deprecated: No, + }, + EnumValue { + name: "INTERFACE", + description: Some( + "Location adjacent to an interface definition.", + ), + deprecated: No, + }, + EnumValue { + name: "UNION", + description: Some( + "Location adjacent to a union definition.", + ), + deprecated: No, + }, + EnumValue { + name: "ENUM", + description: Some( + "Location adjacent to an enum definition.", + ), + deprecated: No, + }, + EnumValue { + name: "ENUM_VALUE", + description: Some( + "Location adjacent to an enum value definition.", + ), + deprecated: No, + }, + EnumValue { + name: "INPUT_OBJECT", description: Some( - "The item at the end of the edge", + "Location adjacent to an input object type definition.", ), - args: [], - ty: FieldType { - wrapping: [], - name: "Vehicle", - }, deprecated: No, }, - Field { - name: "cursor", + EnumValue { + name: "INPUT_FIELD_DEFINITION", description: Some( - "A cursor for use in pagination", + "Location adjacent to an input object field definition.", ), - args: [], - ty: FieldType { - wrapping: [NonNull], - name: "String", - }, deprecated: No, }, ], - interfaces: [], }, ), Object( ObjectType { - name: "__Schema", + name: "__EnumValue", description: Some( - "A GraphQL Schema defines the capabilities of a GraphQL server. It exposes all available types and directives on the server, as well as the entry points for query, mutation, and subscription operations.", + "One possible value for a given Enum. Enum values are unique values, not a\nplaceholder for a string or numeric value. However an Enum value is returned\nin a JSON response as a string.", ), fields: [ Field { - name: "types", - description: Some( - "A list of all types supported by this server.", - ), - args: [], - ty: FieldType { - wrapping: [NonNull, List, NonNull], - name: "__Type", - }, - deprecated: No, - }, - Field { - name: "queryType", - description: Some( - "The type that query operations will be rooted at.", - ), + name: "name", + description: None, args: [], ty: FieldType { wrapping: [NonNull], - name: "__Type", + name: "String", }, deprecated: No, }, Field { - name: "mutationType", - description: Some( - "If this server supports mutation, the type that mutation operations will be rooted at.", - ), + name: "description", + description: None, args: [], ty: FieldType { wrapping: [], - name: "__Type", + name: "String", }, deprecated: No, }, Field { - name: "subscriptionType", - description: Some( - "If this server support subscription, the type that subscription operations will be rooted at.", - ), + name: "isDeprecated", + description: None, args: [], ty: FieldType { - wrapping: [], - name: "__Type", + wrapping: [NonNull], + name: "Boolean", }, deprecated: No, }, Field { - name: "directives", - description: Some( - "A list of all directives supported by this server.", - ), + name: "deprecationReason", + description: None, args: [], ty: FieldType { - wrapping: [NonNull, List, NonNull], - name: "__Directive", + wrapping: [], + name: "String", }, deprecated: No, }, @@ -4526,23 +4707,23 @@ Schema { ), Object( ObjectType { - name: "__Type", + name: "__Field", description: Some( - "The fundamental unit of any GraphQL Schema is the type. There are many kinds of types in GraphQL as represented by the `__TypeKind` enum.\n\nDepending on the kind of a type, certain fields describe information about that type. Scalar types provide no information beyond a name and description, while Enum types provide their values. Object and Interface types provide the fields they describe. Abstract types, Union and Interface, provide the Object types possible at runtime. List and NonNull types compose other types.", + "Object and Interface types are described by a list of Fields, each of which\nhas a name, potentially a list of arguments, and a return type.", ), fields: [ Field { - name: "kind", + name: "name", description: None, args: [], ty: FieldType { wrapping: [NonNull], - name: "__TypeKind", + name: "String", }, deprecated: No, }, Field { - name: "name", + name: "description", description: None, args: [], ty: FieldType { @@ -4552,233 +4733,164 @@ Schema { deprecated: No, }, Field { - name: "description", + name: "args", description: None, args: [], ty: FieldType { - wrapping: [], - name: "String", + wrapping: [NonNull, List, NonNull], + name: "__InputValue", }, deprecated: No, }, Field { - name: "fields", + name: "type", description: None, - args: [ - InputValue { - name: "includeDeprecated", - description: None, - ty: FieldType { - wrapping: [], - name: "Boolean", - }, - default_value: Some( - "false", - ), - }, - ], + args: [], ty: FieldType { - wrapping: [List, NonNull], - name: "__Field", + wrapping: [NonNull], + name: "__Type", }, deprecated: No, }, Field { - name: "interfaces", + name: "isDeprecated", description: None, args: [], ty: FieldType { - wrapping: [List, NonNull], - name: "__Type", + wrapping: [NonNull], + name: "Boolean", }, deprecated: No, }, Field { - name: "possibleTypes", + name: "deprecationReason", description: None, args: [], ty: FieldType { - wrapping: [List, NonNull], - name: "__Type", + wrapping: [], + name: "String", }, deprecated: No, }, + ], + interfaces: [], + }, + ), + Object( + ObjectType { + name: "__InputValue", + description: Some( + "Arguments provided to Fields or Directives and the input fields of an\nInputObject are represented as Input Values which describe their type and\noptionally a default value.", + ), + fields: [ Field { - name: "enumValues", + name: "name", description: None, - args: [ - InputValue { - name: "includeDeprecated", - description: None, - ty: FieldType { - wrapping: [], - name: "Boolean", - }, - default_value: Some( - "false", - ), - }, - ], + args: [], ty: FieldType { - wrapping: [List, NonNull], - name: "__EnumValue", + wrapping: [NonNull], + name: "String", }, deprecated: No, }, Field { - name: "inputFields", + name: "description", description: None, args: [], ty: FieldType { - wrapping: [List, NonNull], - name: "__InputValue", + wrapping: [], + name: "String", }, deprecated: No, }, Field { - name: "ofType", + name: "type", description: None, args: [], ty: FieldType { - wrapping: [], + wrapping: [NonNull], name: "__Type", }, deprecated: No, }, - ], - interfaces: [], - }, - ), - Enum( - EnumType { - name: "__TypeKind", - description: Some( - "An enum describing what kind of type a given `__Type` is.", - ), - values: [ - EnumValue { - name: "SCALAR", - description: Some( - "Indicates this type is a scalar.", - ), - deprecated: No, - }, - EnumValue { - name: "OBJECT", - description: Some( - "Indicates this type is an object. `fields` and `interfaces` are valid fields.", - ), - deprecated: No, - }, - EnumValue { - name: "INTERFACE", - description: Some( - "Indicates this type is an interface. `fields` and `possibleTypes` are valid fields.", - ), - deprecated: No, - }, - EnumValue { - name: "UNION", - description: Some( - "Indicates this type is a union. `possibleTypes` is a valid field.", - ), - deprecated: No, - }, - EnumValue { - name: "ENUM", - description: Some( - "Indicates this type is an enum. `enumValues` is a valid field.", - ), - deprecated: No, - }, - EnumValue { - name: "INPUT_OBJECT", - description: Some( - "Indicates this type is an input object. `inputFields` is a valid field.", - ), - deprecated: No, - }, - EnumValue { - name: "LIST", - description: Some( - "Indicates this type is a list. `ofType` is a valid field.", - ), - deprecated: No, - }, - EnumValue { - name: "NON_NULL", - description: Some( - "Indicates this type is a non-null. `ofType` is a valid field.", - ), + Field { + name: "defaultValue", + description: None, + args: [], + ty: FieldType { + wrapping: [], + name: "String", + }, deprecated: No, }, ], + interfaces: [], }, ), Object( ObjectType { - name: "__Field", + name: "__Schema", description: Some( - "Object and Interface types are described by a list of Fields, each of which has a name, potentially a list of arguments, and a return type.", + "A GraphQL Schema defines the capabilities of a GraphQL server. It exposes\nall available types and directives on the server, as well as the entry\npoints for query, mutation, and subscription operations.", ), fields: [ Field { - name: "name", - description: None, - args: [], - ty: FieldType { - wrapping: [NonNull], - name: "String", - }, - deprecated: No, - }, - Field { - name: "description", - description: None, + name: "types", + description: Some( + "A list of all types supported by this server.", + ), args: [], ty: FieldType { - wrapping: [], - name: "String", + wrapping: [NonNull, List, NonNull], + name: "__Type", }, deprecated: No, }, Field { - name: "args", - description: None, + name: "queryType", + description: Some( + "The type that query operations will be rooted at.", + ), args: [], ty: FieldType { - wrapping: [NonNull, List, NonNull], - name: "__InputValue", + wrapping: [NonNull], + name: "__Type", }, deprecated: No, }, Field { - name: "type", - description: None, + name: "mutationType", + description: Some( + "If this server supports mutation, the type that mutation operations will\nbe rooted at.", + ), args: [], ty: FieldType { - wrapping: [NonNull], + wrapping: [], name: "__Type", }, deprecated: No, }, Field { - name: "isDeprecated", - description: None, + name: "subscriptionType", + description: Some( + "If this server support subscription, the type that subscription\noperations will be rooted at.", + ), args: [], ty: FieldType { - wrapping: [NonNull], - name: "Boolean", + wrapping: [], + name: "__Type", }, deprecated: No, }, Field { - name: "deprecationReason", - description: None, + name: "directives", + description: Some( + "A list of all directives supported by this server.", + ), args: [], ty: FieldType { - wrapping: [], - name: "String", + wrapping: [NonNull, List, NonNull], + name: "__Directive", }, deprecated: No, }, @@ -4788,23 +4900,23 @@ Schema { ), Object( ObjectType { - name: "__InputValue", + name: "__Type", description: Some( - "Arguments provided to Fields or Directives and the input fields of an InputObject are represented as Input Values which describe their type and optionally a default value.", + "The fundamental unit of any GraphQL Schema is the type. There are many kinds\nof types in GraphQL as represented by the `__TypeKind` enum.\n\nDepending on the kind of a type, certain fields describe information about\nthat type. Scalar types provide no information beyond a name and\ndescription, while Enum types provide their values. Object and Interface\ntypes provide the fields they describe. Abstract types, Union and Interface,\nprovide the Object types possible at runtime. List and NonNull types compose\nother types.", ), fields: [ Field { - name: "name", + name: "kind", description: None, args: [], ty: FieldType { wrapping: [NonNull], - name: "String", + name: "__TypeKind", }, deprecated: No, }, Field { - name: "description", + name: "name", description: None, args: [], ty: FieldType { @@ -4814,126 +4926,116 @@ Schema { deprecated: No, }, Field { - name: "type", + name: "description", description: None, args: [], - ty: FieldType { - wrapping: [NonNull], - name: "__Type", - }, - deprecated: No, - }, - Field { - name: "defaultValue", - description: Some( - "A GraphQL-formatted string representing the default value for this input value.", - ), - args: [], ty: FieldType { wrapping: [], name: "String", }, deprecated: No, }, - ], - interfaces: [], - }, - ), - Object( - ObjectType { - name: "__EnumValue", - description: Some( - "One possible value for a given Enum. Enum values are unique values, not a placeholder for a string or numeric value. However an Enum value is returned in a JSON response as a string.", - ), - fields: [ Field { - name: "name", + name: "fields", description: None, - args: [], + args: [ + InputValue { + name: "includeDeprecated", + description: None, + ty: FieldType { + wrapping: [NonNull], + name: "Boolean", + }, + default_value: Some( + "false", + ), + }, + ], ty: FieldType { - wrapping: [NonNull], - name: "String", + wrapping: [List, NonNull], + name: "__Field", }, deprecated: No, }, Field { - name: "description", + name: "interfaces", description: None, args: [], ty: FieldType { - wrapping: [], - name: "String", + wrapping: [List, NonNull], + name: "__Type", }, deprecated: No, }, Field { - name: "isDeprecated", + name: "possibleTypes", description: None, args: [], ty: FieldType { - wrapping: [NonNull], - name: "Boolean", + wrapping: [List, NonNull], + name: "__Type", }, deprecated: No, }, Field { - name: "deprecationReason", + name: "enumValues", description: None, - args: [], + args: [ + InputValue { + name: "includeDeprecated", + description: None, + ty: FieldType { + wrapping: [NonNull], + name: "Boolean", + }, + default_value: Some( + "false", + ), + }, + ], ty: FieldType { - wrapping: [], - name: "String", + wrapping: [List, NonNull], + name: "__EnumValue", }, deprecated: No, }, - ], - interfaces: [], - }, - ), - Object( - ObjectType { - name: "__Directive", - description: Some( - "A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document.\n\nIn some cases, you need to provide options to alter GraphQL's execution behavior in ways field arguments will not suffice, such as conditionally including or skipping a field. Directives provide this by describing additional information to the executor.", - ), - fields: [ Field { - name: "name", + name: "inputFields", description: None, args: [], ty: FieldType { - wrapping: [NonNull], - name: "String", + wrapping: [List, NonNull], + name: "__InputValue", }, deprecated: No, }, Field { - name: "description", + name: "ofType", description: None, args: [], ty: FieldType { wrapping: [], - name: "String", + name: "__Type", }, deprecated: No, }, Field { - name: "locations", + name: "specifiedByURL", description: None, args: [], ty: FieldType { - wrapping: [NonNull, List, NonNull], - name: "__DirectiveLocation", + wrapping: [], + name: "String", }, deprecated: No, }, Field { - name: "args", + name: "isOneOf", description: None, args: [], ty: FieldType { - wrapping: [NonNull, List, NonNull], - name: "__InputValue", + wrapping: [], + name: "Boolean", }, deprecated: No, }, @@ -4943,141 +5045,64 @@ Schema { ), Enum( EnumType { - name: "__DirectiveLocation", + name: "__TypeKind", description: Some( - "A Directive can be adjacent to many parts of the GraphQL language, a __DirectiveLocation describes one such possible adjacencies.", + "An enum describing what kind of type a given `__Type` is.", ), values: [ - EnumValue { - name: "QUERY", - description: Some( - "Location adjacent to a query operation.", - ), - deprecated: No, - }, - EnumValue { - name: "MUTATION", - description: Some( - "Location adjacent to a mutation operation.", - ), - deprecated: No, - }, - EnumValue { - name: "SUBSCRIPTION", - description: Some( - "Location adjacent to a subscription operation.", - ), - deprecated: No, - }, - EnumValue { - name: "FIELD", - description: Some( - "Location adjacent to a field.", - ), - deprecated: No, - }, - EnumValue { - name: "FRAGMENT_DEFINITION", - description: Some( - "Location adjacent to a fragment definition.", - ), - deprecated: No, - }, - EnumValue { - name: "FRAGMENT_SPREAD", - description: Some( - "Location adjacent to a fragment spread.", - ), - deprecated: No, - }, - EnumValue { - name: "INLINE_FRAGMENT", - description: Some( - "Location adjacent to an inline fragment.", - ), - deprecated: No, - }, - EnumValue { - name: "VARIABLE_DEFINITION", - description: Some( - "Location adjacent to a variable definition.", - ), - deprecated: No, - }, - EnumValue { - name: "SCHEMA", - description: Some( - "Location adjacent to a schema definition.", - ), - deprecated: No, - }, EnumValue { name: "SCALAR", description: Some( - "Location adjacent to a scalar definition.", + "Indicates this type is a scalar.", ), deprecated: No, }, EnumValue { name: "OBJECT", description: Some( - "Location adjacent to an object type definition.", - ), - deprecated: No, - }, - EnumValue { - name: "FIELD_DEFINITION", - description: Some( - "Location adjacent to a field definition.", - ), - deprecated: No, - }, - EnumValue { - name: "ARGUMENT_DEFINITION", - description: Some( - "Location adjacent to an argument definition.", + "Indicates this type is an object. `fields` and `interfaces` are valid\nfields.", ), deprecated: No, }, EnumValue { name: "INTERFACE", description: Some( - "Location adjacent to an interface definition.", + "Indicates this type is an interface. `fields` and `possibleTypes` are\nvalid fields.", ), deprecated: No, }, EnumValue { name: "UNION", description: Some( - "Location adjacent to a union definition.", + "Indicates this type is a union. `possibleTypes` is a valid field.", ), deprecated: No, }, EnumValue { name: "ENUM", description: Some( - "Location adjacent to an enum definition.", + "Indicates this type is an enum. `enumValues` is a valid field.", ), deprecated: No, }, EnumValue { - name: "ENUM_VALUE", + name: "INPUT_OBJECT", description: Some( - "Location adjacent to an enum value definition.", + "Indicates this type is an input object. `inputFields` is a valid field.", ), deprecated: No, }, EnumValue { - name: "INPUT_OBJECT", + name: "LIST", description: Some( - "Location adjacent to an input object type definition.", + "Indicates this type is a list. `ofType` is a valid field.", ), deprecated: No, }, EnumValue { - name: "INPUT_FIELD_DEFINITION", + name: "NON_NULL", description: Some( - "Location adjacent to an input object field definition.", + "Indicates this type is a non-null. `ofType` is a valid field.", ), deprecated: No, }, @@ -5134,30 +5159,5 @@ Schema { InlineFragment, ], }, - Directive { - name: "deprecated", - description: Some( - "Marks an element of a GraphQL schema as no longer supported.", - ), - args: [ - InputValue { - name: "reason", - description: Some( - "Explains why this element was deprecated, usually also including a suggestion for how to access supported similar data. Formatted using the Markdown syntax (as specified by [CommonMark](https://commonmark.org/).", - ), - ty: FieldType { - wrapping: [], - name: "String", - }, - default_value: Some( - "\"No longer supported\"", - ), - }, - ], - locations: [ - FieldDefinition, - EnumValue, - ], - }, ], } diff --git a/cynic-introspection/tests/snapshots/tests__running_2018_query.snap b/cynic-introspection/tests/snapshots/tests__running_2018_query.snap index 08f39914c..890109d7b 100644 --- a/cynic-introspection/tests/snapshots/tests__running_2018_query.snap +++ b/cynic-introspection/tests/snapshots/tests__running_2018_query.snap @@ -1,6 +1,7 @@ --- source: cynic-introspection/tests/tests.rs expression: result.data +snapshot_kind: text --- Some( IntrospectionQuery { @@ -14,16 +15,135 @@ Some( mutation_type: None, subscription_type: None, types: [ + Type { + kind: Scalar, + name: Some( + "Boolean", + ), + description: Some( + "The `Boolean` scalar type represents `true` or `false`.", + ), + fields: None, + input_fields: None, + interfaces: None, + enum_values: None, + possible_types: None, + specified_by_url: None, + }, Type { kind: Object, name: Some( - "Root", + "Film", + ), + description: Some( + "A single film.", ), - description: None, fields: Some( [ Field { - name: "allFilms", + name: "title", + description: Some( + "The title of this film.", + ), + args: [], + ty: FieldType { + kind: Scalar, + name: Some( + "String", + ), + of_type: None, + }, + is_deprecated: false, + deprecation_reason: None, + }, + Field { + name: "episodeID", + description: Some( + "The episode number of this film.", + ), + args: [], + ty: FieldType { + kind: Scalar, + name: Some( + "Int", + ), + of_type: None, + }, + is_deprecated: false, + deprecation_reason: None, + }, + Field { + name: "openingCrawl", + description: Some( + "The opening paragraphs at the beginning of this film.", + ), + args: [], + ty: FieldType { + kind: Scalar, + name: Some( + "String", + ), + of_type: None, + }, + is_deprecated: false, + deprecation_reason: None, + }, + Field { + name: "director", + description: Some( + "The name of the director of this film.", + ), + args: [], + ty: FieldType { + kind: Scalar, + name: Some( + "String", + ), + of_type: None, + }, + is_deprecated: false, + deprecation_reason: None, + }, + Field { + name: "producers", + description: Some( + "The name(s) of the producer(s) of this film.", + ), + args: [], + ty: FieldType { + kind: List, + name: None, + of_type: Some( + FieldType { + kind: Scalar, + name: Some( + "String", + ), + of_type: None, + }, + ), + }, + is_deprecated: false, + deprecation_reason: None, + }, + Field { + name: "releaseDate", + description: Some( + "The ISO 8601 date format of film release at original creator country.", + ), + args: [], + ty: FieldType { + kind: Scalar, + name: Some( + "String", + ), + of_type: None, + }, + is_deprecated: false, + deprecation_reason: None, + }, + Field { + name: "speciesConnection", description: None, args: [ InputValue { @@ -78,46 +198,7 @@ Some( ty: FieldType { kind: Object, name: Some( - "FilmsConnection", - ), - of_type: None, - }, - is_deprecated: false, - deprecation_reason: None, - }, - Field { - name: "film", - description: None, - args: [ - InputValue { - name: "id", - description: None, - ty: FieldType { - kind: Scalar, - name: Some( - "ID", - ), - of_type: None, - }, - default_value: None, - }, - InputValue { - name: "filmID", - description: None, - ty: FieldType { - kind: Scalar, - name: Some( - "ID", - ), - of_type: None, - }, - default_value: None, - }, - ], - ty: FieldType { - kind: Object, - name: Some( - "Film", + "FilmSpeciesConnection", ), of_type: None, }, @@ -125,7 +206,7 @@ Some( deprecation_reason: None, }, Field { - name: "allPeople", + name: "starshipConnection", description: None, args: [ InputValue { @@ -180,7 +261,7 @@ Some( ty: FieldType { kind: Object, name: Some( - "PeopleConnection", + "FilmStarshipsConnection", ), of_type: None, }, @@ -188,50 +269,35 @@ Some( deprecation_reason: None, }, Field { - name: "person", + name: "vehicleConnection", description: None, args: [ InputValue { - name: "id", + name: "after", description: None, ty: FieldType { kind: Scalar, name: Some( - "ID", + "String", ), of_type: None, }, default_value: None, }, InputValue { - name: "personID", + name: "first", description: None, ty: FieldType { kind: Scalar, name: Some( - "ID", + "Int", ), of_type: None, }, default_value: None, }, - ], - ty: FieldType { - kind: Object, - name: Some( - "Person", - ), - of_type: None, - }, - is_deprecated: false, - deprecation_reason: None, - }, - Field { - name: "allPlanets", - description: None, - args: [ InputValue { - name: "after", + name: "before", description: None, ty: FieldType { kind: Scalar, @@ -243,7 +309,7 @@ Some( default_value: None, }, InputValue { - name: "first", + name: "last", description: None, ty: FieldType { kind: Scalar, @@ -254,8 +320,23 @@ Some( }, default_value: None, }, + ], + ty: FieldType { + kind: Object, + name: Some( + "FilmVehiclesConnection", + ), + of_type: None, + }, + is_deprecated: false, + deprecation_reason: None, + }, + Field { + name: "characterConnection", + description: None, + args: [ InputValue { - name: "before", + name: "after", description: None, ty: FieldType { kind: Scalar, @@ -267,7 +348,7 @@ Some( default_value: None, }, InputValue { - name: "last", + name: "first", description: None, ty: FieldType { kind: Scalar, @@ -278,40 +359,25 @@ Some( }, default_value: None, }, - ], - ty: FieldType { - kind: Object, - name: Some( - "PlanetsConnection", - ), - of_type: None, - }, - is_deprecated: false, - deprecation_reason: None, - }, - Field { - name: "planet", - description: None, - args: [ InputValue { - name: "id", + name: "before", description: None, ty: FieldType { kind: Scalar, name: Some( - "ID", + "String", ), of_type: None, }, default_value: None, }, InputValue { - name: "planetID", + name: "last", description: None, ty: FieldType { kind: Scalar, name: Some( - "ID", + "Int", ), of_type: None, }, @@ -321,7 +387,7 @@ Some( ty: FieldType { kind: Object, name: Some( - "Planet", + "FilmCharactersConnection", ), of_type: None, }, @@ -329,7 +395,7 @@ Some( deprecation_reason: None, }, Field { - name: "allSpecies", + name: "planetConnection", description: None, args: [ InputValue { @@ -384,7 +450,7 @@ Some( ty: FieldType { kind: Object, name: Some( - "SpeciesConnection", + "FilmPlanetsConnection", ), of_type: None, }, @@ -392,38 +458,15 @@ Some( deprecation_reason: None, }, Field { - name: "species", - description: None, - args: [ - InputValue { - name: "id", - description: None, - ty: FieldType { - kind: Scalar, - name: Some( - "ID", - ), - of_type: None, - }, - default_value: None, - }, - InputValue { - name: "speciesID", - description: None, - ty: FieldType { - kind: Scalar, - name: Some( - "ID", - ), - of_type: None, - }, - default_value: None, - }, - ], + name: "created", + description: Some( + "The ISO 8601 date format of the time that this resource was created.", + ), + args: [], ty: FieldType { - kind: Object, + kind: Scalar, name: Some( - "Species", + "String", ), of_type: None, }, @@ -431,62 +474,15 @@ Some( deprecation_reason: None, }, Field { - name: "allStarships", - description: None, - args: [ - InputValue { - name: "after", - description: None, - ty: FieldType { - kind: Scalar, - name: Some( - "String", - ), - of_type: None, - }, - default_value: None, - }, - InputValue { - name: "first", - description: None, - ty: FieldType { - kind: Scalar, - name: Some( - "Int", - ), - of_type: None, - }, - default_value: None, - }, - InputValue { - name: "before", - description: None, - ty: FieldType { - kind: Scalar, - name: Some( - "String", - ), - of_type: None, - }, - default_value: None, - }, - InputValue { - name: "last", - description: None, - ty: FieldType { - kind: Scalar, - name: Some( - "Int", - ), - of_type: None, - }, - default_value: None, - }, - ], + name: "edited", + description: Some( + "The ISO 8601 date format of the time that this resource was edited.", + ), + args: [], ty: FieldType { - kind: Object, + kind: Scalar, name: Some( - "StarshipsConnection", + "String", ), of_type: None, }, @@ -494,101 +490,107 @@ Some( deprecation_reason: None, }, Field { - name: "starship", - description: None, - args: [ - InputValue { - name: "id", - description: None, - ty: FieldType { - kind: Scalar, - name: Some( - "ID", - ), - of_type: None, - }, - default_value: None, - }, - InputValue { - name: "starshipID", - description: None, - ty: FieldType { + name: "id", + description: Some( + "The ID of an object", + ), + args: [], + ty: FieldType { + kind: NonNull, + name: None, + of_type: Some( + FieldType { kind: Scalar, name: Some( "ID", ), of_type: None, }, - default_value: None, - }, - ], - ty: FieldType { - kind: Object, - name: Some( - "Starship", ), - of_type: None, }, is_deprecated: false, deprecation_reason: None, }, + ], + ), + input_fields: None, + interfaces: Some( + [ + NamedType { + name: Some( + "Node", + ), + }, + ], + ), + enum_values: None, + possible_types: None, + specified_by_url: None, + }, + Type { + kind: Object, + name: Some( + "FilmCharactersConnection", + ), + description: Some( + "A connection to a list of items.", + ), + fields: Some( + [ Field { - name: "allVehicles", - description: None, - args: [ - InputValue { - name: "after", - description: None, - ty: FieldType { - kind: Scalar, - name: Some( - "String", - ), - of_type: None, - }, - default_value: None, - }, - InputValue { - name: "first", - description: None, - ty: FieldType { - kind: Scalar, - name: Some( - "Int", - ), - of_type: None, - }, - default_value: None, - }, - InputValue { - name: "before", - description: None, - ty: FieldType { - kind: Scalar, + name: "pageInfo", + description: Some( + "Information to aid in pagination.", + ), + args: [], + ty: FieldType { + kind: NonNull, + name: None, + of_type: Some( + FieldType { + kind: Object, name: Some( - "String", + "PageInfo", ), of_type: None, }, - default_value: None, - }, - InputValue { - name: "last", - description: None, - ty: FieldType { - kind: Scalar, + ), + }, + is_deprecated: false, + deprecation_reason: None, + }, + Field { + name: "edges", + description: Some( + "A list of edges.", + ), + args: [], + ty: FieldType { + kind: List, + name: None, + of_type: Some( + FieldType { + kind: Object, name: Some( - "Int", + "FilmCharactersEdge", ), of_type: None, }, - default_value: None, - }, - ], + ), + }, + is_deprecated: false, + deprecation_reason: None, + }, + Field { + name: "totalCount", + description: Some( + "A count of the total number of objects in this connection, ignoring pagination.\nThis allows a client to fetch the first five objects by passing \"5\" as the\nargument to \"first\", then fetch the total count so it could display \"5 of 83\",\nfor example.", + ), + args: [], ty: FieldType { - kind: Object, + kind: Scalar, name: Some( - "VehiclesConnection", + "Int", ), of_type: None, }, @@ -596,38 +598,57 @@ Some( deprecation_reason: None, }, Field { - name: "vehicle", - description: None, - args: [ - InputValue { - name: "id", - description: None, - ty: FieldType { - kind: Scalar, - name: Some( - "ID", - ), - of_type: None, - }, - default_value: None, - }, - InputValue { - name: "vehicleID", - description: None, - ty: FieldType { - kind: Scalar, + name: "characters", + description: Some( + "A list of all of the objects returned in the connection. This is a convenience\nfield provided for quickly exploring the API; rather than querying for\n\"{ edges { node } }\" when no edge data is needed, this field can be be used\ninstead. Note that when clients like Relay need to fetch the \"cursor\" field on\nthe edge to enable efficient pagination, this shortcut cannot be used, and the\nfull \"{ edges { node } }\" version should be used instead.", + ), + args: [], + ty: FieldType { + kind: List, + name: None, + of_type: Some( + FieldType { + kind: Object, name: Some( - "ID", + "Person", ), of_type: None, }, - default_value: None, - }, - ], + ), + }, + is_deprecated: false, + deprecation_reason: None, + }, + ], + ), + input_fields: None, + interfaces: Some( + [], + ), + enum_values: None, + possible_types: None, + specified_by_url: None, + }, + Type { + kind: Object, + name: Some( + "FilmCharactersEdge", + ), + description: Some( + "An edge in a connection.", + ), + fields: Some( + [ + Field { + name: "node", + description: Some( + "The item at the end of the edge", + ), + args: [], ty: FieldType { kind: Object, name: Some( - "Vehicle", + "Person", ), of_type: None, }, @@ -635,38 +656,23 @@ Some( deprecation_reason: None, }, Field { - name: "node", + name: "cursor", description: Some( - "Fetches an object given its ID", + "A cursor for use in pagination", ), - args: [ - InputValue { - name: "id", - description: Some( - "The ID of an object", - ), - ty: FieldType { - kind: NonNull, - name: None, - of_type: Some( - FieldType { - kind: Scalar, - name: Some( - "ID", - ), - of_type: None, - }, + args: [], + ty: FieldType { + kind: NonNull, + name: None, + of_type: Some( + FieldType { + kind: Scalar, + name: Some( + "String", ), + of_type: None, }, - default_value: None, - }, - ], - ty: FieldType { - kind: Interface, - name: Some( - "Node", ), - of_type: None, }, is_deprecated: false, deprecation_reason: None, @@ -681,40 +687,10 @@ Some( possible_types: None, specified_by_url: None, }, - Type { - kind: Scalar, - name: Some( - "String", - ), - description: Some( - "The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.", - ), - fields: None, - input_fields: None, - interfaces: None, - enum_values: None, - possible_types: None, - specified_by_url: None, - }, - Type { - kind: Scalar, - name: Some( - "Int", - ), - description: Some( - "The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.", - ), - fields: None, - input_fields: None, - interfaces: None, - enum_values: None, - possible_types: None, - specified_by_url: None, - }, Type { kind: Object, name: Some( - "FilmsConnection", + "FilmPlanetsConnection", ), description: Some( "A connection to a list of items.", @@ -756,7 +732,7 @@ Some( FieldType { kind: Object, name: Some( - "FilmsEdge", + "FilmPlanetsEdge", ), of_type: None, }, @@ -782,7 +758,7 @@ Some( deprecation_reason: None, }, Field { - name: "films", + name: "planets", description: Some( "A list of all of the objects returned in the connection. This is a convenience\nfield provided for quickly exploring the API; rather than querying for\n\"{ edges { node } }\" when no edge data is needed, this field can be be used\ninstead. Note that when clients like Relay need to fetch the \"cursor\" field on\nthe edge to enable efficient pagination, this shortcut cannot be used, and the\nfull \"{ edges { node } }\" version should be used instead.", ), @@ -794,7 +770,7 @@ Some( FieldType { kind: Object, name: Some( - "Film", + "Planet", ), of_type: None, }, @@ -816,17 +792,33 @@ Some( Type { kind: Object, name: Some( - "PageInfo", + "FilmPlanetsEdge", ), description: Some( - "Information about pagination in a connection.", + "An edge in a connection.", ), fields: Some( [ Field { - name: "hasNextPage", + name: "node", description: Some( - "When paginating forwards, are there more items?", + "The item at the end of the edge", + ), + args: [], + ty: FieldType { + kind: Object, + name: Some( + "Planet", + ), + of_type: None, + }, + is_deprecated: false, + deprecation_reason: None, + }, + Field { + name: "cursor", + description: Some( + "A cursor for use in pagination", ), args: [], ty: FieldType { @@ -836,7 +828,7 @@ Some( FieldType { kind: Scalar, name: Some( - "Boolean", + "String", ), of_type: None, }, @@ -845,10 +837,30 @@ Some( is_deprecated: false, deprecation_reason: None, }, + ], + ), + input_fields: None, + interfaces: Some( + [], + ), + enum_values: None, + possible_types: None, + specified_by_url: None, + }, + Type { + kind: Object, + name: Some( + "FilmSpeciesConnection", + ), + description: Some( + "A connection to a list of items.", + ), + fields: Some( + [ Field { - name: "hasPreviousPage", + name: "pageInfo", description: Some( - "When paginating backwards, are there more items?", + "Information to aid in pagination.", ), args: [], ty: FieldType { @@ -856,9 +868,9 @@ Some( name: None, of_type: Some( FieldType { - kind: Scalar, + kind: Object, name: Some( - "Boolean", + "PageInfo", ), of_type: None, }, @@ -868,37 +880,65 @@ Some( deprecation_reason: None, }, Field { - name: "startCursor", + name: "edges", description: Some( - "When paginating backwards, the cursor to continue.", + "A list of edges.", ), args: [], ty: FieldType { - kind: Scalar, - name: Some( - "String", + kind: List, + name: None, + of_type: Some( + FieldType { + kind: Object, + name: Some( + "FilmSpeciesEdge", + ), + of_type: None, + }, ), - of_type: None, }, is_deprecated: false, deprecation_reason: None, }, Field { - name: "endCursor", + name: "totalCount", description: Some( - "When paginating forwards, the cursor to continue.", + "A count of the total number of objects in this connection, ignoring pagination.\nThis allows a client to fetch the first five objects by passing \"5\" as the\nargument to \"first\", then fetch the total count so it could display \"5 of 83\",\nfor example.", ), args: [], ty: FieldType { kind: Scalar, name: Some( - "String", + "Int", ), of_type: None, }, is_deprecated: false, deprecation_reason: None, }, + Field { + name: "species", + description: Some( + "A list of all of the objects returned in the connection. This is a convenience\nfield provided for quickly exploring the API; rather than querying for\n\"{ edges { node } }\" when no edge data is needed, this field can be be used\ninstead. Note that when clients like Relay need to fetch the \"cursor\" field on\nthe edge to enable efficient pagination, this shortcut cannot be used, and the\nfull \"{ edges { node } }\" version should be used instead.", + ), + args: [], + ty: FieldType { + kind: List, + name: None, + of_type: Some( + FieldType { + kind: Object, + name: Some( + "Species", + ), + of_type: None, + }, + ), + }, + is_deprecated: false, + deprecation_reason: None, + }, ], ), input_fields: None, @@ -909,25 +949,10 @@ Some( possible_types: None, specified_by_url: None, }, - Type { - kind: Scalar, - name: Some( - "Boolean", - ), - description: Some( - "The `Boolean` scalar type represents `true` or `false`.", - ), - fields: None, - input_fields: None, - interfaces: None, - enum_values: None, - possible_types: None, - specified_by_url: None, - }, Type { kind: Object, name: Some( - "FilmsEdge", + "FilmSpeciesEdge", ), description: Some( "An edge in a connection.", @@ -943,7 +968,7 @@ Some( ty: FieldType { kind: Object, name: Some( - "Film", + "Species", ), of_type: None, }, @@ -985,33 +1010,61 @@ Some( Type { kind: Object, name: Some( - "Film", + "FilmStarshipsConnection", ), description: Some( - "A single film.", + "A connection to a list of items.", ), fields: Some( [ Field { - name: "title", + name: "pageInfo", description: Some( - "The title of this film.", + "Information to aid in pagination.", ), args: [], ty: FieldType { - kind: Scalar, - name: Some( - "String", + kind: NonNull, + name: None, + of_type: Some( + FieldType { + kind: Object, + name: Some( + "PageInfo", + ), + of_type: None, + }, ), - of_type: None, }, is_deprecated: false, deprecation_reason: None, }, Field { - name: "episodeID", + name: "edges", description: Some( - "The episode number of this film.", + "A list of edges.", + ), + args: [], + ty: FieldType { + kind: List, + name: None, + of_type: Some( + FieldType { + kind: Object, + name: Some( + "FilmStarshipsEdge", + ), + of_type: None, + }, + ), + }, + is_deprecated: false, + deprecation_reason: None, + }, + Field { + name: "totalCount", + description: Some( + "A count of the total number of objects in this connection, ignoring pagination.\nThis allows a client to fetch the first five objects by passing \"5\" as the\nargument to \"first\", then fetch the total count so it could display \"5 of 83\",\nfor example.", ), args: [], ty: FieldType { @@ -1025,31 +1078,57 @@ Some( deprecation_reason: None, }, Field { - name: "openingCrawl", + name: "starships", description: Some( - "The opening paragraphs at the beginning of this film.", + "A list of all of the objects returned in the connection. This is a convenience\nfield provided for quickly exploring the API; rather than querying for\n\"{ edges { node } }\" when no edge data is needed, this field can be be used\ninstead. Note that when clients like Relay need to fetch the \"cursor\" field on\nthe edge to enable efficient pagination, this shortcut cannot be used, and the\nfull \"{ edges { node } }\" version should be used instead.", ), args: [], ty: FieldType { - kind: Scalar, - name: Some( - "String", + kind: List, + name: None, + of_type: Some( + FieldType { + kind: Object, + name: Some( + "Starship", + ), + of_type: None, + }, ), - of_type: None, }, is_deprecated: false, deprecation_reason: None, }, + ], + ), + input_fields: None, + interfaces: Some( + [], + ), + enum_values: None, + possible_types: None, + specified_by_url: None, + }, + Type { + kind: Object, + name: Some( + "FilmStarshipsEdge", + ), + description: Some( + "An edge in a connection.", + ), + fields: Some( + [ Field { - name: "director", + name: "node", description: Some( - "The name of the director of this film.", + "The item at the end of the edge", ), args: [], ty: FieldType { - kind: Scalar, + kind: Object, name: Some( - "String", + "Starship", ), of_type: None, }, @@ -1057,13 +1136,13 @@ Some( deprecation_reason: None, }, Field { - name: "producers", + name: "cursor", description: Some( - "The name(s) of the producer(s) of this film.", + "A cursor for use in pagination", ), args: [], ty: FieldType { - kind: List, + kind: NonNull, name: None, of_type: Some( FieldType { @@ -1078,142 +1157,80 @@ Some( is_deprecated: false, deprecation_reason: None, }, + ], + ), + input_fields: None, + interfaces: Some( + [], + ), + enum_values: None, + possible_types: None, + specified_by_url: None, + }, + Type { + kind: Object, + name: Some( + "FilmVehiclesConnection", + ), + description: Some( + "A connection to a list of items.", + ), + fields: Some( + [ Field { - name: "releaseDate", + name: "pageInfo", description: Some( - "The ISO 8601 date format of film release at original creator country.", + "Information to aid in pagination.", ), args: [], ty: FieldType { - kind: Scalar, - name: Some( - "String", + kind: NonNull, + name: None, + of_type: Some( + FieldType { + kind: Object, + name: Some( + "PageInfo", + ), + of_type: None, + }, ), - of_type: None, }, is_deprecated: false, deprecation_reason: None, }, Field { - name: "speciesConnection", - description: None, - args: [ - InputValue { - name: "after", - description: None, - ty: FieldType { - kind: Scalar, - name: Some( - "String", - ), - of_type: None, - }, - default_value: None, - }, - InputValue { - name: "first", - description: None, - ty: FieldType { - kind: Scalar, - name: Some( - "Int", - ), - of_type: None, - }, - default_value: None, - }, - InputValue { - name: "before", - description: None, - ty: FieldType { - kind: Scalar, - name: Some( - "String", - ), - of_type: None, - }, - default_value: None, - }, - InputValue { - name: "last", - description: None, - ty: FieldType { - kind: Scalar, + name: "edges", + description: Some( + "A list of edges.", + ), + args: [], + ty: FieldType { + kind: List, + name: None, + of_type: Some( + FieldType { + kind: Object, name: Some( - "Int", + "FilmVehiclesEdge", ), of_type: None, }, - default_value: None, - }, - ], - ty: FieldType { - kind: Object, - name: Some( - "FilmSpeciesConnection", ), - of_type: None, }, is_deprecated: false, deprecation_reason: None, }, Field { - name: "starshipConnection", - description: None, - args: [ - InputValue { - name: "after", - description: None, - ty: FieldType { - kind: Scalar, - name: Some( - "String", - ), - of_type: None, - }, - default_value: None, - }, - InputValue { - name: "first", - description: None, - ty: FieldType { - kind: Scalar, - name: Some( - "Int", - ), - of_type: None, - }, - default_value: None, - }, - InputValue { - name: "before", - description: None, - ty: FieldType { - kind: Scalar, - name: Some( - "String", - ), - of_type: None, - }, - default_value: None, - }, - InputValue { - name: "last", - description: None, - ty: FieldType { - kind: Scalar, - name: Some( - "Int", - ), - of_type: None, - }, - default_value: None, - }, - ], + name: "totalCount", + description: Some( + "A count of the total number of objects in this connection, ignoring pagination.\nThis allows a client to fetch the first five objects by passing \"5\" as the\nargument to \"first\", then fetch the total count so it could display \"5 of 83\",\nfor example.", + ), + args: [], ty: FieldType { - kind: Object, + kind: Scalar, name: Some( - "FilmStarshipsConnection", + "Int", ), of_type: None, }, @@ -1221,125 +1238,57 @@ Some( deprecation_reason: None, }, Field { - name: "vehicleConnection", - description: None, - args: [ - InputValue { - name: "after", - description: None, - ty: FieldType { - kind: Scalar, - name: Some( - "String", - ), - of_type: None, - }, - default_value: None, - }, - InputValue { - name: "first", - description: None, - ty: FieldType { - kind: Scalar, - name: Some( - "Int", - ), - of_type: None, - }, - default_value: None, - }, - InputValue { - name: "before", - description: None, - ty: FieldType { - kind: Scalar, - name: Some( - "String", - ), - of_type: None, - }, - default_value: None, - }, - InputValue { - name: "last", - description: None, - ty: FieldType { - kind: Scalar, + name: "vehicles", + description: Some( + "A list of all of the objects returned in the connection. This is a convenience\nfield provided for quickly exploring the API; rather than querying for\n\"{ edges { node } }\" when no edge data is needed, this field can be be used\ninstead. Note that when clients like Relay need to fetch the \"cursor\" field on\nthe edge to enable efficient pagination, this shortcut cannot be used, and the\nfull \"{ edges { node } }\" version should be used instead.", + ), + args: [], + ty: FieldType { + kind: List, + name: None, + of_type: Some( + FieldType { + kind: Object, name: Some( - "Int", + "Vehicle", ), of_type: None, }, - default_value: None, - }, - ], - ty: FieldType { - kind: Object, - name: Some( - "FilmVehiclesConnection", ), - of_type: None, }, is_deprecated: false, deprecation_reason: None, }, + ], + ), + input_fields: None, + interfaces: Some( + [], + ), + enum_values: None, + possible_types: None, + specified_by_url: None, + }, + Type { + kind: Object, + name: Some( + "FilmVehiclesEdge", + ), + description: Some( + "An edge in a connection.", + ), + fields: Some( + [ Field { - name: "characterConnection", - description: None, - args: [ - InputValue { - name: "after", - description: None, - ty: FieldType { - kind: Scalar, - name: Some( - "String", - ), - of_type: None, - }, - default_value: None, - }, - InputValue { - name: "first", - description: None, - ty: FieldType { - kind: Scalar, - name: Some( - "Int", - ), - of_type: None, - }, - default_value: None, - }, - InputValue { - name: "before", - description: None, - ty: FieldType { - kind: Scalar, - name: Some( - "String", - ), - of_type: None, - }, - default_value: None, - }, - InputValue { - name: "last", - description: None, - ty: FieldType { - kind: Scalar, - name: Some( - "Int", - ), - of_type: None, - }, - default_value: None, - }, - ], + name: "node", + description: Some( + "The item at the end of the edge", + ), + args: [], ty: FieldType { kind: Object, name: Some( - "FilmCharactersConnection", + "Vehicle", ), of_type: None, }, @@ -1347,78 +1296,101 @@ Some( deprecation_reason: None, }, Field { - name: "planetConnection", - description: None, - args: [ - InputValue { - name: "after", - description: None, - ty: FieldType { + name: "cursor", + description: Some( + "A cursor for use in pagination", + ), + args: [], + ty: FieldType { + kind: NonNull, + name: None, + of_type: Some( + FieldType { kind: Scalar, name: Some( "String", ), of_type: None, }, - default_value: None, - }, - InputValue { - name: "first", - description: None, - ty: FieldType { - kind: Scalar, - name: Some( - "Int", - ), - of_type: None, - }, - default_value: None, - }, - InputValue { - name: "before", - description: None, - ty: FieldType { - kind: Scalar, + ), + }, + is_deprecated: false, + deprecation_reason: None, + }, + ], + ), + input_fields: None, + interfaces: Some( + [], + ), + enum_values: None, + possible_types: None, + specified_by_url: None, + }, + Type { + kind: Object, + name: Some( + "FilmsConnection", + ), + description: Some( + "A connection to a list of items.", + ), + fields: Some( + [ + Field { + name: "pageInfo", + description: Some( + "Information to aid in pagination.", + ), + args: [], + ty: FieldType { + kind: NonNull, + name: None, + of_type: Some( + FieldType { + kind: Object, name: Some( - "String", + "PageInfo", ), of_type: None, }, - default_value: None, - }, - InputValue { - name: "last", - description: None, - ty: FieldType { - kind: Scalar, + ), + }, + is_deprecated: false, + deprecation_reason: None, + }, + Field { + name: "edges", + description: Some( + "A list of edges.", + ), + args: [], + ty: FieldType { + kind: List, + name: None, + of_type: Some( + FieldType { + kind: Object, name: Some( - "Int", + "FilmsEdge", ), - of_type: None, - }, - default_value: None, - }, - ], - ty: FieldType { - kind: Object, - name: Some( - "FilmPlanetsConnection", + of_type: None, + }, ), - of_type: None, }, is_deprecated: false, deprecation_reason: None, }, Field { - name: "created", + name: "totalCount", description: Some( - "The ISO 8601 date format of the time that this resource was created.", + "A count of the total number of objects in this connection, ignoring pagination.\nThis allows a client to fetch the first five objects by passing \"5\" as the\nargument to \"first\", then fetch the total count so it could display \"5 of 83\",\nfor example.", ), args: [], ty: FieldType { kind: Scalar, name: Some( - "String", + "Int", ), of_type: None, }, @@ -1426,15 +1398,57 @@ Some( deprecation_reason: None, }, Field { - name: "edited", + name: "films", description: Some( - "The ISO 8601 date format of the time that this resource was edited.", + "A list of all of the objects returned in the connection. This is a convenience\nfield provided for quickly exploring the API; rather than querying for\n\"{ edges { node } }\" when no edge data is needed, this field can be be used\ninstead. Note that when clients like Relay need to fetch the \"cursor\" field on\nthe edge to enable efficient pagination, this shortcut cannot be used, and the\nfull \"{ edges { node } }\" version should be used instead.", ), args: [], ty: FieldType { - kind: Scalar, + kind: List, + name: None, + of_type: Some( + FieldType { + kind: Object, + name: Some( + "Film", + ), + of_type: None, + }, + ), + }, + is_deprecated: false, + deprecation_reason: None, + }, + ], + ), + input_fields: None, + interfaces: Some( + [], + ), + enum_values: None, + possible_types: None, + specified_by_url: None, + }, + Type { + kind: Object, + name: Some( + "FilmsEdge", + ), + description: Some( + "An edge in a connection.", + ), + fields: Some( + [ + Field { + name: "node", + description: Some( + "The item at the end of the edge", + ), + args: [], + ty: FieldType { + kind: Object, name: Some( - "String", + "Film", ), of_type: None, }, @@ -1442,9 +1456,9 @@ Some( deprecation_reason: None, }, Field { - name: "id", + name: "cursor", description: Some( - "The ID of an object", + "A cursor for use in pagination", ), args: [], ty: FieldType { @@ -1454,7 +1468,7 @@ Some( FieldType { kind: Scalar, name: Some( - "ID", + "String", ), of_type: None, }, @@ -1467,14 +1481,51 @@ Some( ), input_fields: None, interfaces: Some( - [ - NamedType { - name: Some( - "Node", - ), - }, - ], + [], + ), + enum_values: None, + possible_types: None, + specified_by_url: None, + }, + Type { + kind: Scalar, + name: Some( + "Float", + ), + description: Some( + "The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](https://en.wikipedia.org/wiki/IEEE_floating_point).", + ), + fields: None, + input_fields: None, + interfaces: None, + enum_values: None, + possible_types: None, + specified_by_url: None, + }, + Type { + kind: Scalar, + name: Some( + "ID", + ), + description: None, + fields: None, + input_fields: None, + interfaces: None, + enum_values: None, + possible_types: None, + specified_by_url: None, + }, + Type { + kind: Scalar, + name: Some( + "Int", + ), + description: Some( + "The `Int` scalar type represents non-fractional whole numeric values.", ), + fields: None, + input_fields: None, + interfaces: None, enum_values: None, possible_types: None, specified_by_url: None, @@ -1491,9 +1542,7 @@ Some( [ Field { name: "id", - description: Some( - "The id of the object.", - ), + description: None, args: [], ty: FieldType { kind: NonNull, @@ -1553,16 +1602,97 @@ Some( specified_by_url: None, }, Type { - kind: Scalar, + kind: Object, name: Some( - "ID", + "PageInfo", ), description: Some( - "The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `\"4\"`) or integer (such as `4`) input value will be accepted as an ID.", + "Information about pagination in a connection.", + ), + fields: Some( + [ + Field { + name: "hasNextPage", + description: Some( + "When paginating forwards, are there more items?", + ), + args: [], + ty: FieldType { + kind: NonNull, + name: None, + of_type: Some( + FieldType { + kind: Scalar, + name: Some( + "Boolean", + ), + of_type: None, + }, + ), + }, + is_deprecated: false, + deprecation_reason: None, + }, + Field { + name: "hasPreviousPage", + description: Some( + "When paginating backwards, are there more items?", + ), + args: [], + ty: FieldType { + kind: NonNull, + name: None, + of_type: Some( + FieldType { + kind: Scalar, + name: Some( + "Boolean", + ), + of_type: None, + }, + ), + }, + is_deprecated: false, + deprecation_reason: None, + }, + Field { + name: "startCursor", + description: Some( + "When paginating backwards, the cursor to continue.", + ), + args: [], + ty: FieldType { + kind: Scalar, + name: Some( + "String", + ), + of_type: None, + }, + is_deprecated: false, + deprecation_reason: None, + }, + Field { + name: "endCursor", + description: Some( + "When paginating forwards, the cursor to continue.", + ), + args: [], + ty: FieldType { + kind: Scalar, + name: Some( + "String", + ), + of_type: None, + }, + is_deprecated: false, + deprecation_reason: None, + }, + ], ), - fields: None, input_fields: None, - interfaces: None, + interfaces: Some( + [], + ), enum_values: None, possible_types: None, specified_by_url: None, @@ -1570,7 +1700,7 @@ Some( Type { kind: Object, name: Some( - "FilmSpeciesConnection", + "PeopleConnection", ), description: Some( "A connection to a list of items.", @@ -1612,7 +1742,7 @@ Some( FieldType { kind: Object, name: Some( - "FilmSpeciesEdge", + "PeopleEdge", ), of_type: None, }, @@ -1638,7 +1768,7 @@ Some( deprecation_reason: None, }, Field { - name: "species", + name: "people", description: Some( "A list of all of the objects returned in the connection. This is a convenience\nfield provided for quickly exploring the API; rather than querying for\n\"{ edges { node } }\" when no edge data is needed, this field can be be used\ninstead. Note that when clients like Relay need to fetch the \"cursor\" field on\nthe edge to enable efficient pagination, this shortcut cannot be used, and the\nfull \"{ edges { node } }\" version should be used instead.", ), @@ -1650,7 +1780,7 @@ Some( FieldType { kind: Object, name: Some( - "Species", + "Person", ), of_type: None, }, @@ -1672,7 +1802,7 @@ Some( Type { kind: Object, name: Some( - "FilmSpeciesEdge", + "PeopleEdge", ), description: Some( "An edge in a connection.", @@ -1688,7 +1818,7 @@ Some( ty: FieldType { kind: Object, name: Some( - "Species", + "Person", ), of_type: None, }, @@ -1730,17 +1860,49 @@ Some( Type { kind: Object, name: Some( - "Species", + "Person", ), description: Some( - "A type of person or character within the Star Wars Universe.", + "An individual person or character within the Star Wars universe.", ), fields: Some( [ Field { - name: "name", + name: "name", + description: Some( + "The name of this person.", + ), + args: [], + ty: FieldType { + kind: Scalar, + name: Some( + "String", + ), + of_type: None, + }, + is_deprecated: false, + deprecation_reason: None, + }, + Field { + name: "birthYear", + description: Some( + "The birth year of the person, using the in-universe standard of BBY or ABY -\nBefore the Battle of Yavin or After the Battle of Yavin. The Battle of Yavin is\na battle that occurs at the end of Star Wars episode IV: A New Hope.", + ), + args: [], + ty: FieldType { + kind: Scalar, + name: Some( + "String", + ), + of_type: None, + }, + is_deprecated: false, + deprecation_reason: None, + }, + Field { + name: "eyeColor", description: Some( - "The name of this species.", + "The eye color of this person. Will be \"unknown\" if not known or \"n/a\" if the\nperson does not have an eye.", ), args: [], ty: FieldType { @@ -1754,9 +1916,9 @@ Some( deprecation_reason: None, }, Field { - name: "classification", + name: "gender", description: Some( - "The classification of this species, such as \"mammal\" or \"reptile\".", + "The gender of this person. Either \"Male\", \"Female\" or \"unknown\",\n\"n/a\" if the person does not have a gender.", ), args: [], ty: FieldType { @@ -1770,9 +1932,9 @@ Some( deprecation_reason: None, }, Field { - name: "designation", + name: "hairColor", description: Some( - "The designation of this species, such as \"sentient\".", + "The hair color of this person. Will be \"unknown\" if not known or \"n/a\" if the\nperson does not have hair.", ), args: [], ty: FieldType { @@ -1786,15 +1948,15 @@ Some( deprecation_reason: None, }, Field { - name: "averageHeight", + name: "height", description: Some( - "The average height of this species in centimeters.", + "The height of the person in centimeters.", ), args: [], ty: FieldType { kind: Scalar, name: Some( - "Float", + "Int", ), of_type: None, }, @@ -1802,15 +1964,15 @@ Some( deprecation_reason: None, }, Field { - name: "averageLifespan", + name: "mass", description: Some( - "The average lifespan of this species in years, null if unknown.", + "The mass of the person in kilograms.", ), args: [], ty: FieldType { kind: Scalar, name: Some( - "Int", + "Float", ), of_type: None, }, @@ -1818,81 +1980,94 @@ Some( deprecation_reason: None, }, Field { - name: "eyeColors", + name: "skinColor", description: Some( - "Common eye colors for this species, null if this species does not typically\nhave eyes.", + "The skin color of this person.", ), args: [], ty: FieldType { - kind: List, - name: None, - of_type: Some( - FieldType { - kind: Scalar, - name: Some( - "String", - ), - of_type: None, - }, + kind: Scalar, + name: Some( + "String", ), + of_type: None, }, is_deprecated: false, deprecation_reason: None, }, Field { - name: "hairColors", + name: "homeworld", description: Some( - "Common hair colors for this species, null if this species does not typically\nhave hair.", + "A planet that this person was born on or inhabits.", ), args: [], ty: FieldType { - kind: List, - name: None, - of_type: Some( - FieldType { - kind: Scalar, - name: Some( - "String", - ), - of_type: None, - }, + kind: Object, + name: Some( + "Planet", ), + of_type: None, }, is_deprecated: false, deprecation_reason: None, }, Field { - name: "skinColors", - description: Some( - "Common skin colors for this species, null if this species does not typically\nhave skin.", - ), - args: [], - ty: FieldType { - kind: List, - name: None, - of_type: Some( - FieldType { + name: "filmConnection", + description: None, + args: [ + InputValue { + name: "after", + description: None, + ty: FieldType { kind: Scalar, name: Some( "String", ), of_type: None, }, - ), - }, - is_deprecated: false, - deprecation_reason: None, - }, - Field { - name: "language", - description: Some( - "The language commonly spoken by this species.", - ), - args: [], + default_value: None, + }, + InputValue { + name: "first", + description: None, + ty: FieldType { + kind: Scalar, + name: Some( + "Int", + ), + of_type: None, + }, + default_value: None, + }, + InputValue { + name: "before", + description: None, + ty: FieldType { + kind: Scalar, + name: Some( + "String", + ), + of_type: None, + }, + default_value: None, + }, + InputValue { + name: "last", + description: None, + ty: FieldType { + kind: Scalar, + name: Some( + "Int", + ), + of_type: None, + }, + default_value: None, + }, + ], ty: FieldType { - kind: Scalar, + kind: Object, name: Some( - "String", + "PersonFilmsConnection", ), of_type: None, }, @@ -1900,15 +2075,15 @@ Some( deprecation_reason: None, }, Field { - name: "homeworld", + name: "species", description: Some( - "A planet that this species originates from.", + "The species that this person belongs to, or null if unknown.", ), args: [], ty: FieldType { kind: Object, name: Some( - "Planet", + "Species", ), of_type: None, }, @@ -1916,7 +2091,7 @@ Some( deprecation_reason: None, }, Field { - name: "personConnection", + name: "starshipConnection", description: None, args: [ InputValue { @@ -1971,7 +2146,7 @@ Some( ty: FieldType { kind: Object, name: Some( - "SpeciesPeopleConnection", + "PersonStarshipsConnection", ), of_type: None, }, @@ -1979,7 +2154,7 @@ Some( deprecation_reason: None, }, Field { - name: "filmConnection", + name: "vehicleConnection", description: None, args: [ InputValue { @@ -2034,7 +2209,7 @@ Some( ty: FieldType { kind: Object, name: Some( - "SpeciesFilmsConnection", + "PersonVehiclesConnection", ), of_type: None, }, @@ -2111,83 +2286,64 @@ Some( possible_types: None, specified_by_url: None, }, - Type { - kind: Scalar, - name: Some( - "Float", - ), - description: Some( - "The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](https://en.wikipedia.org/wiki/IEEE_floating_point).", - ), - fields: None, - input_fields: None, - interfaces: None, - enum_values: None, - possible_types: None, - specified_by_url: None, - }, Type { kind: Object, name: Some( - "Planet", + "PersonFilmsConnection", ), description: Some( - "A large mass, planet or planetoid in the Star Wars Universe, at the time of\n0 ABY.", + "A connection to a list of items.", ), fields: Some( [ Field { - name: "name", - description: Some( - "The name of this planet.", - ), - args: [], - ty: FieldType { - kind: Scalar, - name: Some( - "String", - ), - of_type: None, - }, - is_deprecated: false, - deprecation_reason: None, - }, - Field { - name: "diameter", + name: "pageInfo", description: Some( - "The diameter of this planet in kilometers.", + "Information to aid in pagination.", ), args: [], ty: FieldType { - kind: Scalar, - name: Some( - "Int", + kind: NonNull, + name: None, + of_type: Some( + FieldType { + kind: Object, + name: Some( + "PageInfo", + ), + of_type: None, + }, ), - of_type: None, }, is_deprecated: false, deprecation_reason: None, }, Field { - name: "rotationPeriod", + name: "edges", description: Some( - "The number of standard hours it takes for this planet to complete a single\nrotation on its axis.", + "A list of edges.", ), args: [], ty: FieldType { - kind: Scalar, - name: Some( - "Int", + kind: List, + name: None, + of_type: Some( + FieldType { + kind: Object, + name: Some( + "PersonFilmsEdge", + ), + of_type: None, + }, ), - of_type: None, }, is_deprecated: false, deprecation_reason: None, }, Field { - name: "orbitalPeriod", + name: "totalCount", description: Some( - "The number of standard days it takes for this planet to complete a single orbit\nof its local star.", + "A count of the total number of objects in this connection, ignoring pagination.\nThis allows a client to fetch the first five objects by passing \"5\" as the\nargument to \"first\", then fetch the total count so it could display \"5 of 83\",\nfor example.", ), args: [], ty: FieldType { @@ -2201,31 +2357,57 @@ Some( deprecation_reason: None, }, Field { - name: "gravity", + name: "films", description: Some( - "A number denoting the gravity of this planet, where \"1\" is normal or 1 standard\nG. \"2\" is twice or 2 standard Gs. \"0.5\" is half or 0.5 standard Gs.", + "A list of all of the objects returned in the connection. This is a convenience\nfield provided for quickly exploring the API; rather than querying for\n\"{ edges { node } }\" when no edge data is needed, this field can be be used\ninstead. Note that when clients like Relay need to fetch the \"cursor\" field on\nthe edge to enable efficient pagination, this shortcut cannot be used, and the\nfull \"{ edges { node } }\" version should be used instead.", ), args: [], ty: FieldType { - kind: Scalar, - name: Some( - "String", + kind: List, + name: None, + of_type: Some( + FieldType { + kind: Object, + name: Some( + "Film", + ), + of_type: None, + }, ), - of_type: None, }, is_deprecated: false, deprecation_reason: None, }, + ], + ), + input_fields: None, + interfaces: Some( + [], + ), + enum_values: None, + possible_types: None, + specified_by_url: None, + }, + Type { + kind: Object, + name: Some( + "PersonFilmsEdge", + ), + description: Some( + "An edge in a connection.", + ), + fields: Some( + [ Field { - name: "population", + name: "node", description: Some( - "The average population of sentient beings inhabiting this planet.", + "The item at the end of the edge", ), args: [], ty: FieldType { - kind: Scalar, + kind: Object, name: Some( - "Float", + "Film", ), of_type: None, }, @@ -2233,13 +2415,13 @@ Some( deprecation_reason: None, }, Field { - name: "climates", + name: "cursor", description: Some( - "The climates of this planet.", + "A cursor for use in pagination", ), args: [], ty: FieldType { - kind: List, + kind: NonNull, name: None, of_type: Some( FieldType { @@ -2254,20 +2436,40 @@ Some( is_deprecated: false, deprecation_reason: None, }, + ], + ), + input_fields: None, + interfaces: Some( + [], + ), + enum_values: None, + possible_types: None, + specified_by_url: None, + }, + Type { + kind: Object, + name: Some( + "PersonStarshipsConnection", + ), + description: Some( + "A connection to a list of items.", + ), + fields: Some( + [ Field { - name: "terrains", + name: "pageInfo", description: Some( - "The terrains of this planet.", + "Information to aid in pagination.", ), args: [], ty: FieldType { - kind: List, + kind: NonNull, name: None, of_type: Some( FieldType { - kind: Scalar, + kind: Object, name: Some( - "String", + "PageInfo", ), of_type: None, }, @@ -2277,141 +2479,37 @@ Some( deprecation_reason: None, }, Field { - name: "surfaceWater", + name: "edges", description: Some( - "The percentage of the planet surface that is naturally occurring water or bodies\nof water.", + "A list of edges.", ), args: [], ty: FieldType { - kind: Scalar, - name: Some( - "Float", - ), - of_type: None, - }, - is_deprecated: false, - deprecation_reason: None, - }, - Field { - name: "residentConnection", - description: None, - args: [ - InputValue { - name: "after", - description: None, - ty: FieldType { - kind: Scalar, - name: Some( - "String", - ), - of_type: None, - }, - default_value: None, - }, - InputValue { - name: "first", - description: None, - ty: FieldType { - kind: Scalar, - name: Some( - "Int", - ), - of_type: None, - }, - default_value: None, - }, - InputValue { - name: "before", - description: None, - ty: FieldType { - kind: Scalar, - name: Some( - "String", - ), - of_type: None, - }, - default_value: None, - }, - InputValue { - name: "last", - description: None, - ty: FieldType { - kind: Scalar, + kind: List, + name: None, + of_type: Some( + FieldType { + kind: Object, name: Some( - "Int", + "PersonStarshipsEdge", ), of_type: None, }, - default_value: None, - }, - ], - ty: FieldType { - kind: Object, - name: Some( - "PlanetResidentsConnection", ), - of_type: None, }, is_deprecated: false, deprecation_reason: None, }, Field { - name: "filmConnection", - description: None, - args: [ - InputValue { - name: "after", - description: None, - ty: FieldType { - kind: Scalar, - name: Some( - "String", - ), - of_type: None, - }, - default_value: None, - }, - InputValue { - name: "first", - description: None, - ty: FieldType { - kind: Scalar, - name: Some( - "Int", - ), - of_type: None, - }, - default_value: None, - }, - InputValue { - name: "before", - description: None, - ty: FieldType { - kind: Scalar, - name: Some( - "String", - ), - of_type: None, - }, - default_value: None, - }, - InputValue { - name: "last", - description: None, - ty: FieldType { - kind: Scalar, - name: Some( - "Int", - ), - of_type: None, - }, - default_value: None, - }, - ], + name: "totalCount", + description: Some( + "A count of the total number of objects in this connection, ignoring pagination.\nThis allows a client to fetch the first five objects by passing \"5\" as the\nargument to \"first\", then fetch the total count so it could display \"5 of 83\",\nfor example.", + ), + args: [], ty: FieldType { - kind: Object, + kind: Scalar, name: Some( - "PlanetFilmsConnection", + "Int", ), of_type: None, }, @@ -2419,31 +2517,57 @@ Some( deprecation_reason: None, }, Field { - name: "created", + name: "starships", description: Some( - "The ISO 8601 date format of the time that this resource was created.", + "A list of all of the objects returned in the connection. This is a convenience\nfield provided for quickly exploring the API; rather than querying for\n\"{ edges { node } }\" when no edge data is needed, this field can be be used\ninstead. Note that when clients like Relay need to fetch the \"cursor\" field on\nthe edge to enable efficient pagination, this shortcut cannot be used, and the\nfull \"{ edges { node } }\" version should be used instead.", ), args: [], ty: FieldType { - kind: Scalar, - name: Some( - "String", + kind: List, + name: None, + of_type: Some( + FieldType { + kind: Object, + name: Some( + "Starship", + ), + of_type: None, + }, ), - of_type: None, }, is_deprecated: false, deprecation_reason: None, }, + ], + ), + input_fields: None, + interfaces: Some( + [], + ), + enum_values: None, + possible_types: None, + specified_by_url: None, + }, + Type { + kind: Object, + name: Some( + "PersonStarshipsEdge", + ), + description: Some( + "An edge in a connection.", + ), + fields: Some( + [ Field { - name: "edited", + name: "node", description: Some( - "The ISO 8601 date format of the time that this resource was edited.", + "The item at the end of the edge", ), args: [], ty: FieldType { - kind: Scalar, + kind: Object, name: Some( - "String", + "Starship", ), of_type: None, }, @@ -2451,9 +2575,9 @@ Some( deprecation_reason: None, }, Field { - name: "id", + name: "cursor", description: Some( - "The ID of an object", + "A cursor for use in pagination", ), args: [], ty: FieldType { @@ -2463,7 +2587,7 @@ Some( FieldType { kind: Scalar, name: Some( - "ID", + "String", ), of_type: None, }, @@ -2476,13 +2600,7 @@ Some( ), input_fields: None, interfaces: Some( - [ - NamedType { - name: Some( - "Node", - ), - }, - ], + [], ), enum_values: None, possible_types: None, @@ -2491,7 +2609,7 @@ Some( Type { kind: Object, name: Some( - "PlanetResidentsConnection", + "PersonVehiclesConnection", ), description: Some( "A connection to a list of items.", @@ -2533,7 +2651,7 @@ Some( FieldType { kind: Object, name: Some( - "PlanetResidentsEdge", + "PersonVehiclesEdge", ), of_type: None, }, @@ -2559,7 +2677,7 @@ Some( deprecation_reason: None, }, Field { - name: "residents", + name: "vehicles", description: Some( "A list of all of the objects returned in the connection. This is a convenience\nfield provided for quickly exploring the API; rather than querying for\n\"{ edges { node } }\" when no edge data is needed, this field can be be used\ninstead. Note that when clients like Relay need to fetch the \"cursor\" field on\nthe edge to enable efficient pagination, this shortcut cannot be used, and the\nfull \"{ edges { node } }\" version should be used instead.", ), @@ -2571,7 +2689,7 @@ Some( FieldType { kind: Object, name: Some( - "Person", + "Vehicle", ), of_type: None, }, @@ -2593,7 +2711,7 @@ Some( Type { kind: Object, name: Some( - "PlanetResidentsEdge", + "PersonVehiclesEdge", ), description: Some( "An edge in a connection.", @@ -2609,7 +2727,7 @@ Some( ty: FieldType { kind: Object, name: Some( - "Person", + "Vehicle", ), of_type: None, }, @@ -2651,17 +2769,17 @@ Some( Type { kind: Object, name: Some( - "Person", + "Planet", ), description: Some( - "An individual person or character within the Star Wars universe.", + "A large mass, planet or planetoid in the Star Wars Universe, at the time of\n0 ABY.", ), fields: Some( [ Field { name: "name", description: Some( - "The name of this person.", + "The name of this planet.", ), args: [], ty: FieldType { @@ -2675,15 +2793,15 @@ Some( deprecation_reason: None, }, Field { - name: "birthYear", + name: "diameter", description: Some( - "The birth year of the person, using the in-universe standard of BBY or ABY -\nBefore the Battle of Yavin or After the Battle of Yavin. The Battle of Yavin is\na battle that occurs at the end of Star Wars episode IV: A New Hope.", + "The diameter of this planet in kilometers.", ), args: [], ty: FieldType { kind: Scalar, name: Some( - "String", + "Int", ), of_type: None, }, @@ -2691,15 +2809,15 @@ Some( deprecation_reason: None, }, Field { - name: "eyeColor", + name: "rotationPeriod", description: Some( - "The eye color of this person. Will be \"unknown\" if not known or \"n/a\" if the\nperson does not have an eye.", + "The number of standard hours it takes for this planet to complete a single\nrotation on its axis.", ), args: [], ty: FieldType { kind: Scalar, name: Some( - "String", + "Int", ), of_type: None, }, @@ -2707,15 +2825,15 @@ Some( deprecation_reason: None, }, Field { - name: "gender", + name: "orbitalPeriod", description: Some( - "The gender of this person. Either \"Male\", \"Female\" or \"unknown\",\n\"n/a\" if the person does not have a gender.", + "The number of standard days it takes for this planet to complete a single orbit\nof its local star.", ), args: [], ty: FieldType { kind: Scalar, name: Some( - "String", + "Int", ), of_type: None, }, @@ -2723,9 +2841,9 @@ Some( deprecation_reason: None, }, Field { - name: "hairColor", + name: "gravity", description: Some( - "The hair color of this person. Will be \"unknown\" if not known or \"n/a\" if the\nperson does not have hair.", + "A number denoting the gravity of this planet, where \"1\" is normal or 1 standard\nG. \"2\" is twice or 2 standard Gs. \"0.5\" is half or 0.5 standard Gs.", ), args: [], ty: FieldType { @@ -2739,25 +2857,9 @@ Some( deprecation_reason: None, }, Field { - name: "height", - description: Some( - "The height of the person in centimeters.", - ), - args: [], - ty: FieldType { - kind: Scalar, - name: Some( - "Int", - ), - of_type: None, - }, - is_deprecated: false, - deprecation_reason: None, - }, - Field { - name: "mass", + name: "population", description: Some( - "The mass of the person in kilograms.", + "The average population of sentient beings inhabiting this planet.", ), args: [], ty: FieldType { @@ -2771,110 +2873,59 @@ Some( deprecation_reason: None, }, Field { - name: "skinColor", + name: "climates", description: Some( - "The skin color of this person.", + "The climates of this planet.", ), args: [], ty: FieldType { - kind: Scalar, - name: Some( - "String", + kind: List, + name: None, + of_type: Some( + FieldType { + kind: Scalar, + name: Some( + "String", + ), + of_type: None, + }, ), - of_type: None, }, is_deprecated: false, deprecation_reason: None, }, Field { - name: "homeworld", + name: "terrains", description: Some( - "A planet that this person was born on or inhabits.", + "The terrains of this planet.", ), args: [], ty: FieldType { - kind: Object, - name: Some( - "Planet", - ), - of_type: None, - }, - is_deprecated: false, - deprecation_reason: None, - }, - Field { - name: "filmConnection", - description: None, - args: [ - InputValue { - name: "after", - description: None, - ty: FieldType { - kind: Scalar, - name: Some( - "String", - ), - of_type: None, - }, - default_value: None, - }, - InputValue { - name: "first", - description: None, - ty: FieldType { - kind: Scalar, - name: Some( - "Int", - ), - of_type: None, - }, - default_value: None, - }, - InputValue { - name: "before", - description: None, - ty: FieldType { + kind: List, + name: None, + of_type: Some( + FieldType { kind: Scalar, name: Some( "String", ), of_type: None, }, - default_value: None, - }, - InputValue { - name: "last", - description: None, - ty: FieldType { - kind: Scalar, - name: Some( - "Int", - ), - of_type: None, - }, - default_value: None, - }, - ], - ty: FieldType { - kind: Object, - name: Some( - "PersonFilmsConnection", ), - of_type: None, }, is_deprecated: false, deprecation_reason: None, }, Field { - name: "species", + name: "surfaceWater", description: Some( - "The species that this person belongs to, or null if unknown.", + "The percentage of the planet surface that is naturally occurring water or bodies\nof water.", ), args: [], ty: FieldType { - kind: Object, + kind: Scalar, name: Some( - "Species", + "Float", ), of_type: None, }, @@ -2882,7 +2933,7 @@ Some( deprecation_reason: None, }, Field { - name: "starshipConnection", + name: "residentConnection", description: None, args: [ InputValue { @@ -2937,7 +2988,7 @@ Some( ty: FieldType { kind: Object, name: Some( - "PersonStarshipsConnection", + "PlanetResidentsConnection", ), of_type: None, }, @@ -2945,7 +2996,7 @@ Some( deprecation_reason: None, }, Field { - name: "vehicleConnection", + name: "filmConnection", description: None, args: [ InputValue { @@ -3000,7 +3051,7 @@ Some( ty: FieldType { kind: Object, name: Some( - "PersonVehiclesConnection", + "PlanetFilmsConnection", ), of_type: None, }, @@ -3080,7 +3131,7 @@ Some( Type { kind: Object, name: Some( - "PersonFilmsConnection", + "PlanetFilmsConnection", ), description: Some( "A connection to a list of items.", @@ -3122,7 +3173,7 @@ Some( FieldType { kind: Object, name: Some( - "PersonFilmsEdge", + "PlanetFilmsEdge", ), of_type: None, }, @@ -3182,7 +3233,7 @@ Some( Type { kind: Object, name: Some( - "PersonFilmsEdge", + "PlanetFilmsEdge", ), description: Some( "An edge in a connection.", @@ -3240,7 +3291,7 @@ Some( Type { kind: Object, name: Some( - "PersonStarshipsConnection", + "PlanetResidentsConnection", ), description: Some( "A connection to a list of items.", @@ -3282,7 +3333,7 @@ Some( FieldType { kind: Object, name: Some( - "PersonStarshipsEdge", + "PlanetResidentsEdge", ), of_type: None, }, @@ -3308,7 +3359,7 @@ Some( deprecation_reason: None, }, Field { - name: "starships", + name: "residents", description: Some( "A list of all of the objects returned in the connection. This is a convenience\nfield provided for quickly exploring the API; rather than querying for\n\"{ edges { node } }\" when no edge data is needed, this field can be be used\ninstead. Note that when clients like Relay need to fetch the \"cursor\" field on\nthe edge to enable efficient pagination, this shortcut cannot be used, and the\nfull \"{ edges { node } }\" version should be used instead.", ), @@ -3320,7 +3371,7 @@ Some( FieldType { kind: Object, name: Some( - "Starship", + "Person", ), of_type: None, }, @@ -3342,7 +3393,7 @@ Some( Type { kind: Object, name: Some( - "PersonStarshipsEdge", + "PlanetResidentsEdge", ), description: Some( "An edge in a connection.", @@ -3358,7 +3409,7 @@ Some( ty: FieldType { kind: Object, name: Some( - "Starship", + "Person", ), of_type: None, }, @@ -3400,65 +3451,39 @@ Some( Type { kind: Object, name: Some( - "Starship", + "PlanetsConnection", ), description: Some( - "A single transport craft that has hyperdrive capability.", + "A connection to a list of items.", ), fields: Some( [ Field { - name: "name", - description: Some( - "The name of this starship. The common name, such as \"Death Star\".", - ), - args: [], - ty: FieldType { - kind: Scalar, - name: Some( - "String", - ), - of_type: None, - }, - is_deprecated: false, - deprecation_reason: None, - }, - Field { - name: "model", - description: Some( - "The model or official name of this starship. Such as \"T-65 X-wing\" or \"DS-1\nOrbital Battle Station\".", - ), - args: [], - ty: FieldType { - kind: Scalar, - name: Some( - "String", - ), - of_type: None, - }, - is_deprecated: false, - deprecation_reason: None, - }, - Field { - name: "starshipClass", + name: "pageInfo", description: Some( - "The class of this starship, such as \"Starfighter\" or \"Deep Space Mobile\nBattlestation\"", + "Information to aid in pagination.", ), args: [], ty: FieldType { - kind: Scalar, - name: Some( - "String", + kind: NonNull, + name: None, + of_type: Some( + FieldType { + kind: Object, + name: Some( + "PageInfo", + ), + of_type: None, + }, ), - of_type: None, }, is_deprecated: false, deprecation_reason: None, }, Field { - name: "manufacturers", + name: "edges", description: Some( - "The manufacturers of this starship.", + "A list of edges.", ), args: [], ty: FieldType { @@ -3466,9 +3491,9 @@ Some( name: None, of_type: Some( FieldType { - kind: Scalar, + kind: Object, name: Some( - "String", + "PlanetsEdge", ), of_type: None, }, @@ -3478,31 +3503,15 @@ Some( deprecation_reason: None, }, Field { - name: "costInCredits", - description: Some( - "The cost of this starship new, in galactic credits.", - ), - args: [], - ty: FieldType { - kind: Scalar, - name: Some( - "Float", - ), - of_type: None, - }, - is_deprecated: false, - deprecation_reason: None, - }, - Field { - name: "length", + name: "totalCount", description: Some( - "The length of this starship in meters.", + "A count of the total number of objects in this connection, ignoring pagination.\nThis allows a client to fetch the first five objects by passing \"5\" as the\nargument to \"first\", then fetch the total count so it could display \"5 of 83\",\nfor example.", ), args: [], ty: FieldType { kind: Scalar, name: Some( - "Float", + "Int", ), of_type: None, }, @@ -3510,31 +3519,57 @@ Some( deprecation_reason: None, }, Field { - name: "crew", + name: "planets", description: Some( - "The number of personnel needed to run or pilot this starship.", + "A list of all of the objects returned in the connection. This is a convenience\nfield provided for quickly exploring the API; rather than querying for\n\"{ edges { node } }\" when no edge data is needed, this field can be be used\ninstead. Note that when clients like Relay need to fetch the \"cursor\" field on\nthe edge to enable efficient pagination, this shortcut cannot be used, and the\nfull \"{ edges { node } }\" version should be used instead.", ), args: [], ty: FieldType { - kind: Scalar, - name: Some( - "String", + kind: List, + name: None, + of_type: Some( + FieldType { + kind: Object, + name: Some( + "Planet", + ), + of_type: None, + }, ), - of_type: None, }, is_deprecated: false, deprecation_reason: None, }, + ], + ), + input_fields: None, + interfaces: Some( + [], + ), + enum_values: None, + possible_types: None, + specified_by_url: None, + }, + Type { + kind: Object, + name: Some( + "PlanetsEdge", + ), + description: Some( + "An edge in a connection.", + ), + fields: Some( + [ Field { - name: "passengers", + name: "node", description: Some( - "The number of non-essential people this starship can transport.", + "The item at the end of the edge", ), args: [], ty: FieldType { - kind: Scalar, + kind: Object, name: Some( - "String", + "Planet", ), of_type: None, }, @@ -3542,31 +3577,102 @@ Some( deprecation_reason: None, }, Field { - name: "maxAtmospheringSpeed", + name: "cursor", description: Some( - "The maximum speed of this starship in atmosphere. null if this starship is\nincapable of atmosphering flight.", + "A cursor for use in pagination", ), args: [], ty: FieldType { - kind: Scalar, - name: Some( - "Int", + kind: NonNull, + name: None, + of_type: Some( + FieldType { + kind: Scalar, + name: Some( + "String", + ), + of_type: None, + }, ), - of_type: None, }, is_deprecated: false, deprecation_reason: None, }, + ], + ), + input_fields: None, + interfaces: Some( + [], + ), + enum_values: None, + possible_types: None, + specified_by_url: None, + }, + Type { + kind: Object, + name: Some( + "Root", + ), + description: None, + fields: Some( + [ Field { - name: "hyperdriveRating", - description: Some( - "The class of this starships hyperdrive.", - ), - args: [], + name: "allFilms", + description: None, + args: [ + InputValue { + name: "after", + description: None, + ty: FieldType { + kind: Scalar, + name: Some( + "String", + ), + of_type: None, + }, + default_value: None, + }, + InputValue { + name: "first", + description: None, + ty: FieldType { + kind: Scalar, + name: Some( + "Int", + ), + of_type: None, + }, + default_value: None, + }, + InputValue { + name: "before", + description: None, + ty: FieldType { + kind: Scalar, + name: Some( + "String", + ), + of_type: None, + }, + default_value: None, + }, + InputValue { + name: "last", + description: None, + ty: FieldType { + kind: Scalar, + name: Some( + "Int", + ), + of_type: None, + }, + default_value: None, + }, + ], ty: FieldType { - kind: Scalar, + kind: Object, name: Some( - "Float", + "FilmsConnection", ), of_type: None, }, @@ -3574,15 +3680,38 @@ Some( deprecation_reason: None, }, Field { - name: "MGLT", - description: Some( - "The Maximum number of Megalights this starship can travel in a standard hour.\nA \"Megalight\" is a standard unit of distance and has never been defined before\nwithin the Star Wars universe. This figure is only really useful for measuring\nthe difference in speed of starships. We can assume it is similar to AU, the\ndistance between our Sun (Sol) and Earth.", - ), - args: [], + name: "film", + description: None, + args: [ + InputValue { + name: "id", + description: None, + ty: FieldType { + kind: Scalar, + name: Some( + "ID", + ), + of_type: None, + }, + default_value: None, + }, + InputValue { + name: "filmID", + description: None, + ty: FieldType { + kind: Scalar, + name: Some( + "ID", + ), + of_type: None, + }, + default_value: None, + }, + ], ty: FieldType { - kind: Scalar, + kind: Object, name: Some( - "Int", + "Film", ), of_type: None, }, @@ -3590,15 +3719,62 @@ Some( deprecation_reason: None, }, Field { - name: "cargoCapacity", - description: Some( - "The maximum number of kilograms that this starship can transport.", - ), - args: [], + name: "allPeople", + description: None, + args: [ + InputValue { + name: "after", + description: None, + ty: FieldType { + kind: Scalar, + name: Some( + "String", + ), + of_type: None, + }, + default_value: None, + }, + InputValue { + name: "first", + description: None, + ty: FieldType { + kind: Scalar, + name: Some( + "Int", + ), + of_type: None, + }, + default_value: None, + }, + InputValue { + name: "before", + description: None, + ty: FieldType { + kind: Scalar, + name: Some( + "String", + ), + of_type: None, + }, + default_value: None, + }, + InputValue { + name: "last", + description: None, + ty: FieldType { + kind: Scalar, + name: Some( + "Int", + ), + of_type: None, + }, + default_value: None, + }, + ], ty: FieldType { - kind: Scalar, + kind: Object, name: Some( - "Float", + "PeopleConnection", ), of_type: None, }, @@ -3606,15 +3782,38 @@ Some( deprecation_reason: None, }, Field { - name: "consumables", - description: Some( - "The maximum length of time that this starship can provide consumables for its\nentire crew without having to resupply.", - ), - args: [], + name: "person", + description: None, + args: [ + InputValue { + name: "id", + description: None, + ty: FieldType { + kind: Scalar, + name: Some( + "ID", + ), + of_type: None, + }, + default_value: None, + }, + InputValue { + name: "personID", + description: None, + ty: FieldType { + kind: Scalar, + name: Some( + "ID", + ), + of_type: None, + }, + default_value: None, + }, + ], ty: FieldType { - kind: Scalar, + kind: Object, name: Some( - "String", + "Person", ), of_type: None, }, @@ -3622,7 +3821,7 @@ Some( deprecation_reason: None, }, Field { - name: "pilotConnection", + name: "allPlanets", description: None, args: [ InputValue { @@ -3677,7 +3876,7 @@ Some( ty: FieldType { kind: Object, name: Some( - "StarshipPilotsConnection", + "PlanetsConnection", ), of_type: None, }, @@ -3685,7 +3884,46 @@ Some( deprecation_reason: None, }, Field { - name: "filmConnection", + name: "planet", + description: None, + args: [ + InputValue { + name: "id", + description: None, + ty: FieldType { + kind: Scalar, + name: Some( + "ID", + ), + of_type: None, + }, + default_value: None, + }, + InputValue { + name: "planetID", + description: None, + ty: FieldType { + kind: Scalar, + name: Some( + "ID", + ), + of_type: None, + }, + default_value: None, + }, + ], + ty: FieldType { + kind: Object, + name: Some( + "Planet", + ), + of_type: None, + }, + is_deprecated: false, + deprecation_reason: None, + }, + Field { + name: "allSpecies", description: None, args: [ InputValue { @@ -3740,39 +3978,7 @@ Some( ty: FieldType { kind: Object, name: Some( - "StarshipFilmsConnection", - ), - of_type: None, - }, - is_deprecated: false, - deprecation_reason: None, - }, - Field { - name: "created", - description: Some( - "The ISO 8601 date format of the time that this resource was created.", - ), - args: [], - ty: FieldType { - kind: Scalar, - name: Some( - "String", - ), - of_type: None, - }, - is_deprecated: false, - deprecation_reason: None, - }, - Field { - name: "edited", - description: Some( - "The ISO 8601 date format of the time that this resource was edited.", - ), - args: [], - ty: FieldType { - kind: Scalar, - name: Some( - "String", + "SpeciesConnection", ), of_type: None, }, @@ -3780,165 +3986,38 @@ Some( deprecation_reason: None, }, Field { - name: "id", - description: Some( - "The ID of an object", - ), - args: [], - ty: FieldType { - kind: NonNull, - name: None, - of_type: Some( - FieldType { + name: "species", + description: None, + args: [ + InputValue { + name: "id", + description: None, + ty: FieldType { kind: Scalar, name: Some( "ID", ), of_type: None, }, - ), - }, - is_deprecated: false, - deprecation_reason: None, - }, - ], - ), - input_fields: None, - interfaces: Some( - [ - NamedType { - name: Some( - "Node", - ), - }, - ], - ), - enum_values: None, - possible_types: None, - specified_by_url: None, - }, - Type { - kind: Object, - name: Some( - "StarshipPilotsConnection", - ), - description: Some( - "A connection to a list of items.", - ), - fields: Some( - [ - Field { - name: "pageInfo", - description: Some( - "Information to aid in pagination.", - ), - args: [], - ty: FieldType { - kind: NonNull, - name: None, - of_type: Some( - FieldType { - kind: Object, - name: Some( - "PageInfo", - ), - of_type: None, - }, - ), - }, - is_deprecated: false, - deprecation_reason: None, - }, - Field { - name: "edges", - description: Some( - "A list of edges.", - ), - args: [], - ty: FieldType { - kind: List, - name: None, - of_type: Some( - FieldType { - kind: Object, - name: Some( - "StarshipPilotsEdge", - ), - of_type: None, - }, - ), - }, - is_deprecated: false, - deprecation_reason: None, - }, - Field { - name: "totalCount", - description: Some( - "A count of the total number of objects in this connection, ignoring pagination.\nThis allows a client to fetch the first five objects by passing \"5\" as the\nargument to \"first\", then fetch the total count so it could display \"5 of 83\",\nfor example.", - ), - args: [], - ty: FieldType { - kind: Scalar, - name: Some( - "Int", - ), - of_type: None, - }, - is_deprecated: false, - deprecation_reason: None, - }, - Field { - name: "pilots", - description: Some( - "A list of all of the objects returned in the connection. This is a convenience\nfield provided for quickly exploring the API; rather than querying for\n\"{ edges { node } }\" when no edge data is needed, this field can be be used\ninstead. Note that when clients like Relay need to fetch the \"cursor\" field on\nthe edge to enable efficient pagination, this shortcut cannot be used, and the\nfull \"{ edges { node } }\" version should be used instead.", - ), - args: [], - ty: FieldType { - kind: List, - name: None, - of_type: Some( - FieldType { - kind: Object, + default_value: None, + }, + InputValue { + name: "speciesID", + description: None, + ty: FieldType { + kind: Scalar, name: Some( - "Person", + "ID", ), - of_type: None, - }, - ), - }, - is_deprecated: false, - deprecation_reason: None, - }, - ], - ), - input_fields: None, - interfaces: Some( - [], - ), - enum_values: None, - possible_types: None, - specified_by_url: None, - }, - Type { - kind: Object, - name: Some( - "StarshipPilotsEdge", - ), - description: Some( - "An edge in a connection.", - ), - fields: Some( - [ - Field { - name: "node", - description: Some( - "The item at the end of the edge", - ), - args: [], + of_type: None, + }, + default_value: None, + }, + ], ty: FieldType { kind: Object, name: Some( - "Person", + "Species", ), of_type: None, }, @@ -3946,101 +4025,62 @@ Some( deprecation_reason: None, }, Field { - name: "cursor", - description: Some( - "A cursor for use in pagination", - ), - args: [], - ty: FieldType { - kind: NonNull, - name: None, - of_type: Some( - FieldType { + name: "allStarships", + description: None, + args: [ + InputValue { + name: "after", + description: None, + ty: FieldType { kind: Scalar, name: Some( "String", ), of_type: None, }, - ), - }, - is_deprecated: false, - deprecation_reason: None, - }, - ], - ), - input_fields: None, - interfaces: Some( - [], - ), - enum_values: None, - possible_types: None, - specified_by_url: None, - }, - Type { - kind: Object, - name: Some( - "StarshipFilmsConnection", - ), - description: Some( - "A connection to a list of items.", - ), - fields: Some( - [ - Field { - name: "pageInfo", - description: Some( - "Information to aid in pagination.", - ), - args: [], - ty: FieldType { - kind: NonNull, - name: None, - of_type: Some( - FieldType { - kind: Object, + default_value: None, + }, + InputValue { + name: "first", + description: None, + ty: FieldType { + kind: Scalar, name: Some( - "PageInfo", + "Int", ), of_type: None, }, - ), - }, - is_deprecated: false, - deprecation_reason: None, - }, - Field { - name: "edges", - description: Some( - "A list of edges.", - ), - args: [], - ty: FieldType { - kind: List, - name: None, - of_type: Some( - FieldType { - kind: Object, + default_value: None, + }, + InputValue { + name: "before", + description: None, + ty: FieldType { + kind: Scalar, name: Some( - "StarshipFilmsEdge", + "String", ), of_type: None, }, - ), - }, - is_deprecated: false, - deprecation_reason: None, - }, - Field { - name: "totalCount", - description: Some( - "A count of the total number of objects in this connection, ignoring pagination.\nThis allows a client to fetch the first five objects by passing \"5\" as the\nargument to \"first\", then fetch the total count so it could display \"5 of 83\",\nfor example.", - ), - args: [], + default_value: None, + }, + InputValue { + name: "last", + description: None, + ty: FieldType { + kind: Scalar, + name: Some( + "Int", + ), + of_type: None, + }, + default_value: None, + }, + ], ty: FieldType { - kind: Scalar, + kind: Object, name: Some( - "Int", + "StarshipsConnection", ), of_type: None, }, @@ -4048,57 +4088,38 @@ Some( deprecation_reason: None, }, Field { - name: "films", - description: Some( - "A list of all of the objects returned in the connection. This is a convenience\nfield provided for quickly exploring the API; rather than querying for\n\"{ edges { node } }\" when no edge data is needed, this field can be be used\ninstead. Note that when clients like Relay need to fetch the \"cursor\" field on\nthe edge to enable efficient pagination, this shortcut cannot be used, and the\nfull \"{ edges { node } }\" version should be used instead.", - ), - args: [], - ty: FieldType { - kind: List, - name: None, - of_type: Some( - FieldType { - kind: Object, + name: "starship", + description: None, + args: [ + InputValue { + name: "id", + description: None, + ty: FieldType { + kind: Scalar, name: Some( - "Film", + "ID", ), of_type: None, }, - ), - }, - is_deprecated: false, - deprecation_reason: None, - }, - ], - ), - input_fields: None, - interfaces: Some( - [], - ), - enum_values: None, - possible_types: None, - specified_by_url: None, - }, - Type { - kind: Object, - name: Some( - "StarshipFilmsEdge", - ), - description: Some( - "An edge in a connection.", - ), - fields: Some( - [ - Field { - name: "node", - description: Some( - "The item at the end of the edge", - ), - args: [], + default_value: None, + }, + InputValue { + name: "starshipID", + description: None, + ty: FieldType { + kind: Scalar, + name: Some( + "ID", + ), + of_type: None, + }, + default_value: None, + }, + ], ty: FieldType { kind: Object, name: Some( - "Film", + "Starship", ), of_type: None, }, @@ -4106,101 +4127,62 @@ Some( deprecation_reason: None, }, Field { - name: "cursor", - description: Some( - "A cursor for use in pagination", - ), - args: [], - ty: FieldType { - kind: NonNull, - name: None, - of_type: Some( - FieldType { + name: "allVehicles", + description: None, + args: [ + InputValue { + name: "after", + description: None, + ty: FieldType { kind: Scalar, name: Some( "String", ), of_type: None, }, - ), - }, - is_deprecated: false, - deprecation_reason: None, - }, - ], - ), - input_fields: None, - interfaces: Some( - [], - ), - enum_values: None, - possible_types: None, - specified_by_url: None, - }, - Type { - kind: Object, - name: Some( - "PersonVehiclesConnection", - ), - description: Some( - "A connection to a list of items.", - ), - fields: Some( - [ - Field { - name: "pageInfo", - description: Some( - "Information to aid in pagination.", - ), - args: [], - ty: FieldType { - kind: NonNull, - name: None, - of_type: Some( - FieldType { - kind: Object, + default_value: None, + }, + InputValue { + name: "first", + description: None, + ty: FieldType { + kind: Scalar, name: Some( - "PageInfo", + "Int", ), of_type: None, }, - ), - }, - is_deprecated: false, - deprecation_reason: None, - }, - Field { - name: "edges", - description: Some( - "A list of edges.", - ), - args: [], - ty: FieldType { - kind: List, - name: None, - of_type: Some( - FieldType { - kind: Object, + default_value: None, + }, + InputValue { + name: "before", + description: None, + ty: FieldType { + kind: Scalar, name: Some( - "PersonVehiclesEdge", + "String", ), of_type: None, }, - ), - }, - is_deprecated: false, - deprecation_reason: None, - }, - Field { - name: "totalCount", - description: Some( - "A count of the total number of objects in this connection, ignoring pagination.\nThis allows a client to fetch the first five objects by passing \"5\" as the\nargument to \"first\", then fetch the total count so it could display \"5 of 83\",\nfor example.", - ), - args: [], + default_value: None, + }, + InputValue { + name: "last", + description: None, + ty: FieldType { + kind: Scalar, + name: Some( + "Int", + ), + of_type: None, + }, + default_value: None, + }, + ], ty: FieldType { - kind: Scalar, + kind: Object, name: Some( - "Int", + "VehiclesConnection", ), of_type: None, }, @@ -4208,53 +4190,34 @@ Some( deprecation_reason: None, }, Field { - name: "vehicles", - description: Some( - "A list of all of the objects returned in the connection. This is a convenience\nfield provided for quickly exploring the API; rather than querying for\n\"{ edges { node } }\" when no edge data is needed, this field can be be used\ninstead. Note that when clients like Relay need to fetch the \"cursor\" field on\nthe edge to enable efficient pagination, this shortcut cannot be used, and the\nfull \"{ edges { node } }\" version should be used instead.", - ), - args: [], - ty: FieldType { - kind: List, - name: None, - of_type: Some( - FieldType { - kind: Object, + name: "vehicle", + description: None, + args: [ + InputValue { + name: "id", + description: None, + ty: FieldType { + kind: Scalar, name: Some( - "Vehicle", + "ID", ), of_type: None, }, - ), - }, - is_deprecated: false, - deprecation_reason: None, - }, - ], - ), - input_fields: None, - interfaces: Some( - [], - ), - enum_values: None, - possible_types: None, - specified_by_url: None, - }, - Type { - kind: Object, - name: Some( - "PersonVehiclesEdge", - ), - description: Some( - "An edge in a connection.", - ), - fields: Some( - [ - Field { - name: "node", - description: Some( - "The item at the end of the edge", - ), - args: [], + default_value: None, + }, + InputValue { + name: "vehicleID", + description: None, + ty: FieldType { + kind: Scalar, + name: Some( + "ID", + ), + of_type: None, + }, + default_value: None, + }, + ], ty: FieldType { kind: Object, name: Some( @@ -4266,23 +4229,38 @@ Some( deprecation_reason: None, }, Field { - name: "cursor", + name: "node", description: Some( - "A cursor for use in pagination", + "Fetches an object given its ID", ), - args: [], - ty: FieldType { - kind: NonNull, - name: None, - of_type: Some( - FieldType { - kind: Scalar, - name: Some( - "String", + args: [ + InputValue { + name: "id", + description: Some( + "The ID of an object", + ), + ty: FieldType { + kind: NonNull, + name: None, + of_type: Some( + FieldType { + kind: Scalar, + name: Some( + "ID", + ), + of_type: None, + }, ), - of_type: None, }, + default_value: None, + }, + ], + ty: FieldType { + kind: Interface, + name: Some( + "Node", ), + of_type: None, }, is_deprecated: false, deprecation_reason: None, @@ -4300,17 +4278,17 @@ Some( Type { kind: Object, name: Some( - "Vehicle", + "Species", ), description: Some( - "A single transport craft that does not have hyperdrive capability", + "A type of person or character within the Star Wars Universe.", ), fields: Some( [ Field { name: "name", description: Some( - "The name of this vehicle. The common name, such as \"Sand Crawler\" or \"Speeder\nbike\".", + "The name of this species.", ), args: [], ty: FieldType { @@ -4324,9 +4302,9 @@ Some( deprecation_reason: None, }, Field { - name: "model", + name: "classification", description: Some( - "The model or official name of this vehicle. Such as \"All-Terrain Attack\nTransport\".", + "The classification of this species, such as \"mammal\" or \"reptile\".", ), args: [], ty: FieldType { @@ -4340,9 +4318,9 @@ Some( deprecation_reason: None, }, Field { - name: "vehicleClass", + name: "designation", description: Some( - "The class of this vehicle, such as \"Wheeled\" or \"Repulsorcraft\".", + "The designation of this species, such as \"sentient\".", ), args: [], ty: FieldType { @@ -4356,31 +4334,9 @@ Some( deprecation_reason: None, }, Field { - name: "manufacturers", - description: Some( - "The manufacturers of this vehicle.", - ), - args: [], - ty: FieldType { - kind: List, - name: None, - of_type: Some( - FieldType { - kind: Scalar, - name: Some( - "String", - ), - of_type: None, - }, - ), - }, - is_deprecated: false, - deprecation_reason: None, - }, - Field { - name: "costInCredits", + name: "averageHeight", description: Some( - "The cost of this vehicle new, in Galactic Credits.", + "The average height of this species in centimeters.", ), args: [], ty: FieldType { @@ -4394,15 +4350,15 @@ Some( deprecation_reason: None, }, Field { - name: "length", + name: "averageLifespan", description: Some( - "The length of this vehicle in meters.", + "The average lifespan of this species in years, null if unknown.", ), args: [], ty: FieldType { kind: Scalar, name: Some( - "Float", + "Int", ), of_type: None, }, @@ -4410,63 +4366,81 @@ Some( deprecation_reason: None, }, Field { - name: "crew", + name: "eyeColors", description: Some( - "The number of personnel needed to run or pilot this vehicle.", + "Common eye colors for this species, null if this species does not typically\nhave eyes.", ), args: [], ty: FieldType { - kind: Scalar, - name: Some( - "String", + kind: List, + name: None, + of_type: Some( + FieldType { + kind: Scalar, + name: Some( + "String", + ), + of_type: None, + }, ), - of_type: None, }, is_deprecated: false, deprecation_reason: None, }, Field { - name: "passengers", + name: "hairColors", description: Some( - "The number of non-essential people this vehicle can transport.", + "Common hair colors for this species, null if this species does not typically\nhave hair.", ), args: [], ty: FieldType { - kind: Scalar, - name: Some( - "String", + kind: List, + name: None, + of_type: Some( + FieldType { + kind: Scalar, + name: Some( + "String", + ), + of_type: None, + }, ), - of_type: None, }, is_deprecated: false, deprecation_reason: None, }, Field { - name: "maxAtmospheringSpeed", + name: "skinColors", description: Some( - "The maximum speed of this vehicle in atmosphere.", + "Common skin colors for this species, null if this species does not typically\nhave skin.", ), args: [], ty: FieldType { - kind: Scalar, - name: Some( - "Int", + kind: List, + name: None, + of_type: Some( + FieldType { + kind: Scalar, + name: Some( + "String", + ), + of_type: None, + }, ), - of_type: None, }, is_deprecated: false, deprecation_reason: None, }, Field { - name: "cargoCapacity", + name: "language", description: Some( - "The maximum number of kilograms that this vehicle can transport.", + "The language commonly spoken by this species.", ), args: [], ty: FieldType { kind: Scalar, name: Some( - "Float", + "String", ), of_type: None, }, @@ -4474,15 +4448,15 @@ Some( deprecation_reason: None, }, Field { - name: "consumables", + name: "homeworld", description: Some( - "The maximum length of time that this vehicle can provide consumables for its\nentire crew without having to resupply.", + "A planet that this species originates from.", ), args: [], ty: FieldType { - kind: Scalar, + kind: Object, name: Some( - "String", + "Planet", ), of_type: None, }, @@ -4490,7 +4464,7 @@ Some( deprecation_reason: None, }, Field { - name: "pilotConnection", + name: "personConnection", description: None, args: [ InputValue { @@ -4545,7 +4519,7 @@ Some( ty: FieldType { kind: Object, name: Some( - "VehiclePilotsConnection", + "SpeciesPeopleConnection", ), of_type: None, }, @@ -4608,7 +4582,7 @@ Some( ty: FieldType { kind: Object, name: Some( - "VehicleFilmsConnection", + "SpeciesFilmsConnection", ), of_type: None, }, @@ -4688,7 +4662,7 @@ Some( Type { kind: Object, name: Some( - "VehiclePilotsConnection", + "SpeciesConnection", ), description: Some( "A connection to a list of items.", @@ -4730,7 +4704,7 @@ Some( FieldType { kind: Object, name: Some( - "VehiclePilotsEdge", + "SpeciesEdge", ), of_type: None, }, @@ -4756,7 +4730,7 @@ Some( deprecation_reason: None, }, Field { - name: "pilots", + name: "species", description: Some( "A list of all of the objects returned in the connection. This is a convenience\nfield provided for quickly exploring the API; rather than querying for\n\"{ edges { node } }\" when no edge data is needed, this field can be be used\ninstead. Note that when clients like Relay need to fetch the \"cursor\" field on\nthe edge to enable efficient pagination, this shortcut cannot be used, and the\nfull \"{ edges { node } }\" version should be used instead.", ), @@ -4768,7 +4742,7 @@ Some( FieldType { kind: Object, name: Some( - "Person", + "Species", ), of_type: None, }, @@ -4790,7 +4764,7 @@ Some( Type { kind: Object, name: Some( - "VehiclePilotsEdge", + "SpeciesEdge", ), description: Some( "An edge in a connection.", @@ -4806,7 +4780,7 @@ Some( ty: FieldType { kind: Object, name: Some( - "Person", + "Species", ), of_type: None, }, @@ -4848,7 +4822,7 @@ Some( Type { kind: Object, name: Some( - "VehicleFilmsConnection", + "SpeciesFilmsConnection", ), description: Some( "A connection to a list of items.", @@ -4890,7 +4864,7 @@ Some( FieldType { kind: Object, name: Some( - "VehicleFilmsEdge", + "SpeciesFilmsEdge", ), of_type: None, }, @@ -4950,7 +4924,7 @@ Some( Type { kind: Object, name: Some( - "VehicleFilmsEdge", + "SpeciesFilmsEdge", ), description: Some( "An edge in a connection.", @@ -5008,7 +4982,7 @@ Some( Type { kind: Object, name: Some( - "PlanetFilmsConnection", + "SpeciesPeopleConnection", ), description: Some( "A connection to a list of items.", @@ -5050,7 +5024,7 @@ Some( FieldType { kind: Object, name: Some( - "PlanetFilmsEdge", + "SpeciesPeopleEdge", ), of_type: None, }, @@ -5076,7 +5050,7 @@ Some( deprecation_reason: None, }, Field { - name: "films", + name: "people", description: Some( "A list of all of the objects returned in the connection. This is a convenience\nfield provided for quickly exploring the API; rather than querying for\n\"{ edges { node } }\" when no edge data is needed, this field can be be used\ninstead. Note that when clients like Relay need to fetch the \"cursor\" field on\nthe edge to enable efficient pagination, this shortcut cannot be used, and the\nfull \"{ edges { node } }\" version should be used instead.", ), @@ -5088,7 +5062,7 @@ Some( FieldType { kind: Object, name: Some( - "Film", + "Person", ), of_type: None, }, @@ -5110,7 +5084,7 @@ Some( Type { kind: Object, name: Some( - "PlanetFilmsEdge", + "SpeciesPeopleEdge", ), description: Some( "An edge in a connection.", @@ -5118,15 +5092,223 @@ Some( fields: Some( [ Field { - name: "node", + name: "node", + description: Some( + "The item at the end of the edge", + ), + args: [], + ty: FieldType { + kind: Object, + name: Some( + "Person", + ), + of_type: None, + }, + is_deprecated: false, + deprecation_reason: None, + }, + Field { + name: "cursor", + description: Some( + "A cursor for use in pagination", + ), + args: [], + ty: FieldType { + kind: NonNull, + name: None, + of_type: Some( + FieldType { + kind: Scalar, + name: Some( + "String", + ), + of_type: None, + }, + ), + }, + is_deprecated: false, + deprecation_reason: None, + }, + ], + ), + input_fields: None, + interfaces: Some( + [], + ), + enum_values: None, + possible_types: None, + specified_by_url: None, + }, + Type { + kind: Object, + name: Some( + "Starship", + ), + description: Some( + "A single transport craft that has hyperdrive capability.", + ), + fields: Some( + [ + Field { + name: "name", + description: Some( + "The name of this starship. The common name, such as \"Death Star\".", + ), + args: [], + ty: FieldType { + kind: Scalar, + name: Some( + "String", + ), + of_type: None, + }, + is_deprecated: false, + deprecation_reason: None, + }, + Field { + name: "model", + description: Some( + "The model or official name of this starship. Such as \"T-65 X-wing\" or \"DS-1\nOrbital Battle Station\".", + ), + args: [], + ty: FieldType { + kind: Scalar, + name: Some( + "String", + ), + of_type: None, + }, + is_deprecated: false, + deprecation_reason: None, + }, + Field { + name: "starshipClass", + description: Some( + "The class of this starship, such as \"Starfighter\" or \"Deep Space Mobile\nBattlestation\"", + ), + args: [], + ty: FieldType { + kind: Scalar, + name: Some( + "String", + ), + of_type: None, + }, + is_deprecated: false, + deprecation_reason: None, + }, + Field { + name: "manufacturers", + description: Some( + "The manufacturers of this starship.", + ), + args: [], + ty: FieldType { + kind: List, + name: None, + of_type: Some( + FieldType { + kind: Scalar, + name: Some( + "String", + ), + of_type: None, + }, + ), + }, + is_deprecated: false, + deprecation_reason: None, + }, + Field { + name: "costInCredits", + description: Some( + "The cost of this starship new, in galactic credits.", + ), + args: [], + ty: FieldType { + kind: Scalar, + name: Some( + "Float", + ), + of_type: None, + }, + is_deprecated: false, + deprecation_reason: None, + }, + Field { + name: "length", + description: Some( + "The length of this starship in meters.", + ), + args: [], + ty: FieldType { + kind: Scalar, + name: Some( + "Float", + ), + of_type: None, + }, + is_deprecated: false, + deprecation_reason: None, + }, + Field { + name: "crew", + description: Some( + "The number of personnel needed to run or pilot this starship.", + ), + args: [], + ty: FieldType { + kind: Scalar, + name: Some( + "String", + ), + of_type: None, + }, + is_deprecated: false, + deprecation_reason: None, + }, + Field { + name: "passengers", + description: Some( + "The number of non-essential people this starship can transport.", + ), + args: [], + ty: FieldType { + kind: Scalar, + name: Some( + "String", + ), + of_type: None, + }, + is_deprecated: false, + deprecation_reason: None, + }, + Field { + name: "maxAtmospheringSpeed", + description: Some( + "The maximum speed of this starship in atmosphere. null if this starship is\nincapable of atmosphering flight.", + ), + args: [], + ty: FieldType { + kind: Scalar, + name: Some( + "Int", + ), + of_type: None, + }, + is_deprecated: false, + deprecation_reason: None, + }, + Field { + name: "hyperdriveRating", description: Some( - "The item at the end of the edge", + "The class of this starships hyperdrive.", ), args: [], ty: FieldType { - kind: Object, + kind: Scalar, name: Some( - "Film", + "Float", ), of_type: None, }, @@ -5134,101 +5316,173 @@ Some( deprecation_reason: None, }, Field { - name: "cursor", + name: "MGLT", description: Some( - "A cursor for use in pagination", + "The Maximum number of Megalights this starship can travel in a standard hour.\nA \"Megalight\" is a standard unit of distance and has never been defined before\nwithin the Star Wars universe. This figure is only really useful for measuring\nthe difference in speed of starships. We can assume it is similar to AU, the\ndistance between our Sun (Sol) and Earth.", ), args: [], ty: FieldType { - kind: NonNull, - name: None, - of_type: Some( - FieldType { - kind: Scalar, - name: Some( - "String", - ), - of_type: None, - }, + kind: Scalar, + name: Some( + "Int", ), + of_type: None, }, is_deprecated: false, deprecation_reason: None, }, - ], - ), - input_fields: None, - interfaces: Some( - [], - ), - enum_values: None, - possible_types: None, - specified_by_url: None, - }, - Type { - kind: Object, - name: Some( - "SpeciesPeopleConnection", - ), - description: Some( - "A connection to a list of items.", - ), - fields: Some( - [ Field { - name: "pageInfo", + name: "cargoCapacity", description: Some( - "Information to aid in pagination.", + "The maximum number of kilograms that this starship can transport.", ), args: [], ty: FieldType { - kind: NonNull, - name: None, - of_type: Some( - FieldType { - kind: Object, - name: Some( - "PageInfo", - ), - of_type: None, - }, + kind: Scalar, + name: Some( + "Float", ), + of_type: None, }, is_deprecated: false, deprecation_reason: None, }, Field { - name: "edges", + name: "consumables", description: Some( - "A list of edges.", + "The maximum length of time that this starship can provide consumables for its\nentire crew without having to resupply.", ), args: [], ty: FieldType { - kind: List, - name: None, - of_type: Some( - FieldType { - kind: Object, + kind: Scalar, + name: Some( + "String", + ), + of_type: None, + }, + is_deprecated: false, + deprecation_reason: None, + }, + Field { + name: "pilotConnection", + description: None, + args: [ + InputValue { + name: "after", + description: None, + ty: FieldType { + kind: Scalar, name: Some( - "SpeciesPeopleEdge", + "String", + ), + of_type: None, + }, + default_value: None, + }, + InputValue { + name: "first", + description: None, + ty: FieldType { + kind: Scalar, + name: Some( + "Int", + ), + of_type: None, + }, + default_value: None, + }, + InputValue { + name: "before", + description: None, + ty: FieldType { + kind: Scalar, + name: Some( + "String", + ), + of_type: None, + }, + default_value: None, + }, + InputValue { + name: "last", + description: None, + ty: FieldType { + kind: Scalar, + name: Some( + "Int", ), of_type: None, }, + default_value: None, + }, + ], + ty: FieldType { + kind: Object, + name: Some( + "StarshipPilotsConnection", ), + of_type: None, }, is_deprecated: false, deprecation_reason: None, }, Field { - name: "totalCount", - description: Some( - "A count of the total number of objects in this connection, ignoring pagination.\nThis allows a client to fetch the first five objects by passing \"5\" as the\nargument to \"first\", then fetch the total count so it could display \"5 of 83\",\nfor example.", - ), - args: [], + name: "filmConnection", + description: None, + args: [ + InputValue { + name: "after", + description: None, + ty: FieldType { + kind: Scalar, + name: Some( + "String", + ), + of_type: None, + }, + default_value: None, + }, + InputValue { + name: "first", + description: None, + ty: FieldType { + kind: Scalar, + name: Some( + "Int", + ), + of_type: None, + }, + default_value: None, + }, + InputValue { + name: "before", + description: None, + ty: FieldType { + kind: Scalar, + name: Some( + "String", + ), + of_type: None, + }, + default_value: None, + }, + InputValue { + name: "last", + description: None, + ty: FieldType { + kind: Scalar, + name: Some( + "Int", + ), + of_type: None, + }, + default_value: None, + }, + ], ty: FieldType { - kind: Scalar, + kind: Object, name: Some( - "Int", + "StarshipFilmsConnection", ), of_type: None, }, @@ -5236,57 +5490,31 @@ Some( deprecation_reason: None, }, Field { - name: "people", + name: "created", description: Some( - "A list of all of the objects returned in the connection. This is a convenience\nfield provided for quickly exploring the API; rather than querying for\n\"{ edges { node } }\" when no edge data is needed, this field can be be used\ninstead. Note that when clients like Relay need to fetch the \"cursor\" field on\nthe edge to enable efficient pagination, this shortcut cannot be used, and the\nfull \"{ edges { node } }\" version should be used instead.", + "The ISO 8601 date format of the time that this resource was created.", ), args: [], ty: FieldType { - kind: List, - name: None, - of_type: Some( - FieldType { - kind: Object, - name: Some( - "Person", - ), - of_type: None, - }, + kind: Scalar, + name: Some( + "String", ), + of_type: None, }, is_deprecated: false, deprecation_reason: None, }, - ], - ), - input_fields: None, - interfaces: Some( - [], - ), - enum_values: None, - possible_types: None, - specified_by_url: None, - }, - Type { - kind: Object, - name: Some( - "SpeciesPeopleEdge", - ), - description: Some( - "An edge in a connection.", - ), - fields: Some( - [ Field { - name: "node", + name: "edited", description: Some( - "The item at the end of the edge", + "The ISO 8601 date format of the time that this resource was edited.", ), args: [], ty: FieldType { - kind: Object, + kind: Scalar, name: Some( - "Person", + "String", ), of_type: None, }, @@ -5294,9 +5522,9 @@ Some( deprecation_reason: None, }, Field { - name: "cursor", + name: "id", description: Some( - "A cursor for use in pagination", + "The ID of an object", ), args: [], ty: FieldType { @@ -5306,7 +5534,7 @@ Some( FieldType { kind: Scalar, name: Some( - "String", + "ID", ), of_type: None, }, @@ -5319,7 +5547,13 @@ Some( ), input_fields: None, interfaces: Some( - [], + [ + NamedType { + name: Some( + "Node", + ), + }, + ], ), enum_values: None, possible_types: None, @@ -5328,7 +5562,7 @@ Some( Type { kind: Object, name: Some( - "SpeciesFilmsConnection", + "StarshipFilmsConnection", ), description: Some( "A connection to a list of items.", @@ -5370,7 +5604,7 @@ Some( FieldType { kind: Object, name: Some( - "SpeciesFilmsEdge", + "StarshipFilmsEdge", ), of_type: None, }, @@ -5430,7 +5664,7 @@ Some( Type { kind: Object, name: Some( - "SpeciesFilmsEdge", + "StarshipFilmsEdge", ), description: Some( "An edge in a connection.", @@ -5488,7 +5722,7 @@ Some( Type { kind: Object, name: Some( - "FilmStarshipsConnection", + "StarshipPilotsConnection", ), description: Some( "A connection to a list of items.", @@ -5530,7 +5764,7 @@ Some( FieldType { kind: Object, name: Some( - "FilmStarshipsEdge", + "StarshipPilotsEdge", ), of_type: None, }, @@ -5556,7 +5790,7 @@ Some( deprecation_reason: None, }, Field { - name: "starships", + name: "pilots", description: Some( "A list of all of the objects returned in the connection. This is a convenience\nfield provided for quickly exploring the API; rather than querying for\n\"{ edges { node } }\" when no edge data is needed, this field can be be used\ninstead. Note that when clients like Relay need to fetch the \"cursor\" field on\nthe edge to enable efficient pagination, this shortcut cannot be used, and the\nfull \"{ edges { node } }\" version should be used instead.", ), @@ -5568,7 +5802,7 @@ Some( FieldType { kind: Object, name: Some( - "Starship", + "Person", ), of_type: None, }, @@ -5590,7 +5824,7 @@ Some( Type { kind: Object, name: Some( - "FilmStarshipsEdge", + "StarshipPilotsEdge", ), description: Some( "An edge in a connection.", @@ -5606,7 +5840,7 @@ Some( ty: FieldType { kind: Object, name: Some( - "Starship", + "Person", ), of_type: None, }, @@ -5648,7 +5882,7 @@ Some( Type { kind: Object, name: Some( - "FilmVehiclesConnection", + "StarshipsConnection", ), description: Some( "A connection to a list of items.", @@ -5690,7 +5924,7 @@ Some( FieldType { kind: Object, name: Some( - "FilmVehiclesEdge", + "StarshipsEdge", ), of_type: None, }, @@ -5716,7 +5950,7 @@ Some( deprecation_reason: None, }, Field { - name: "vehicles", + name: "starships", description: Some( "A list of all of the objects returned in the connection. This is a convenience\nfield provided for quickly exploring the API; rather than querying for\n\"{ edges { node } }\" when no edge data is needed, this field can be be used\ninstead. Note that when clients like Relay need to fetch the \"cursor\" field on\nthe edge to enable efficient pagination, this shortcut cannot be used, and the\nfull \"{ edges { node } }\" version should be used instead.", ), @@ -5728,7 +5962,7 @@ Some( FieldType { kind: Object, name: Some( - "Vehicle", + "Starship", ), of_type: None, }, @@ -5750,7 +5984,7 @@ Some( Type { kind: Object, name: Some( - "FilmVehiclesEdge", + "StarshipsEdge", ), description: Some( "An edge in a connection.", @@ -5766,7 +6000,7 @@ Some( ty: FieldType { kind: Object, name: Some( - "Vehicle", + "Starship", ), of_type: None, }, @@ -5805,42 +6039,83 @@ Some( possible_types: None, specified_by_url: None, }, + Type { + kind: Scalar, + name: Some( + "String", + ), + description: Some( + "The `String` scalar type represents textual data, represented as UTF-8\ncharacter sequences. The String type is most often used by GraphQL to\nrepresent free-form human-readable text.", + ), + fields: None, + input_fields: None, + interfaces: None, + enum_values: None, + possible_types: None, + specified_by_url: None, + }, Type { kind: Object, name: Some( - "FilmCharactersConnection", + "Vehicle", ), description: Some( - "A connection to a list of items.", + "A single transport craft that does not have hyperdrive capability", ), fields: Some( [ Field { - name: "pageInfo", + name: "name", description: Some( - "Information to aid in pagination.", + "The name of this vehicle. The common name, such as \"Sand Crawler\" or \"Speeder\nbike\".", ), args: [], ty: FieldType { - kind: NonNull, - name: None, - of_type: Some( - FieldType { - kind: Object, - name: Some( - "PageInfo", - ), - of_type: None, - }, + kind: Scalar, + name: Some( + "String", ), + of_type: None, }, is_deprecated: false, deprecation_reason: None, }, Field { - name: "edges", + name: "model", description: Some( - "A list of edges.", + "The model or official name of this vehicle. Such as \"All-Terrain Attack\nTransport\".", + ), + args: [], + ty: FieldType { + kind: Scalar, + name: Some( + "String", + ), + of_type: None, + }, + is_deprecated: false, + deprecation_reason: None, + }, + Field { + name: "vehicleClass", + description: Some( + "The class of this vehicle, such as \"Wheeled\" or \"Repulsorcraft\".", + ), + args: [], + ty: FieldType { + kind: Scalar, + name: Some( + "String", + ), + of_type: None, + }, + is_deprecated: false, + deprecation_reason: None, + }, + Field { + name: "manufacturers", + description: Some( + "The manufacturers of this vehicle.", ), args: [], ty: FieldType { @@ -5848,9 +6123,9 @@ Some( name: None, of_type: Some( FieldType { - kind: Object, + kind: Scalar, name: Some( - "FilmCharactersEdge", + "String", ), of_type: None, }, @@ -5860,9 +6135,73 @@ Some( deprecation_reason: None, }, Field { - name: "totalCount", + name: "costInCredits", description: Some( - "A count of the total number of objects in this connection, ignoring pagination.\nThis allows a client to fetch the first five objects by passing \"5\" as the\nargument to \"first\", then fetch the total count so it could display \"5 of 83\",\nfor example.", + "The cost of this vehicle new, in Galactic Credits.", + ), + args: [], + ty: FieldType { + kind: Scalar, + name: Some( + "Float", + ), + of_type: None, + }, + is_deprecated: false, + deprecation_reason: None, + }, + Field { + name: "length", + description: Some( + "The length of this vehicle in meters.", + ), + args: [], + ty: FieldType { + kind: Scalar, + name: Some( + "Float", + ), + of_type: None, + }, + is_deprecated: false, + deprecation_reason: None, + }, + Field { + name: "crew", + description: Some( + "The number of personnel needed to run or pilot this vehicle.", + ), + args: [], + ty: FieldType { + kind: Scalar, + name: Some( + "String", + ), + of_type: None, + }, + is_deprecated: false, + deprecation_reason: None, + }, + Field { + name: "passengers", + description: Some( + "The number of non-essential people this vehicle can transport.", + ), + args: [], + ty: FieldType { + kind: Scalar, + name: Some( + "String", + ), + of_type: None, + }, + is_deprecated: false, + deprecation_reason: None, + }, + Field { + name: "maxAtmospheringSpeed", + description: Some( + "The maximum speed of this vehicle in atmosphere.", ), args: [], ty: FieldType { @@ -5876,57 +6215,94 @@ Some( deprecation_reason: None, }, Field { - name: "characters", + name: "cargoCapacity", description: Some( - "A list of all of the objects returned in the connection. This is a convenience\nfield provided for quickly exploring the API; rather than querying for\n\"{ edges { node } }\" when no edge data is needed, this field can be be used\ninstead. Note that when clients like Relay need to fetch the \"cursor\" field on\nthe edge to enable efficient pagination, this shortcut cannot be used, and the\nfull \"{ edges { node } }\" version should be used instead.", + "The maximum number of kilograms that this vehicle can transport.", ), args: [], ty: FieldType { - kind: List, - name: None, - of_type: Some( - FieldType { - kind: Object, + kind: Scalar, + name: Some( + "Float", + ), + of_type: None, + }, + is_deprecated: false, + deprecation_reason: None, + }, + Field { + name: "consumables", + description: Some( + "The maximum length of time that this vehicle can provide consumables for its\nentire crew without having to resupply.", + ), + args: [], + ty: FieldType { + kind: Scalar, + name: Some( + "String", + ), + of_type: None, + }, + is_deprecated: false, + deprecation_reason: None, + }, + Field { + name: "pilotConnection", + description: None, + args: [ + InputValue { + name: "after", + description: None, + ty: FieldType { + kind: Scalar, + name: Some( + "String", + ), + of_type: None, + }, + default_value: None, + }, + InputValue { + name: "first", + description: None, + ty: FieldType { + kind: Scalar, + name: Some( + "Int", + ), + of_type: None, + }, + default_value: None, + }, + InputValue { + name: "before", + description: None, + ty: FieldType { + kind: Scalar, + name: Some( + "String", + ), + of_type: None, + }, + default_value: None, + }, + InputValue { + name: "last", + description: None, + ty: FieldType { + kind: Scalar, name: Some( - "Person", + "Int", ), of_type: None, }, - ), - }, - is_deprecated: false, - deprecation_reason: None, - }, - ], - ), - input_fields: None, - interfaces: Some( - [], - ), - enum_values: None, - possible_types: None, - specified_by_url: None, - }, - Type { - kind: Object, - name: Some( - "FilmCharactersEdge", - ), - description: Some( - "An edge in a connection.", - ), - fields: Some( - [ - Field { - name: "node", - description: Some( - "The item at the end of the edge", - ), - args: [], + default_value: None, + }, + ], ty: FieldType { kind: Object, name: Some( - "Person", + "VehiclePilotsConnection", ), of_type: None, }, @@ -5934,101 +6310,62 @@ Some( deprecation_reason: None, }, Field { - name: "cursor", - description: Some( - "A cursor for use in pagination", - ), - args: [], - ty: FieldType { - kind: NonNull, - name: None, - of_type: Some( - FieldType { + name: "filmConnection", + description: None, + args: [ + InputValue { + name: "after", + description: None, + ty: FieldType { kind: Scalar, name: Some( "String", ), of_type: None, }, - ), - }, - is_deprecated: false, - deprecation_reason: None, - }, - ], - ), - input_fields: None, - interfaces: Some( - [], - ), - enum_values: None, - possible_types: None, - specified_by_url: None, - }, - Type { - kind: Object, - name: Some( - "FilmPlanetsConnection", - ), - description: Some( - "A connection to a list of items.", - ), - fields: Some( - [ - Field { - name: "pageInfo", - description: Some( - "Information to aid in pagination.", - ), - args: [], - ty: FieldType { - kind: NonNull, - name: None, - of_type: Some( - FieldType { - kind: Object, + default_value: None, + }, + InputValue { + name: "first", + description: None, + ty: FieldType { + kind: Scalar, name: Some( - "PageInfo", + "Int", ), of_type: None, }, - ), - }, - is_deprecated: false, - deprecation_reason: None, - }, - Field { - name: "edges", - description: Some( - "A list of edges.", - ), - args: [], - ty: FieldType { - kind: List, - name: None, - of_type: Some( - FieldType { - kind: Object, + default_value: None, + }, + InputValue { + name: "before", + description: None, + ty: FieldType { + kind: Scalar, name: Some( - "FilmPlanetsEdge", + "String", ), of_type: None, }, - ), - }, - is_deprecated: false, - deprecation_reason: None, - }, - Field { - name: "totalCount", - description: Some( - "A count of the total number of objects in this connection, ignoring pagination.\nThis allows a client to fetch the first five objects by passing \"5\" as the\nargument to \"first\", then fetch the total count so it could display \"5 of 83\",\nfor example.", - ), - args: [], + default_value: None, + }, + InputValue { + name: "last", + description: None, + ty: FieldType { + kind: Scalar, + name: Some( + "Int", + ), + of_type: None, + }, + default_value: None, + }, + ], ty: FieldType { - kind: Scalar, + kind: Object, name: Some( - "Int", + "VehicleFilmsConnection", ), of_type: None, }, @@ -6036,57 +6373,31 @@ Some( deprecation_reason: None, }, Field { - name: "planets", + name: "created", description: Some( - "A list of all of the objects returned in the connection. This is a convenience\nfield provided for quickly exploring the API; rather than querying for\n\"{ edges { node } }\" when no edge data is needed, this field can be be used\ninstead. Note that when clients like Relay need to fetch the \"cursor\" field on\nthe edge to enable efficient pagination, this shortcut cannot be used, and the\nfull \"{ edges { node } }\" version should be used instead.", + "The ISO 8601 date format of the time that this resource was created.", ), args: [], ty: FieldType { - kind: List, - name: None, - of_type: Some( - FieldType { - kind: Object, - name: Some( - "Planet", - ), - of_type: None, - }, + kind: Scalar, + name: Some( + "String", ), + of_type: None, }, is_deprecated: false, deprecation_reason: None, }, - ], - ), - input_fields: None, - interfaces: Some( - [], - ), - enum_values: None, - possible_types: None, - specified_by_url: None, - }, - Type { - kind: Object, - name: Some( - "FilmPlanetsEdge", - ), - description: Some( - "An edge in a connection.", - ), - fields: Some( - [ Field { - name: "node", + name: "edited", description: Some( - "The item at the end of the edge", + "The ISO 8601 date format of the time that this resource was edited.", ), args: [], ty: FieldType { - kind: Object, + kind: Scalar, name: Some( - "Planet", + "String", ), of_type: None, }, @@ -6094,9 +6405,9 @@ Some( deprecation_reason: None, }, Field { - name: "cursor", + name: "id", description: Some( - "A cursor for use in pagination", + "The ID of an object", ), args: [], ty: FieldType { @@ -6106,7 +6417,7 @@ Some( FieldType { kind: Scalar, name: Some( - "String", + "ID", ), of_type: None, }, @@ -6119,7 +6430,13 @@ Some( ), input_fields: None, interfaces: Some( - [], + [ + NamedType { + name: Some( + "Node", + ), + }, + ], ), enum_values: None, possible_types: None, @@ -6128,7 +6445,7 @@ Some( Type { kind: Object, name: Some( - "PeopleConnection", + "VehicleFilmsConnection", ), description: Some( "A connection to a list of items.", @@ -6170,7 +6487,7 @@ Some( FieldType { kind: Object, name: Some( - "PeopleEdge", + "VehicleFilmsEdge", ), of_type: None, }, @@ -6196,7 +6513,7 @@ Some( deprecation_reason: None, }, Field { - name: "people", + name: "films", description: Some( "A list of all of the objects returned in the connection. This is a convenience\nfield provided for quickly exploring the API; rather than querying for\n\"{ edges { node } }\" when no edge data is needed, this field can be be used\ninstead. Note that when clients like Relay need to fetch the \"cursor\" field on\nthe edge to enable efficient pagination, this shortcut cannot be used, and the\nfull \"{ edges { node } }\" version should be used instead.", ), @@ -6208,7 +6525,7 @@ Some( FieldType { kind: Object, name: Some( - "Person", + "Film", ), of_type: None, }, @@ -6230,7 +6547,7 @@ Some( Type { kind: Object, name: Some( - "PeopleEdge", + "VehicleFilmsEdge", ), description: Some( "An edge in a connection.", @@ -6246,7 +6563,7 @@ Some( ty: FieldType { kind: Object, name: Some( - "Person", + "Film", ), of_type: None, }, @@ -6288,7 +6605,7 @@ Some( Type { kind: Object, name: Some( - "PlanetsConnection", + "VehiclePilotsConnection", ), description: Some( "A connection to a list of items.", @@ -6330,7 +6647,7 @@ Some( FieldType { kind: Object, name: Some( - "PlanetsEdge", + "VehiclePilotsEdge", ), of_type: None, }, @@ -6356,7 +6673,7 @@ Some( deprecation_reason: None, }, Field { - name: "planets", + name: "pilots", description: Some( "A list of all of the objects returned in the connection. This is a convenience\nfield provided for quickly exploring the API; rather than querying for\n\"{ edges { node } }\" when no edge data is needed, this field can be be used\ninstead. Note that when clients like Relay need to fetch the \"cursor\" field on\nthe edge to enable efficient pagination, this shortcut cannot be used, and the\nfull \"{ edges { node } }\" version should be used instead.", ), @@ -6368,7 +6685,7 @@ Some( FieldType { kind: Object, name: Some( - "Planet", + "Person", ), of_type: None, }, @@ -6390,7 +6707,7 @@ Some( Type { kind: Object, name: Some( - "PlanetsEdge", + "VehiclePilotsEdge", ), description: Some( "An edge in a connection.", @@ -6406,7 +6723,7 @@ Some( ty: FieldType { kind: Object, name: Some( - "Planet", + "Person", ), of_type: None, }, @@ -6448,7 +6765,7 @@ Some( Type { kind: Object, name: Some( - "SpeciesConnection", + "VehiclesConnection", ), description: Some( "A connection to a list of items.", @@ -6490,7 +6807,7 @@ Some( FieldType { kind: Object, name: Some( - "SpeciesEdge", + "VehiclesEdge", ), of_type: None, }, @@ -6516,7 +6833,7 @@ Some( deprecation_reason: None, }, Field { - name: "species", + name: "vehicles", description: Some( "A list of all of the objects returned in the connection. This is a convenience\nfield provided for quickly exploring the API; rather than querying for\n\"{ edges { node } }\" when no edge data is needed, this field can be be used\ninstead. Note that when clients like Relay need to fetch the \"cursor\" field on\nthe edge to enable efficient pagination, this shortcut cannot be used, and the\nfull \"{ edges { node } }\" version should be used instead.", ), @@ -6528,7 +6845,7 @@ Some( FieldType { kind: Object, name: Some( - "Species", + "Vehicle", ), of_type: None, }, @@ -6550,7 +6867,7 @@ Some( Type { kind: Object, name: Some( - "SpeciesEdge", + "VehiclesEdge", ), description: Some( "An edge in a connection.", @@ -6566,7 +6883,7 @@ Some( ty: FieldType { kind: Object, name: Some( - "Species", + "Vehicle", ), of_type: None, }, @@ -6608,49 +6925,25 @@ Some( Type { kind: Object, name: Some( - "StarshipsConnection", + "__Directive", ), description: Some( - "A connection to a list of items.", + "A Directive provides a way to describe alternate runtime execution and type\nvalidation behavior in a GraphQL document.\n\nIn some cases, you need to provide options to alter GraphQL's execution\nbehavior in ways field arguments will not suffice, such as conditionally\nincluding or skipping a field. Directives provide this by describing\nadditional information to the executor.", ), fields: Some( [ Field { - name: "pageInfo", - description: Some( - "Information to aid in pagination.", - ), + name: "name", + description: None, args: [], ty: FieldType { kind: NonNull, name: None, of_type: Some( FieldType { - kind: Object, - name: Some( - "PageInfo", - ), - of_type: None, - }, - ), - }, - is_deprecated: false, - deprecation_reason: None, - }, - Field { - name: "edges", - description: Some( - "A list of edges.", - ), - args: [], - ty: FieldType { - kind: List, - name: None, - of_type: Some( - FieldType { - kind: Object, + kind: Scalar, name: Some( - "StarshipsEdge", + "String", ), of_type: None, }, @@ -6660,15 +6953,13 @@ Some( deprecation_reason: None, }, Field { - name: "totalCount", - description: Some( - "A count of the total number of objects in this connection, ignoring pagination.\nThis allows a client to fetch the first five objects by passing \"5\" as the\nargument to \"first\", then fetch the total count so it could display \"5 of 83\",\nfor example.", - ), + name: "description", + description: None, args: [], ty: FieldType { kind: Scalar, name: Some( - "Int", + "String", ), of_type: None, }, @@ -6676,68 +6967,72 @@ Some( deprecation_reason: None, }, Field { - name: "starships", - description: Some( - "A list of all of the objects returned in the connection. This is a convenience\nfield provided for quickly exploring the API; rather than querying for\n\"{ edges { node } }\" when no edge data is needed, this field can be be used\ninstead. Note that when clients like Relay need to fetch the \"cursor\" field on\nthe edge to enable efficient pagination, this shortcut cannot be used, and the\nfull \"{ edges { node } }\" version should be used instead.", - ), + name: "locations", + description: None, args: [], ty: FieldType { - kind: List, + kind: NonNull, name: None, of_type: Some( FieldType { - kind: Object, - name: Some( - "Starship", + kind: List, + name: None, + of_type: Some( + FieldType { + kind: NonNull, + name: None, + of_type: Some( + FieldType { + kind: Enum, + name: Some( + "__DirectiveLocation", + ), + of_type: None, + }, + ), + }, ), - of_type: None, }, ), }, is_deprecated: false, deprecation_reason: None, }, - ], - ), - input_fields: None, - interfaces: Some( - [], - ), - enum_values: None, - possible_types: None, - specified_by_url: None, - }, - Type { - kind: Object, - name: Some( - "StarshipsEdge", - ), - description: Some( - "An edge in a connection.", - ), - fields: Some( - [ Field { - name: "node", - description: Some( - "The item at the end of the edge", - ), + name: "args", + description: None, args: [], ty: FieldType { - kind: Object, - name: Some( - "Starship", + kind: NonNull, + name: None, + of_type: Some( + FieldType { + kind: List, + name: None, + of_type: Some( + FieldType { + kind: NonNull, + name: None, + of_type: Some( + FieldType { + kind: Object, + name: Some( + "__InputValue", + ), + of_type: None, + }, + ), + }, + ), + }, ), - of_type: None, }, is_deprecated: false, deprecation_reason: None, }, Field { - name: "cursor", - description: Some( - "A cursor for use in pagination", - ), + name: "isRepeatable", + description: None, args: [], ty: FieldType { kind: NonNull, @@ -6746,7 +7041,7 @@ Some( FieldType { kind: Scalar, name: Some( - "String", + "Boolean", ), of_type: None, }, @@ -6766,138 +7061,188 @@ Some( specified_by_url: None, }, Type { - kind: Object, + kind: Enum, name: Some( - "VehiclesConnection", + "__DirectiveLocation", ), description: Some( - "A connection to a list of items.", + "A Directive can be adjacent to many parts of the GraphQL language, a\n__DirectiveLocation describes one such possible adjacencies.", ), - fields: Some( + fields: None, + input_fields: None, + interfaces: None, + enum_values: Some( [ - Field { - name: "pageInfo", + EnumValue { + name: "QUERY", + description: Some( + "Location adjacent to a query operation.", + ), + is_deprecated: false, + deprecation_reason: None, + }, + EnumValue { + name: "MUTATION", + description: Some( + "Location adjacent to a mutation operation.", + ), + is_deprecated: false, + deprecation_reason: None, + }, + EnumValue { + name: "SUBSCRIPTION", + description: Some( + "Location adjacent to a subscription operation.", + ), + is_deprecated: false, + deprecation_reason: None, + }, + EnumValue { + name: "FIELD", + description: Some( + "Location adjacent to a field.", + ), + is_deprecated: false, + deprecation_reason: None, + }, + EnumValue { + name: "FRAGMENT_DEFINITION", + description: Some( + "Location adjacent to a fragment definition.", + ), + is_deprecated: false, + deprecation_reason: None, + }, + EnumValue { + name: "FRAGMENT_SPREAD", + description: Some( + "Location adjacent to a fragment spread.", + ), + is_deprecated: false, + deprecation_reason: None, + }, + EnumValue { + name: "INLINE_FRAGMENT", + description: Some( + "Location adjacent to an inline fragment.", + ), + is_deprecated: false, + deprecation_reason: None, + }, + EnumValue { + name: "VARIABLE_DEFINITION", + description: Some( + "Location adjacent to a variable definition.", + ), + is_deprecated: false, + deprecation_reason: None, + }, + EnumValue { + name: "SCHEMA", + description: Some( + "Location adjacent to a schema definition.", + ), + is_deprecated: false, + deprecation_reason: None, + }, + EnumValue { + name: "SCALAR", + description: Some( + "Location adjacent to a scalar definition.", + ), + is_deprecated: false, + deprecation_reason: None, + }, + EnumValue { + name: "OBJECT", + description: Some( + "Location adjacent to an object type definition.", + ), + is_deprecated: false, + deprecation_reason: None, + }, + EnumValue { + name: "FIELD_DEFINITION", + description: Some( + "Location adjacent to a field definition.", + ), + is_deprecated: false, + deprecation_reason: None, + }, + EnumValue { + name: "ARGUMENT_DEFINITION", + description: Some( + "Location adjacent to an argument definition.", + ), + is_deprecated: false, + deprecation_reason: None, + }, + EnumValue { + name: "INTERFACE", + description: Some( + "Location adjacent to an interface definition.", + ), + is_deprecated: false, + deprecation_reason: None, + }, + EnumValue { + name: "UNION", description: Some( - "Information to aid in pagination.", + "Location adjacent to a union definition.", ), - args: [], - ty: FieldType { - kind: NonNull, - name: None, - of_type: Some( - FieldType { - kind: Object, - name: Some( - "PageInfo", - ), - of_type: None, - }, - ), - }, is_deprecated: false, deprecation_reason: None, }, - Field { - name: "edges", + EnumValue { + name: "ENUM", description: Some( - "A list of edges.", + "Location adjacent to an enum definition.", ), - args: [], - ty: FieldType { - kind: List, - name: None, - of_type: Some( - FieldType { - kind: Object, - name: Some( - "VehiclesEdge", - ), - of_type: None, - }, - ), - }, is_deprecated: false, deprecation_reason: None, }, - Field { - name: "totalCount", + EnumValue { + name: "ENUM_VALUE", description: Some( - "A count of the total number of objects in this connection, ignoring pagination.\nThis allows a client to fetch the first five objects by passing \"5\" as the\nargument to \"first\", then fetch the total count so it could display \"5 of 83\",\nfor example.", + "Location adjacent to an enum value definition.", ), - args: [], - ty: FieldType { - kind: Scalar, - name: Some( - "Int", - ), - of_type: None, - }, is_deprecated: false, deprecation_reason: None, }, - Field { - name: "vehicles", + EnumValue { + name: "INPUT_OBJECT", description: Some( - "A list of all of the objects returned in the connection. This is a convenience\nfield provided for quickly exploring the API; rather than querying for\n\"{ edges { node } }\" when no edge data is needed, this field can be be used\ninstead. Note that when clients like Relay need to fetch the \"cursor\" field on\nthe edge to enable efficient pagination, this shortcut cannot be used, and the\nfull \"{ edges { node } }\" version should be used instead.", + "Location adjacent to an input object type definition.", + ), + is_deprecated: false, + deprecation_reason: None, + }, + EnumValue { + name: "INPUT_FIELD_DEFINITION", + description: Some( + "Location adjacent to an input object field definition.", ), - args: [], - ty: FieldType { - kind: List, - name: None, - of_type: Some( - FieldType { - kind: Object, - name: Some( - "Vehicle", - ), - of_type: None, - }, - ), - }, is_deprecated: false, deprecation_reason: None, }, ], ), - input_fields: None, - interfaces: Some( - [], - ), - enum_values: None, possible_types: None, specified_by_url: None, }, Type { kind: Object, name: Some( - "VehiclesEdge", + "__EnumValue", ), description: Some( - "An edge in a connection.", + "One possible value for a given Enum. Enum values are unique values, not a\nplaceholder for a string or numeric value. However an Enum value is returned\nin a JSON response as a string.", ), fields: Some( [ Field { - name: "node", - description: Some( - "The item at the end of the edge", - ), - args: [], - ty: FieldType { - kind: Object, - name: Some( - "Vehicle", - ), - of_type: None, - }, - is_deprecated: false, - deprecation_reason: None, - }, - Field { - name: "cursor", - description: Some( - "A cursor for use in pagination", - ), + name: "name", + description: None, args: [], ty: FieldType { kind: NonNull, @@ -6915,74 +7260,32 @@ Some( is_deprecated: false, deprecation_reason: None, }, - ], - ), - input_fields: None, - interfaces: Some( - [], - ), - enum_values: None, - possible_types: None, - specified_by_url: None, - }, - Type { - kind: Object, - name: Some( - "__Schema", - ), - description: Some( - "A GraphQL Schema defines the capabilities of a GraphQL server. It exposes all available types and directives on the server, as well as the entry points for query, mutation, and subscription operations.", - ), - fields: Some( - [ Field { - name: "types", - description: Some( - "A list of all types supported by this server.", - ), + name: "description", + description: None, args: [], ty: FieldType { - kind: NonNull, - name: None, - of_type: Some( - FieldType { - kind: List, - name: None, - of_type: Some( - FieldType { - kind: NonNull, - name: None, - of_type: Some( - FieldType { - kind: Object, - name: Some( - "__Type", - ), - of_type: None, - }, - ), - }, - ), - }, + kind: Scalar, + name: Some( + "String", ), + of_type: None, }, is_deprecated: false, deprecation_reason: None, }, Field { - name: "queryType", - description: Some( - "The type that query operations will be rooted at.", - ), + name: "isDeprecated", + description: None, args: [], ty: FieldType { kind: NonNull, name: None, of_type: Some( FieldType { - kind: Object, + kind: Scalar, name: Some( - "__Type", + "Boolean", ), of_type: None, }, @@ -6992,71 +7295,19 @@ Some( deprecation_reason: None, }, Field { - name: "mutationType", - description: Some( - "If this server supports mutation, the type that mutation operations will be rooted at.", - ), - args: [], - ty: FieldType { - kind: Object, - name: Some( - "__Type", - ), - of_type: None, - }, - is_deprecated: false, - deprecation_reason: None, - }, - Field { - name: "subscriptionType", - description: Some( - "If this server support subscription, the type that subscription operations will be rooted at.", - ), + name: "deprecationReason", + description: None, args: [], ty: FieldType { - kind: Object, + kind: Scalar, name: Some( - "__Type", + "String", ), of_type: None, }, is_deprecated: false, deprecation_reason: None, }, - Field { - name: "directives", - description: Some( - "A list of all directives supported by this server.", - ), - args: [], - ty: FieldType { - kind: NonNull, - name: None, - of_type: Some( - FieldType { - kind: List, - name: None, - of_type: Some( - FieldType { - kind: NonNull, - name: None, - of_type: Some( - FieldType { - kind: Object, - name: Some( - "__Directive", - ), - of_type: None, - }, - ), - }, - ), - }, - ), - }, - is_deprecated: false, - deprecation_reason: None, - }, ], ), input_fields: None, @@ -7070,43 +7321,29 @@ Some( Type { kind: Object, name: Some( - "__Type", + "__Field", ), description: Some( - "The fundamental unit of any GraphQL Schema is the type. There are many kinds of types in GraphQL as represented by the `__TypeKind` enum.\n\nDepending on the kind of a type, certain fields describe information about that type. Scalar types provide no information beyond a name and description, while Enum types provide their values. Object and Interface types provide the fields they describe. Abstract types, Union and Interface, provide the Object types possible at runtime. List and NonNull types compose other types.", + "Object and Interface types are described by a list of Fields, each of which\nhas a name, potentially a list of arguments, and a return type.", ), fields: Some( [ Field { - name: "kind", + name: "name", description: None, args: [], ty: FieldType { kind: NonNull, name: None, - of_type: Some( - FieldType { - kind: Enum, - name: Some( - "__TypeKind", - ), - of_type: None, - }, - ), - }, - is_deprecated: false, - deprecation_reason: None, - }, - Field { - name: "name", - description: None, - args: [], - ty: FieldType { - kind: Scalar, - name: Some( - "String", + of_type: Some( + FieldType { + kind: Scalar, + name: Some( + "String", + ), + of_type: None, + }, ), - of_type: None, }, is_deprecated: false, deprecation_reason: None, @@ -7126,38 +7363,29 @@ Some( deprecation_reason: None, }, Field { - name: "fields", + name: "args", description: None, - args: [ - InputValue { - name: "includeDeprecated", - description: None, - ty: FieldType { - kind: Scalar, - name: Some( - "Boolean", - ), - of_type: None, - }, - default_value: Some( - "false", - ), - }, - ], + args: [], ty: FieldType { - kind: List, + kind: NonNull, name: None, of_type: Some( FieldType { - kind: NonNull, + kind: List, name: None, of_type: Some( FieldType { - kind: Object, - name: Some( - "__Field", + kind: NonNull, + name: None, + of_type: Some( + FieldType { + kind: Object, + name: Some( + "__InputValue", + ), + of_type: None, + }, ), - of_type: None, }, ), }, @@ -7167,25 +7395,19 @@ Some( deprecation_reason: None, }, Field { - name: "interfaces", + name: "type", description: None, args: [], ty: FieldType { - kind: List, + kind: NonNull, name: None, of_type: Some( FieldType { - kind: NonNull, - name: None, - of_type: Some( - FieldType { - kind: Object, - name: Some( - "__Type", - ), - of_type: None, - }, + kind: Object, + name: Some( + "__Type", ), + of_type: None, }, ), }, @@ -7193,106 +7415,33 @@ Some( deprecation_reason: None, }, Field { - name: "possibleTypes", + name: "isDeprecated", description: None, args: [], ty: FieldType { - kind: List, + kind: NonNull, name: None, of_type: Some( FieldType { - kind: NonNull, - name: None, - of_type: Some( - FieldType { - kind: Object, - name: Some( - "__Type", - ), - of_type: None, - }, - ), - }, - ), - }, - is_deprecated: false, - deprecation_reason: None, - }, - Field { - name: "enumValues", - description: None, - args: [ - InputValue { - name: "includeDeprecated", - description: None, - ty: FieldType { kind: Scalar, name: Some( "Boolean", ), of_type: None, }, - default_value: Some( - "false", - ), - }, - ], - ty: FieldType { - kind: List, - name: None, - of_type: Some( - FieldType { - kind: NonNull, - name: None, - of_type: Some( - FieldType { - kind: Object, - name: Some( - "__EnumValue", - ), - of_type: None, - }, - ), - }, - ), - }, - is_deprecated: false, - deprecation_reason: None, - }, - Field { - name: "inputFields", - description: None, - args: [], - ty: FieldType { - kind: List, - name: None, - of_type: Some( - FieldType { - kind: NonNull, - name: None, - of_type: Some( - FieldType { - kind: Object, - name: Some( - "__InputValue", - ), - of_type: None, - }, - ), - }, ), }, is_deprecated: false, deprecation_reason: None, }, Field { - name: "ofType", + name: "deprecationReason", description: None, args: [], ty: FieldType { - kind: Object, + kind: Scalar, name: Some( - "__Type", + "String", ), of_type: None, }, @@ -7310,99 +7459,51 @@ Some( specified_by_url: None, }, Type { - kind: Enum, + kind: Object, name: Some( - "__TypeKind", + "__InputValue", ), description: Some( - "An enum describing what kind of type a given `__Type` is.", + "Arguments provided to Fields or Directives and the input fields of an\nInputObject are represented as Input Values which describe their type and\noptionally a default value.", ), - fields: None, - input_fields: None, - interfaces: None, - enum_values: Some( + fields: Some( [ - EnumValue { - name: "SCALAR", - description: Some( - "Indicates this type is a scalar.", - ), - is_deprecated: false, - deprecation_reason: None, - }, - EnumValue { - name: "OBJECT", - description: Some( - "Indicates this type is an object. `fields` and `interfaces` are valid fields.", - ), - is_deprecated: false, - deprecation_reason: None, - }, - EnumValue { - name: "INTERFACE", - description: Some( - "Indicates this type is an interface. `fields` and `possibleTypes` are valid fields.", - ), - is_deprecated: false, - deprecation_reason: None, - }, - EnumValue { - name: "UNION", - description: Some( - "Indicates this type is a union. `possibleTypes` is a valid field.", - ), - is_deprecated: false, - deprecation_reason: None, - }, - EnumValue { - name: "ENUM", - description: Some( - "Indicates this type is an enum. `enumValues` is a valid field.", - ), - is_deprecated: false, - deprecation_reason: None, - }, - EnumValue { - name: "INPUT_OBJECT", - description: Some( - "Indicates this type is an input object. `inputFields` is a valid field.", - ), - is_deprecated: false, - deprecation_reason: None, - }, - EnumValue { - name: "LIST", - description: Some( - "Indicates this type is a list. `ofType` is a valid field.", - ), + Field { + name: "name", + description: None, + args: [], + ty: FieldType { + kind: NonNull, + name: None, + of_type: Some( + FieldType { + kind: Scalar, + name: Some( + "String", + ), + of_type: None, + }, + ), + }, is_deprecated: false, deprecation_reason: None, }, - EnumValue { - name: "NON_NULL", - description: Some( - "Indicates this type is a non-null. `ofType` is a valid field.", - ), + Field { + name: "description", + description: None, + args: [], + ty: FieldType { + kind: Scalar, + name: Some( + "String", + ), + of_type: None, + }, is_deprecated: false, deprecation_reason: None, }, - ], - ), - possible_types: None, - specified_by_url: None, - }, - Type { - kind: Object, - name: Some( - "__Field", - ), - description: Some( - "Object and Interface types are described by a list of Fields, each of which has a name, potentially a list of arguments, and a return type.", - ), - fields: Some( - [ Field { - name: "name", + name: "type", description: None, args: [], ty: FieldType { @@ -7410,9 +7511,9 @@ Some( name: None, of_type: Some( FieldType { - kind: Scalar, + kind: Object, name: Some( - "String", + "__Type", ), of_type: None, }, @@ -7422,7 +7523,7 @@ Some( deprecation_reason: None, }, Field { - name: "description", + name: "defaultValue", description: None, args: [], ty: FieldType { @@ -7435,9 +7536,31 @@ Some( is_deprecated: false, deprecation_reason: None, }, + ], + ), + input_fields: None, + interfaces: Some( + [], + ), + enum_values: None, + possible_types: None, + specified_by_url: None, + }, + Type { + kind: Object, + name: Some( + "__Schema", + ), + description: Some( + "A GraphQL Schema defines the capabilities of a GraphQL server. It exposes\nall available types and directives on the server, as well as the entry\npoints for query, mutation, and subscription operations.", + ), + fields: Some( + [ Field { - name: "args", - description: None, + name: "types", + description: Some( + "A list of all types supported by this server.", + ), args: [], ty: FieldType { kind: NonNull, @@ -7454,7 +7577,7 @@ Some( FieldType { kind: Object, name: Some( - "__InputValue", + "__Type", ), of_type: None, }, @@ -7468,8 +7591,10 @@ Some( deprecation_reason: None, }, Field { - name: "type", - description: None, + name: "queryType", + description: Some( + "The type that query operations will be rooted at.", + ), args: [], ty: FieldType { kind: NonNull, @@ -7488,39 +7613,71 @@ Some( deprecation_reason: None, }, Field { - name: "isDeprecated", - description: None, + name: "mutationType", + description: Some( + "If this server supports mutation, the type that mutation operations will\nbe rooted at.", + ), args: [], ty: FieldType { - kind: NonNull, - name: None, - of_type: Some( - FieldType { - kind: Scalar, - name: Some( - "Boolean", - ), - of_type: None, - }, + kind: Object, + name: Some( + "__Type", ), + of_type: None, }, is_deprecated: false, deprecation_reason: None, }, Field { - name: "deprecationReason", - description: None, + name: "subscriptionType", + description: Some( + "If this server support subscription, the type that subscription\noperations will be rooted at.", + ), args: [], ty: FieldType { - kind: Scalar, + kind: Object, name: Some( - "String", + "__Type", ), of_type: None, }, is_deprecated: false, deprecation_reason: None, }, + Field { + name: "directives", + description: Some( + "A list of all directives supported by this server.", + ), + args: [], + ty: FieldType { + kind: NonNull, + name: None, + of_type: Some( + FieldType { + kind: List, + name: None, + of_type: Some( + FieldType { + kind: NonNull, + name: None, + of_type: Some( + FieldType { + kind: Object, + name: Some( + "__Directive", + ), + of_type: None, + }, + ), + }, + ), + }, + ), + }, + is_deprecated: false, + deprecation_reason: None, + }, ], ), input_fields: None, @@ -7534,15 +7691,15 @@ Some( Type { kind: Object, name: Some( - "__InputValue", + "__Type", ), description: Some( - "Arguments provided to Fields or Directives and the input fields of an InputObject are represented as Input Values which describe their type and optionally a default value.", + "The fundamental unit of any GraphQL Schema is the type. There are many kinds\nof types in GraphQL as represented by the `__TypeKind` enum.\n\nDepending on the kind of a type, certain fields describe information about\nthat type. Scalar types provide no information beyond a name and\ndescription, while Enum types provide their values. Object and Interface\ntypes provide the fields they describe. Abstract types, Union and Interface,\nprovide the Object types possible at runtime. List and NonNull types compose\nother types.", ), fields: Some( [ Field { - name: "name", + name: "kind", description: None, args: [], ty: FieldType { @@ -7550,9 +7707,9 @@ Some( name: None, of_type: Some( FieldType { - kind: Scalar, + kind: Enum, name: Some( - "String", + "__TypeKind", ), of_type: None, }, @@ -7562,7 +7719,7 @@ Some( deprecation_reason: None, }, Field { - name: "description", + name: "name", description: None, args: [], ty: FieldType { @@ -7576,75 +7733,86 @@ Some( deprecation_reason: None, }, Field { - name: "type", + name: "description", description: None, args: [], ty: FieldType { - kind: NonNull, - name: None, - of_type: Some( - FieldType { - kind: Object, - name: Some( - "__Type", - ), - of_type: None, - }, + kind: Scalar, + name: Some( + "String", ), + of_type: None, }, is_deprecated: false, deprecation_reason: None, }, Field { - name: "defaultValue", - description: Some( - "A GraphQL-formatted string representing the default value for this input value.", - ), - args: [], + name: "fields", + description: None, + args: [ + InputValue { + name: "includeDeprecated", + description: None, + ty: FieldType { + kind: NonNull, + name: None, + of_type: Some( + FieldType { + kind: Scalar, + name: Some( + "Boolean", + ), + of_type: None, + }, + ), + }, + default_value: Some( + "false", + ), + }, + ], ty: FieldType { - kind: Scalar, - name: Some( - "String", + kind: List, + name: None, + of_type: Some( + FieldType { + kind: NonNull, + name: None, + of_type: Some( + FieldType { + kind: Object, + name: Some( + "__Field", + ), + of_type: None, + }, + ), + }, ), - of_type: None, }, is_deprecated: false, deprecation_reason: None, }, - ], - ), - input_fields: None, - interfaces: Some( - [], - ), - enum_values: None, - possible_types: None, - specified_by_url: None, - }, - Type { - kind: Object, - name: Some( - "__EnumValue", - ), - description: Some( - "One possible value for a given Enum. Enum values are unique values, not a placeholder for a string or numeric value. However an Enum value is returned in a JSON response as a string.", - ), - fields: Some( - [ Field { - name: "name", + name: "interfaces", description: None, args: [], ty: FieldType { - kind: NonNull, + kind: List, name: None, of_type: Some( FieldType { - kind: Scalar, - name: Some( - "String", + kind: NonNull, + name: None, + of_type: Some( + FieldType { + kind: Object, + name: Some( + "__Type", + ), + of_type: None, + }, ), - of_type: None, }, ), }, @@ -7652,33 +7820,72 @@ Some( deprecation_reason: None, }, Field { - name: "description", + name: "possibleTypes", description: None, args: [], ty: FieldType { - kind: Scalar, - name: Some( - "String", + kind: List, + name: None, + of_type: Some( + FieldType { + kind: NonNull, + name: None, + of_type: Some( + FieldType { + kind: Object, + name: Some( + "__Type", + ), + of_type: None, + }, + ), + }, ), - of_type: None, }, is_deprecated: false, deprecation_reason: None, }, Field { - name: "isDeprecated", + name: "enumValues", description: None, - args: [], + args: [ + InputValue { + name: "includeDeprecated", + description: None, + ty: FieldType { + kind: NonNull, + name: None, + of_type: Some( + FieldType { + kind: Scalar, + name: Some( + "Boolean", + ), + of_type: None, + }, + ), + }, + default_value: Some( + "false", + ), + }, + ], ty: FieldType { - kind: NonNull, + kind: List, name: None, of_type: Some( FieldType { - kind: Scalar, - name: Some( - "Boolean", + kind: NonNull, + name: None, + of_type: Some( + FieldType { + kind: Object, + name: Some( + "__EnumValue", + ), + of_type: None, + }, ), - of_type: None, }, ), }, @@ -7686,53 +7893,25 @@ Some( deprecation_reason: None, }, Field { - name: "deprecationReason", - description: None, - args: [], - ty: FieldType { - kind: Scalar, - name: Some( - "String", - ), - of_type: None, - }, - is_deprecated: false, - deprecation_reason: None, - }, - ], - ), - input_fields: None, - interfaces: Some( - [], - ), - enum_values: None, - possible_types: None, - specified_by_url: None, - }, - Type { - kind: Object, - name: Some( - "__Directive", - ), - description: Some( - "A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document.\n\nIn some cases, you need to provide options to alter GraphQL's execution behavior in ways field arguments will not suffice, such as conditionally including or skipping a field. Directives provide this by describing additional information to the executor.", - ), - fields: Some( - [ - Field { - name: "name", + name: "inputFields", description: None, args: [], ty: FieldType { - kind: NonNull, + kind: List, name: None, of_type: Some( FieldType { - kind: Scalar, - name: Some( - "String", + kind: NonNull, + name: None, + of_type: Some( + FieldType { + kind: Object, + name: Some( + "__InputValue", + ), + of_type: None, + }, ), - of_type: None, }, ), }, @@ -7740,13 +7919,13 @@ Some( deprecation_reason: None, }, Field { - name: "description", + name: "ofType", description: None, args: [], ty: FieldType { - kind: Scalar, + kind: Object, name: Some( - "String", + "__Type", ), of_type: None, }, @@ -7754,65 +7933,29 @@ Some( deprecation_reason: None, }, Field { - name: "locations", + name: "specifiedByURL", description: None, args: [], ty: FieldType { - kind: NonNull, - name: None, - of_type: Some( - FieldType { - kind: List, - name: None, - of_type: Some( - FieldType { - kind: NonNull, - name: None, - of_type: Some( - FieldType { - kind: Enum, - name: Some( - "__DirectiveLocation", - ), - of_type: None, - }, - ), - }, - ), - }, + kind: Scalar, + name: Some( + "String", ), + of_type: None, }, is_deprecated: false, deprecation_reason: None, }, Field { - name: "args", + name: "isOneOf", description: None, args: [], ty: FieldType { - kind: NonNull, - name: None, - of_type: Some( - FieldType { - kind: List, - name: None, - of_type: Some( - FieldType { - kind: NonNull, - name: None, - of_type: Some( - FieldType { - kind: Object, - name: Some( - "__InputValue", - ), - of_type: None, - }, - ), - }, - ), - }, + kind: Scalar, + name: Some( + "Boolean", ), + of_type: None, }, is_deprecated: false, deprecation_reason: None, @@ -7830,92 +7973,20 @@ Some( Type { kind: Enum, name: Some( - "__DirectiveLocation", + "__TypeKind", ), description: Some( - "A Directive can be adjacent to many parts of the GraphQL language, a __DirectiveLocation describes one such possible adjacencies.", + "An enum describing what kind of type a given `__Type` is.", ), fields: None, input_fields: None, interfaces: None, enum_values: Some( [ - EnumValue { - name: "QUERY", - description: Some( - "Location adjacent to a query operation.", - ), - is_deprecated: false, - deprecation_reason: None, - }, - EnumValue { - name: "MUTATION", - description: Some( - "Location adjacent to a mutation operation.", - ), - is_deprecated: false, - deprecation_reason: None, - }, - EnumValue { - name: "SUBSCRIPTION", - description: Some( - "Location adjacent to a subscription operation.", - ), - is_deprecated: false, - deprecation_reason: None, - }, - EnumValue { - name: "FIELD", - description: Some( - "Location adjacent to a field.", - ), - is_deprecated: false, - deprecation_reason: None, - }, - EnumValue { - name: "FRAGMENT_DEFINITION", - description: Some( - "Location adjacent to a fragment definition.", - ), - is_deprecated: false, - deprecation_reason: None, - }, - EnumValue { - name: "FRAGMENT_SPREAD", - description: Some( - "Location adjacent to a fragment spread.", - ), - is_deprecated: false, - deprecation_reason: None, - }, - EnumValue { - name: "INLINE_FRAGMENT", - description: Some( - "Location adjacent to an inline fragment.", - ), - is_deprecated: false, - deprecation_reason: None, - }, - EnumValue { - name: "VARIABLE_DEFINITION", - description: Some( - "Location adjacent to a variable definition.", - ), - is_deprecated: false, - deprecation_reason: None, - }, - EnumValue { - name: "SCHEMA", - description: Some( - "Location adjacent to a schema definition.", - ), - is_deprecated: false, - deprecation_reason: None, - }, EnumValue { name: "SCALAR", description: Some( - "Location adjacent to a scalar definition.", + "Indicates this type is a scalar.", ), is_deprecated: false, deprecation_reason: None, @@ -7923,23 +7994,7 @@ Some( EnumValue { name: "OBJECT", description: Some( - "Location adjacent to an object type definition.", - ), - is_deprecated: false, - deprecation_reason: None, - }, - EnumValue { - name: "FIELD_DEFINITION", - description: Some( - "Location adjacent to a field definition.", - ), - is_deprecated: false, - deprecation_reason: None, - }, - EnumValue { - name: "ARGUMENT_DEFINITION", - description: Some( - "Location adjacent to an argument definition.", + "Indicates this type is an object. `fields` and `interfaces` are valid\nfields.", ), is_deprecated: false, deprecation_reason: None, @@ -7947,7 +8002,7 @@ Some( EnumValue { name: "INTERFACE", description: Some( - "Location adjacent to an interface definition.", + "Indicates this type is an interface. `fields` and `possibleTypes` are\nvalid fields.", ), is_deprecated: false, deprecation_reason: None, @@ -7955,7 +8010,7 @@ Some( EnumValue { name: "UNION", description: Some( - "Location adjacent to a union definition.", + "Indicates this type is a union. `possibleTypes` is a valid field.", ), is_deprecated: false, deprecation_reason: None, @@ -7963,31 +8018,31 @@ Some( EnumValue { name: "ENUM", description: Some( - "Location adjacent to an enum definition.", + "Indicates this type is an enum. `enumValues` is a valid field.", ), is_deprecated: false, deprecation_reason: None, }, EnumValue { - name: "ENUM_VALUE", + name: "INPUT_OBJECT", description: Some( - "Location adjacent to an enum value definition.", + "Indicates this type is an input object. `inputFields` is a valid field.", ), is_deprecated: false, deprecation_reason: None, }, EnumValue { - name: "INPUT_OBJECT", + name: "LIST", description: Some( - "Location adjacent to an input object type definition.", + "Indicates this type is a list. `ofType` is a valid field.", ), is_deprecated: false, deprecation_reason: None, }, EnumValue { - name: "INPUT_FIELD_DEFINITION", + name: "NON_NULL", description: Some( - "Location adjacent to an input object field definition.", + "Indicates this type is a non-null. `ofType` is a valid field.", ), is_deprecated: false, deprecation_reason: None, @@ -8065,34 +8120,6 @@ Some( InlineFragment, ], }, - Directive { - name: "deprecated", - description: Some( - "Marks an element of a GraphQL schema as no longer supported.", - ), - args: [ - InputValue { - name: "reason", - description: Some( - "Explains why this element was deprecated, usually also including a suggestion for how to access supported similar data. Formatted using the Markdown syntax (as specified by [CommonMark](https://commonmark.org/).", - ), - ty: FieldType { - kind: Scalar, - name: Some( - "String", - ), - of_type: None, - }, - default_value: Some( - "\"No longer supported\"", - ), - }, - ], - locations: [ - FieldDefinition, - EnumValue, - ], - }, ], }, ), diff --git a/cynic-introspection/tests/tests.rs b/cynic-introspection/tests/tests.rs index 71005ef5a..d8f86c3ac 100644 --- a/cynic-introspection/tests/tests.rs +++ b/cynic-introspection/tests/tests.rs @@ -1,5 +1,6 @@ -use cynic::GraphQlResponse; +use cynic::{http::ReqwestExt, GraphQlResponse}; use cynic_introspection::{query::IntrospectionQuery, SchemaError, SpecificationVersion}; +use graphql_mocks::mocks; use serde_json::json; #[test] @@ -13,15 +14,16 @@ fn build_2018_query() -> cynic::Operation { IntrospectionQuery::build(()) } -#[test] -fn test_running_2018_query() { - use cynic::http::ReqwestBlockingExt; +#[tokio::test] +async fn test_running_2018_query() { + let mock_server = mocks::swapi::serve().await; let query = build_2018_query(); - let result = reqwest::blocking::Client::new() - .post("https://swapi-graphql.netlify.app/.netlify/functions/index") + let result = reqwest::Client::new() + .post(mock_server.url()) .run_graphql(query) + .await .unwrap(); if result.errors.is_some() { @@ -31,15 +33,16 @@ fn test_running_2018_query() { insta::assert_debug_snapshot!(result.data); } -#[test] -fn test_2018_schema_conversion() { - use cynic::http::ReqwestBlockingExt; +#[tokio::test] +async fn test_2018_schema_conversion() { + let mock_server = mocks::swapi::serve().await; let query = build_2018_query(); - let result = reqwest::blocking::Client::new() - .post("https://swapi-graphql.netlify.app/.netlify/functions/index") + let result = reqwest::Client::new() + .post(mock_server.url()) .run_graphql(query) + .await .unwrap(); if result.errors.is_some() { diff --git a/examples/Cargo.toml b/examples/Cargo.toml index a65b20b42..df98050f3 100644 --- a/examples/Cargo.toml +++ b/examples/Cargo.toml @@ -28,5 +28,8 @@ github-schema = { path = "../schemas/github" } [dev-dependencies] insta = "1.17" -[build-dependencies] +# Used for the mock starwars API used by some of the examples +graphql-mocks.workspace = true + +[build-dependencies] # Required to fake the Swapi server used in most of these tests cynic-codegen = { path = "../cynic-codegen" } diff --git a/examples/examples/manual-reqwest.rs b/examples/examples/manual-reqwest.rs index 11ac5b26d..d076f7cfd 100644 --- a/examples/examples/manual-reqwest.rs +++ b/examples/examples/manual-reqwest.rs @@ -24,7 +24,7 @@ struct FilmDirectorQuery { } fn main() { - match run_query().data { + match run_query("https://swapi-graphql.netlify.app/.netlify/functions/index").data { Some(FilmDirectorQuery { film: Some(film) }) => { println!("{:?} was directed by {:?}", film.title, film.director) } @@ -34,11 +34,11 @@ fn main() { } } -fn run_query() -> cynic::GraphQlResponse { +fn run_query(url: &str) -> cynic::GraphQlResponse { let query = build_query(); let response = reqwest::blocking::Client::new() - .post("https://swapi-graphql.netlify.app/.netlify/functions/index") + .post(url) .json(&query) .send() .unwrap(); @@ -56,6 +56,8 @@ fn build_query() -> cynic::Operation { #[cfg(test)] mod test { + use tokio::task::spawn_blocking; + use super::*; #[test] @@ -69,9 +71,14 @@ mod test { insta::assert_snapshot!(query.query); } - #[test] - fn test_running_query() { - let result = run_query(); + #[tokio::test] + async fn test_running_query() { + let mock_server = graphql_mocks::mocks::swapi::serve().await; + + let result = spawn_blocking(move || run_query(&mock_server.url().to_string())) + .await + .unwrap(); + if result.errors.is_some() { assert_eq!(result.errors.unwrap().len(), 0); } diff --git a/examples/examples/querying-interfaces.rs b/examples/examples/querying-interfaces.rs index a27224490..0249f08bc 100644 --- a/examples/examples/querying-interfaces.rs +++ b/examples/examples/querying-interfaces.rs @@ -43,7 +43,12 @@ struct Query { } fn main() { - match run_query("ZmlsbXM6MQ==".into()).data { + match run_query( + "https://swapi-graphql.netlify.app/.netlify/functions/index", + "ZmlsbXM6MQ==".into(), + ) + .data + { Some(Query { node: Some(Node::Planet(planet)), }) => { @@ -65,13 +70,13 @@ fn main() { } } -fn run_query(id: cynic::Id) -> cynic::GraphQlResponse { +fn run_query(url: &str, id: cynic::Id) -> cynic::GraphQlResponse { use cynic::http::ReqwestBlockingExt; let query = build_query(id); reqwest::blocking::Client::new() - .post("https://swapi-graphql.netlify.app/.netlify/functions/index") + .post(url) .run_graphql(query) .unwrap() } @@ -84,6 +89,8 @@ fn build_query(id: cynic::Id) -> cynic::Operation { #[cfg(test)] mod test { + use tokio::task::spawn_blocking; + use super::*; #[test] @@ -97,29 +104,65 @@ mod test { insta::assert_snapshot!(query.query); } - #[test] - fn test_running_query_with_film() { - let result = run_query("ZmlsbXM6MQ==".into()); + #[tokio::test] + async fn test_running_query_with_film() { + let mock_server = graphql_mocks::mocks::swapi::serve().await; + + let result = spawn_blocking(move || { + run_query(&mock_server.url().to_string(), "ZmlsbXM6MQ==".into()) + }) + .await + .unwrap(); + if result.errors.is_some() { - assert_eq!(result.errors.unwrap().len(), 0); + assert_eq!( + result.errors.as_ref().unwrap().len(), + 0, + "Server Errored: {:?}", + result.errors + ); } insta::assert_debug_snapshot!(result.data); } - #[test] - fn test_running_query_with_planet() { - let result = run_query("cGxhbmV0czo0OQ==".into()); + #[tokio::test] + async fn test_running_query_with_planet() { + let mock_server = graphql_mocks::mocks::swapi::serve().await; + + let result = spawn_blocking(move || { + run_query(&mock_server.url().to_string(), "cGxhbmV0czo0OQ==".into()) + }) + .await + .unwrap(); + if result.errors.is_some() { - assert_eq!(result.errors.unwrap().len(), 0); + assert_eq!( + result.errors.as_ref().unwrap().len(), + 0, + "Server Errored: {:?}", + result.errors + ); } insta::assert_debug_snapshot!(result.data); } - #[test] - fn test_running_query_with_starship() { - let result = run_query("c3RhcnNoaXBzOjY1".into()); + #[tokio::test] + async fn test_running_query_with_starship() { + let mock_server = graphql_mocks::mocks::swapi::serve().await; + + let result = spawn_blocking(move || { + run_query(&mock_server.url().to_string(), "c3RhcnNoaXBzOjY1".into()) + }) + .await + .unwrap(); + if result.errors.is_some() { - assert_eq!(result.errors.unwrap().len(), 0); + assert_eq!( + result.errors.as_ref().unwrap().len(), + 0, + "Server Errored: {:?}", + result.errors + ); } insta::assert_debug_snapshot!(result.data); } diff --git a/examples/examples/reqwest-async.rs b/examples/examples/reqwest-async.rs index b0b6de085..4136f5d59 100644 --- a/examples/examples/reqwest-async.rs +++ b/examples/examples/reqwest-async.rs @@ -27,7 +27,10 @@ struct FilmDirectorQuery { #[tokio::main] async fn main() { - match run_query().await.data { + match run_query("https://swapi-graphql.netlify.app/.netlify/functions/index") + .await + .data + { Some(FilmDirectorQuery { film: Some(film) }) => { println!("{:?} was directed by {:?}", film.title, film.director) } @@ -37,13 +40,13 @@ async fn main() { } } -async fn run_query() -> cynic::GraphQlResponse { +async fn run_query(url: &str) -> cynic::GraphQlResponse { use cynic::http::ReqwestExt; let query = build_query(); reqwest::Client::new() - .post("https://swapi-graphql.netlify.app/.netlify/functions/index") + .post(url) .run_graphql(query) .await .unwrap() @@ -74,7 +77,9 @@ mod test { #[tokio::test] async fn test_running_query() { - let result = run_query().await; + let mock_server = graphql_mocks::mocks::swapi::serve().await; + + let result = run_query(&mock_server.url().to_string()).await; if result.errors.is_some() { assert_eq!(result.errors.unwrap().len(), 0); } diff --git a/examples/examples/spread.rs b/examples/examples/spread.rs index d48dad4b4..ac5e4b0ac 100644 --- a/examples/examples/spread.rs +++ b/examples/examples/spread.rs @@ -40,7 +40,7 @@ struct FilmDirectorQuery { } fn main() { - match run_query().data { + match run_query("https://swapi-graphql.netlify.app/.netlify/functions/index").data { Some(FilmDirectorQuery { film: Some(film) }) => { println!("Id: {:?}", film.id); println!( @@ -56,13 +56,13 @@ fn main() { } } -fn run_query() -> cynic::GraphQlResponse { +fn run_query(url: &str) -> cynic::GraphQlResponse { use cynic::http::ReqwestBlockingExt; let query = build_query(); reqwest::blocking::Client::new() - .post("https://swapi-graphql.netlify.app/.netlify/functions/index") + .post(url) .run_graphql(query) .unwrap() } @@ -77,6 +77,8 @@ fn build_query() -> cynic::Operation { #[cfg(test)] mod test { + use tokio::task::spawn_blocking; + use super::*; #[test] @@ -90,11 +92,21 @@ mod test { insta::assert_snapshot!(query.query); } - #[test] - fn test_running_query() { - let result = run_query(); + #[tokio::test] + async fn test_running_query() { + let mock_server = graphql_mocks::mocks::swapi::serve().await; + + let result = spawn_blocking(move || run_query(&mock_server.url().to_string())) + .await + .unwrap(); + if result.errors.is_some() { - assert_eq!(result.errors.unwrap().len(), 0); + assert_eq!( + result.errors.as_ref().unwrap().len(), + 0, + "Server Errored: {:?}", + result.errors + ); } insta::assert_debug_snapshot!(result.data); } diff --git a/examples/examples/starwars.rs b/examples/examples/starwars.rs index e3356b6c7..1e3ec4e11 100644 --- a/examples/examples/starwars.rs +++ b/examples/examples/starwars.rs @@ -23,7 +23,7 @@ struct FilmDirectorQuery { } fn main() { - match run_query().data { + match run_query("https://swapi-graphql.netlify.app/.netlify/functions/index").data { Some(FilmDirectorQuery { film: Some(film) }) => { println!("{:?} was directed by {:?}", film.title, film.director) } @@ -33,13 +33,13 @@ fn main() { } } -fn run_query() -> cynic::GraphQlResponse { +fn run_query(url: &str) -> cynic::GraphQlResponse { use cynic::http::ReqwestBlockingExt; let query = build_query(); reqwest::blocking::Client::new() - .post("https://swapi-graphql.netlify.app/.netlify/functions/index") + .post(url) .run_graphql(query) .unwrap() } @@ -54,6 +54,8 @@ fn build_query() -> cynic::Operation { #[cfg(test)] mod test { + use tokio::task::spawn_blocking; + use super::*; #[test] @@ -67,11 +69,21 @@ mod test { insta::assert_snapshot!(query.query); } - #[test] - fn test_running_query() { - let result = run_query(); + #[tokio::test] + async fn test_running_query() { + let mock_server = graphql_mocks::mocks::swapi::serve().await; + + let result = spawn_blocking(move || run_query(&mock_server.url().to_string())) + .await + .unwrap(); + if result.errors.is_some() { - assert_eq!(result.errors.unwrap().len(), 0); + assert_eq!( + result.errors.as_ref().unwrap().len(), + 0, + "Server Errored: {:?}", + result.errors + ); } insta::assert_debug_snapshot!(result.data); } diff --git a/examples/examples/surf-client.rs b/examples/examples/surf-client.rs index 0ad2abba3..cd06de340 100644 --- a/examples/examples/surf-client.rs +++ b/examples/examples/surf-client.rs @@ -27,7 +27,10 @@ struct FilmDirectorQuery { fn main() { async_std::task::block_on(async { - match run_query().await.data { + match run_query("https://swapi-graphql.netlify.app/.netlify/functions/index") + .await + .data + { Some(FilmDirectorQuery { film: Some(film) }) => { println!("{:?} was directed by {:?}", film.title, film.director) } @@ -38,15 +41,12 @@ fn main() { }) } -async fn run_query() -> cynic::GraphQlResponse { +async fn run_query(url: &str) -> cynic::GraphQlResponse { use cynic::http::SurfExt; let operation = build_query(); - surf::post("https://swapi-graphql.netlify.app/.netlify/functions/index") - .run_graphql(operation) - .await - .unwrap() + surf::post(url).run_graphql(operation).await.unwrap() } fn build_query() -> cynic::Operation { diff --git a/graphql-mocks/Cargo.toml b/graphql-mocks/Cargo.toml new file mode 100644 index 000000000..177b34cc5 --- /dev/null +++ b/graphql-mocks/Cargo.toml @@ -0,0 +1,22 @@ +[package] +name = "graphql-mocks" +publish = false +edition.workspace = true + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +async-graphql-axum = "7" +async-graphql = { version = "7", features = ["dynamic-schema"] } +async-trait = "0.1" +axum = "0.7" +cynic-parser.workspace = true +cynic-parser.features = ["report"] +futures-lite = "2" +headers = "0.4" +serde = "1" +serde_json = "1" +tokio = "1" +crossbeam-queue = "0.3" +http = "1" +url = "2" diff --git a/graphql-mocks/src/dynamic/builder.rs b/graphql-mocks/src/dynamic/builder.rs new file mode 100644 index 000000000..599141547 --- /dev/null +++ b/graphql-mocks/src/dynamic/builder.rs @@ -0,0 +1,357 @@ +#![allow(clippy::panic)] + +use std::collections::HashMap; + +use async_graphql::dynamic::{FieldValue, ResolverContext}; +use cynic_parser::{common::WrappingType, type_system as parser}; +use serde::Deserialize; + +use crate::{MockGraphQlServer, MockGraphQlServerBuilder}; + +use super::{resolvers::Resolver, DynamicSchema}; + +pub struct DynamicSchemaBuilder { + sdl: String, + field_resolvers: ResolverMap, +} + +type ResolverMap = HashMap<(String, String), Box>; + +impl DynamicSchemaBuilder { + pub fn new(sdl: &str) -> Self { + DynamicSchemaBuilder { + sdl: sdl.into(), + field_resolvers: Default::default(), + } + } + + pub fn with_resolver( + mut self, + ty: &str, + field: &str, + resolver: impl Resolver + 'static, + ) -> Self { + self.field_resolvers + .insert((ty.into(), field.into()), Box::new(resolver)); + self + } + + pub fn into_server_builder(self) -> MockGraphQlServerBuilder { + let Self { + sdl, + mut field_resolvers, + } = self; + + let schema = cynic_parser::parse_type_system_document(&sdl) + .map_err(|e| e.to_report(&sdl)) + .expect("a valid document"); + + let mut builder = schema_builder(&schema); + + for definition in schema.definitions() { + match definition { + parser::Definition::Type(def) => { + builder = builder.register(convert_type(def, &mut field_resolvers)); + } + parser::Definition::TypeExtension(_) => { + unimplemented!("this is just for tests, extensions aren't supported") + } + _ => {} + } + } + + let schema = builder.finish().unwrap(); + + MockGraphQlServer::builder(DynamicSchema { schema, sdl }) + } +} + +fn convert_type( + def: parser::TypeDefinition<'_>, + resolvers: &mut ResolverMap, +) -> async_graphql::dynamic::Type { + match def { + parser::TypeDefinition::Scalar(def) => { + async_graphql::dynamic::Scalar::new(def.name()).into() + } + parser::TypeDefinition::Object(def) => convert_object(def, resolvers), + parser::TypeDefinition::Interface(def) => convert_iface(def), + parser::TypeDefinition::Union(def) => convert_union(def), + parser::TypeDefinition::Enum(def) => convert_enum(def), + parser::TypeDefinition::InputObject(def) => convert_input_object(def), + } +} + +fn convert_object( + def: parser::ObjectDefinition<'_>, + resolvers: &mut ResolverMap, +) -> async_graphql::dynamic::Type { + use async_graphql::dynamic::*; + + let mut object = Object::new(def.name()); + + if let Some(description) = def.description() { + object = object.description(description.to_cow()); + } + + for name in def.implements_interfaces() { + object = object.implement(name); + } + + for field_def in def.fields() { + let type_ref = convert_type_ref(field_def.ty()); + let resolver = std::sync::Mutex::new( + resolvers + .remove(&(def.name().into(), field_def.name().into())) + .unwrap_or_else(|| Box::new(default_field_resolver(field_def.name()))), + ); + + let mut field = Field::new(field_def.name(), type_ref, move |context| { + let mut resolver = resolver.lock().expect("mutex to be unpoisoned"); + FieldFuture::Value(resolver.resolve(context).map(|value| { + let value = async_graphql::Value::deserialize(value).unwrap(); + transform_into_field_value(value) + })) + }); + + if let Some(description) = field_def.description() { + field = field.description(description.to_cow()); + } + + for argument in field_def.arguments() { + field = field.argument(convert_input_value(argument)); + } + + object = object.field(field); + } + + object.into() +} + +fn transform_into_field_value(mut value: async_graphql::Value) -> FieldValue<'static> { + match value { + async_graphql::Value::Object(ref mut fields) => { + if let Some(async_graphql::Value::String(ty)) = fields.swap_remove("__typename") { + FieldValue::from(value).with_type(ty) + } else { + FieldValue::from(value) + } + } + async_graphql::Value::List(values) => { + FieldValue::list(values.into_iter().map(transform_into_field_value)) + } + value => FieldValue::from(value), + } +} + +fn convert_iface(def: parser::InterfaceDefinition<'_>) -> async_graphql::dynamic::Type { + use async_graphql::dynamic::*; + let mut interface = Interface::new(def.name()); + + if let Some(description) = def.description() { + interface = interface.description(description.to_cow()); + } + + for field_def in def.fields() { + let type_ref = convert_type_ref(field_def.ty()); + + let mut field = InterfaceField::new(field_def.name(), type_ref); + + for argument in field_def.arguments() { + field = field.argument(convert_input_value(argument)); + } + + interface = interface.field(field); + } + + interface.into() +} + +fn convert_union(def: parser::UnionDefinition<'_>) -> async_graphql::dynamic::Type { + use async_graphql::dynamic::*; + + let mut output = Union::new(def.name()); + + if let Some(description) = def.description() { + output = output.description(description.to_cow()); + } + + for member in def.members() { + output = output.possible_type(member.name()); + } + + output.into() +} + +fn convert_enum(def: parser::EnumDefinition<'_>) -> async_graphql::dynamic::Type { + use async_graphql::dynamic::*; + + let mut output = Enum::new(def.name()).items(def.values().map(|value| { + let mut item = EnumItem::new(value.value()); + + if let Some(desc) = value.description() { + item = item.description(desc.to_cow()); + } + + item + })); + + if let Some(description) = def.description() { + output = output.description(description.to_cow()); + } + + output.into() +} + +fn convert_input_object(def: parser::InputObjectDefinition<'_>) -> async_graphql::dynamic::Type { + use async_graphql::dynamic::*; + + let mut object = InputObject::new(def.name()); + + if let Some(description) = def.description() { + object = object.description(description.to_cow()); + } + + for field_def in def.fields() { + object = object.field(convert_input_value(field_def)) + } + + object.into() +} + +fn convert_type_ref(ty: parser::Type<'_>) -> async_graphql::dynamic::TypeRef { + use async_graphql::dynamic::TypeRef; + + let mut output = TypeRef::named(ty.name()); + + for wrapper in ty.wrappers() { + match wrapper { + WrappingType::NonNull => { + output = TypeRef::NonNull(Box::new(output)); + } + WrappingType::List => { + output = TypeRef::List(Box::new(output)); + } + } + } + + output +} + +fn convert_input_value( + value_def: parser::InputValueDefinition<'_>, +) -> async_graphql::dynamic::InputValue { + use async_graphql::dynamic::InputValue; + + let mut value = InputValue::new(value_def.name(), convert_type_ref(value_def.ty())); + + if let Some(description) = value_def.description() { + value = value.description(description.to_cow()); + } + + if let Some(default) = value_def.default_value() { + value = value.default_value(convert_value(default)) + } + + value +} + +fn convert_value(value: cynic_parser::ConstValue<'_>) -> async_graphql::Value { + match value { + cynic_parser::ConstValue::Int(inner) => async_graphql::Value::Number(inner.as_i64().into()), + cynic_parser::ConstValue::Float(inner) => { + async_graphql::Value::Number(serde_json::Number::from_f64(inner.as_f64()).unwrap()) + } + cynic_parser::ConstValue::String(inner) => { + async_graphql::Value::String(inner.as_str().into()) + } + cynic_parser::ConstValue::Boolean(inner) => async_graphql::Value::Boolean(inner.as_bool()), + cynic_parser::ConstValue::Null(_) => async_graphql::Value::Null, + cynic_parser::ConstValue::Enum(inner) => { + async_graphql::Value::Enum(async_graphql::Name::new(inner.name())) + } + cynic_parser::ConstValue::List(inner) => { + async_graphql::Value::List(inner.items().map(convert_value).collect()) + } + cynic_parser::ConstValue::Object(inner) => async_graphql::Value::Object( + inner + .fields() + .map(|field| { + ( + async_graphql::Name::new(field.name()), + convert_value(field.value()), + ) + }) + .collect(), + ), + } +} + +fn schema_builder( + schema: &cynic_parser::TypeSystemDocument, +) -> async_graphql::dynamic::SchemaBuilder { + let (query_name, mutation_name, subscription_name) = root_types(schema); + async_graphql::dynamic::Schema::build(query_name, mutation_name, subscription_name) +} + +fn root_types(schema: &cynic_parser::TypeSystemDocument) -> (&str, Option<&str>, Option<&str>) { + use parser::Definition; + + let mut query_name = "Query"; + let mut mutation_name = None; + let mut subscription_name = None; + let mut found_schema_def = false; + let mut mutation_present = false; + let mut subscription_present = false; + for definition in schema.definitions() { + if let Definition::Schema(_) = definition { + found_schema_def = true; + } + match definition { + Definition::Schema(schema) | Definition::SchemaExtension(schema) => { + if let Some(def) = schema.query_type() { + query_name = def.named_type(); + } + if let Some(def) = schema.mutation_type() { + mutation_name = Some(def.named_type()); + } + if let Some(def) = schema.subscription_type() { + subscription_name = Some(def.named_type()); + } + } + Definition::Type(ty) | Definition::TypeExtension(ty) if ty.name() == "Mutation" => { + mutation_present = true + } + Definition::Type(ty) | Definition::TypeExtension(ty) if ty.name() == "Subscription" => { + subscription_present = true + } + _ => {} + } + } + if !found_schema_def { + if mutation_present { + mutation_name = Some("Mutation"); + } + if subscription_present { + mutation_name = Some("Subscription"); + } + } + + (query_name, mutation_name, subscription_name) +} + +fn default_field_resolver(field_name: &str) -> impl Resolver { + let field_name = async_graphql::Name::new(field_name); + + move |context: ResolverContext<'_>| { + if let Some(value) = context.parent_value.as_value() { + return match value { + async_graphql::Value::Object(map) => map + .get(&field_name) + .map(|value| value.clone().into_json().unwrap()), + _ => None, + }; + } + panic!("Unexpected parent value for tests",) + } +} diff --git a/graphql-mocks/src/dynamic/mod.rs b/graphql-mocks/src/dynamic/mod.rs new file mode 100644 index 000000000..9b807bcd4 --- /dev/null +++ b/graphql-mocks/src/dynamic/mod.rs @@ -0,0 +1,42 @@ +mod builder; +mod resolvers; + +pub use self::builder::DynamicSchemaBuilder; + +use futures_lite::stream; + +/// async-graphql powered dynamic schemas for tests. +/// +/// Occasionally its just easier to write SDL & resolvers, this lets you do that. +pub struct DynamicSchema { + schema: async_graphql::dynamic::Schema, + sdl: String, +} + +impl DynamicSchema { + pub fn builder(sdl: impl AsRef) -> DynamicSchemaBuilder { + DynamicSchemaBuilder::new(sdl.as_ref()) + } +} + +#[async_trait::async_trait] +impl super::Schema for DynamicSchema { + async fn execute( + &self, + _headers: Vec<(String, String)>, + request: async_graphql::Request, + ) -> async_graphql::Response { + self.schema.execute(request).await + } + + fn execute_stream( + &self, + request: async_graphql::Request, + ) -> stream::Boxed { + Box::pin(self.schema.execute_stream(request)) + } + + fn sdl(&self) -> String { + self.sdl.clone() + } +} diff --git a/graphql-mocks/src/dynamic/resolvers.rs b/graphql-mocks/src/dynamic/resolvers.rs new file mode 100644 index 000000000..9abc507b1 --- /dev/null +++ b/graphql-mocks/src/dynamic/resolvers.rs @@ -0,0 +1,33 @@ +use async_graphql::{dynamic::ResolverContext, ServerError}; + +pub trait Resolver: Send + Sync { + fn resolve(&mut self, context: ResolverContext<'_>) -> Option; +} + +impl Resolver for F +where + for<'a> F: FnMut(ResolverContext<'a>) -> Option + Send + Sync, +{ + fn resolve(&mut self, context: ResolverContext<'_>) -> Option { + self(context) + } +} + +impl Resolver for serde_json::Value { + fn resolve(&mut self, _context: ResolverContext<'_>) -> Option { + Some(self.clone()) + } +} + +impl Resolver for ServerError { + fn resolve(&mut self, context: ResolverContext<'_>) -> Option { + context.add_error(self.clone()); + None + } +} + +impl Resolver for Option { + fn resolve(&mut self, _context: ResolverContext<'_>) -> Option { + self.clone() + } +} diff --git a/graphql-mocks/src/lib.rs b/graphql-mocks/src/lib.rs new file mode 100644 index 000000000..460b760ae --- /dev/null +++ b/graphql-mocks/src/lib.rs @@ -0,0 +1,89 @@ +//! A mock GraphQL server for use in tests + +use futures_lite::stream; + +use std::sync::Arc; + +use serde::ser::SerializeMap; + +mod dynamic; +pub mod mocks; +mod server; + +pub use async_graphql::dynamic::ResolverContext; +pub use dynamic::{DynamicSchema, DynamicSchemaBuilder}; +pub use server::{builder::MockGraphQlServerBuilder, MockGraphQlServer}; + +#[derive(Debug)] +pub struct ReceivedRequest { + pub headers: http::HeaderMap, + pub body: async_graphql::Request, +} + +impl serde::Serialize for ReceivedRequest { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + let mut map = serializer.serialize_map(Some(2))?; + let mut headers = self + .headers + .iter() + .map(|(name, value)| { + ( + name.to_string(), + String::from_utf8_lossy(value.as_bytes()).into_owned(), + ) + }) + .collect::>(); + headers.sort_unstable(); + map.serialize_entry("headers", &headers)?; + map.serialize_entry("body", &self.body)?; + map.end() + } +} + +impl std::ops::Deref for ReceivedRequest { + type Target = async_graphql::Request; + fn deref(&self) -> &Self::Target { + &self.body + } +} + +/// Creating a trait for schema so we can use it as a trait object and avoid +/// making everything generic over Query, Mutation & Subscription params +#[async_trait::async_trait] +pub trait Schema: Send + Sync { + async fn execute( + &self, + headers: Vec<(String, String)>, + request: async_graphql::Request, + ) -> async_graphql::Response; + + fn execute_stream( + &self, + request: async_graphql::Request, + ) -> stream::Boxed; + + fn sdl(&self) -> String; +} + +#[derive(Clone)] +pub struct SchemaExecutor(Arc); + +#[async_trait::async_trait] +impl async_graphql::Executor for SchemaExecutor { + /// Execute a GraphQL query. + async fn execute(&self, request: async_graphql::Request) -> async_graphql::Response { + self.0.execute(Default::default(), request).await + } + + /// Execute a GraphQL subscription with session data. + fn execute_stream( + &self, + request: async_graphql::Request, + _session_data: Option>, + ) -> stream::Boxed { + self.0.execute_stream(request) + } +} diff --git a/graphql-mocks/src/mocks/mod.rs b/graphql-mocks/src/mocks/mod.rs new file mode 100644 index 000000000..693781ac1 --- /dev/null +++ b/graphql-mocks/src/mocks/mod.rs @@ -0,0 +1 @@ +pub mod swapi; diff --git a/graphql-mocks/src/mocks/swapi.rs b/graphql-mocks/src/mocks/swapi.rs new file mode 100644 index 000000000..dbf01011c --- /dev/null +++ b/graphql-mocks/src/mocks/swapi.rs @@ -0,0 +1,49 @@ +use serde_json::{json, Value}; + +use crate::{DynamicSchema, MockGraphQlServer, ResolverContext}; + +pub async fn serve() -> MockGraphQlServer { + DynamicSchema::builder(include_str!("../../../schemas/starwars.schema.graphql")) + .with_resolver("Root", "film", film_resolver) + .with_resolver("Root", "node", node_resolver) + .into_server_builder() + .await +} + +fn film_resolver(context: ResolverContext) -> Option { + let id = context.args.get("id")?.string().ok()?; + match id { + "ZmlsbXM6MQ==" => Some(json!({ + "id": "ZmlsbXM6MQ==", + "title": "A New Hope", + "director": "George Lucas", + "releaseDate": "1977-05-25", + "producers": ["Gary Kurtz", "Rick McCallum"] + })), + _ => None, + } +} + +fn node_resolver(context: ResolverContext) -> Option { + let id = context.args.get("id")?.string().ok()?; + match id { + "ZmlsbXM6MQ==" => Some(json!({ + "__typename": "Film", + "id": "ZmlsbXM6MQ==", + "title": "A New Hope", + "director": "George Lucas", + "releaseDate": "1977-05-25", + "producers": ["Gary Kurtz", "Rick McCallum"] + })), + "cGxhbmV0czo0OQ==" => Some(json!({ + "__typename": "Planet", + "id": "cGxhbmV0czo0OQ==", + "name": "Dorin" + })), + "c3RhcnNoaXBzOjY1" => Some(json!({ + "__typename": "Starship", + "id": "c3RhcnNoaXBzOjY1" + })), + _ => None, + } +} diff --git a/graphql-mocks/src/server.rs b/graphql-mocks/src/server.rs new file mode 100644 index 000000000..7bd90f6af --- /dev/null +++ b/graphql-mocks/src/server.rs @@ -0,0 +1,95 @@ +use std::{sync::Arc, time::Duration}; + +use async_graphql_axum::GraphQLSubscription; +use axum::{routing::post, Router}; +use builder::MockGraphQlServerBuilder; +use handler::graphql_handler; +use url::Url; + +use crate::{ReceivedRequest, Schema, SchemaExecutor}; + +pub(crate) mod builder; +mod handler; + +pub struct MockGraphQlServer { + state: AppState, + shutdown: Option>, + port: u16, +} + +impl Drop for MockGraphQlServer { + fn drop(&mut self) { + if let Some(shutdown) = self.shutdown.take() { + shutdown.send(()).ok(); + } + } +} + +impl MockGraphQlServer { + pub(crate) fn builder(schema: impl Schema + 'static) -> MockGraphQlServerBuilder { + MockGraphQlServerBuilder::new(Arc::new(schema)) + } + + async fn new_impl(schema: Arc, port: Option) -> Self { + let state = AppState { + schema: schema.clone(), + received_requests: Default::default(), + }; + + let app = Router::new() + .route("/", post(graphql_handler)) + .route_service("/ws", GraphQLSubscription::new(SchemaExecutor(schema))) + .with_state(state.clone()); + + let listener = tokio::net::TcpListener::bind(format!("127.0.0.1:{}", port.unwrap_or(0))) + .await + .unwrap(); + let port = listener.local_addr().unwrap().port(); + + let (shutdown_sender, shutdown_receiver) = tokio::sync::oneshot::channel::<()>(); + + tokio::spawn(async move { + axum::serve(listener, app) + .with_graceful_shutdown(async move { + shutdown_receiver.await.ok(); + }) + .await + .unwrap(); + }); + + // Give the server time to start + tokio::time::sleep(Duration::from_millis(20)).await; + + MockGraphQlServer { + state, + shutdown: Some(shutdown_sender), + port, + } + } + + pub fn port(&self) -> u16 { + self.port + } + + pub fn url(&self) -> Url { + format!("http://127.0.0.1:{}", self.port).parse().unwrap() + } + + pub fn sdl(&self) -> String { + self.state.schema.sdl() + } + + pub fn websocket_url(&self) -> Url { + format!("ws://127.0.0.1:{}/ws", self.port).parse().unwrap() + } + + pub fn drain_received_requests(&self) -> impl Iterator + '_ { + std::iter::from_fn(|| self.state.received_requests.pop()) + } +} + +#[derive(Clone)] +struct AppState { + schema: Arc, + received_requests: Arc>, +} diff --git a/graphql-mocks/src/server/builder.rs b/graphql-mocks/src/server/builder.rs new file mode 100644 index 000000000..2f76ccc7e --- /dev/null +++ b/graphql-mocks/src/server/builder.rs @@ -0,0 +1,37 @@ +use std::{future::IntoFuture, sync::Arc}; + +use futures_lite::{future, FutureExt}; + +use crate::Schema; + +use super::MockGraphQlServer; + +pub struct MockGraphQlServerBuilder { + schema: Arc, + port: Option, +} + +impl MockGraphQlServerBuilder { + pub(super) fn new(schema: Arc) -> Self { + MockGraphQlServerBuilder { schema, port: None } + } + + pub fn with_port(mut self, port: u16) -> Self { + self.port = Some(port); + self + } + + pub async fn build(self) -> MockGraphQlServer { + MockGraphQlServer::new_impl(self.schema, self.port).await + } +} + +impl IntoFuture for MockGraphQlServerBuilder { + type Output = MockGraphQlServer; + + type IntoFuture = future::Boxed; + + fn into_future(self) -> Self::IntoFuture { + self.build().boxed() + } +} diff --git a/graphql-mocks/src/server/handler.rs b/graphql-mocks/src/server/handler.rs new file mode 100644 index 000000000..3fae26816 --- /dev/null +++ b/graphql-mocks/src/server/handler.rs @@ -0,0 +1,36 @@ +use async_graphql_axum::{GraphQLRequest, GraphQLResponse}; +use axum::{extract::State, response::IntoResponse}; +use http::HeaderMap; + +use crate::ReceivedRequest; + +use super::AppState; + +pub(super) async fn graphql_handler( + State(state): State, + headers: HeaderMap, + req: GraphQLRequest, +) -> axum::response::Response { + let req = req.into_inner(); + + // Record the request incase tests want to inspect it. + // async_graphql::Request isn't clone so we do a deser roundtrip instead + state.received_requests.push(ReceivedRequest { + headers: headers.clone(), + body: serde_json::from_value(serde_json::to_value(&req).unwrap()).unwrap(), + }); + + let headers = headers + .iter() + .map(|(name, value)| { + ( + name.to_string(), + String::from_utf8_lossy(value.as_bytes()).to_string(), + ) + }) + .collect(); + + let response: GraphQLResponse = state.schema.execute(headers, req).await.into(); + + response.into_response() +} diff --git a/tests/querygen-compile-run/Cargo.toml b/tests/querygen-compile-run/Cargo.toml index 3ccbb5a16..6a8dabda3 100644 --- a/tests/querygen-compile-run/Cargo.toml +++ b/tests/querygen-compile-run/Cargo.toml @@ -10,9 +10,11 @@ publish = false [dependencies] cynic = { path = "../../cynic" } serde_json = "1.0" -ureq = { version = "2.4", features = ["json"] } +reqwest = { version = "0.12", features = ["json"] } [dev-dependencies] +graphql-mocks.workspace = true +tokio = { version = "1", features = ["macros"] } trybuild = "1.0.80" [build-dependencies] diff --git a/tests/querygen-compile-run/build.rs b/tests/querygen-compile-run/build.rs index 4f9b76504..517af5b1b 100644 --- a/tests/querygen-compile-run/build.rs +++ b/tests/querygen-compile-run/build.rs @@ -13,7 +13,9 @@ fn main() { "starwars", "https://swapi-graphql.netlify.app/.netlify/functions/index", "starwars.schema.graphql", - ); + ) + .with_mock("swapi"); + let jobs_schema = Schema::from_repo_schemas( "graphql.jobs", "https://api.graphql.jobs/", @@ -317,12 +319,20 @@ impl TestCase { "#![allow(unreachable_code)] return;" }; + let startup_mock = match &self.schema.mock_name { + Some(name) => format!("let mock_server = graphql_mocks::mocks::{name}::serve().await;"), + None => "".into(), + }; + let run_code = if self.is_subscription { format!("{};", &self.operation_construct) } else { + let url = match &self.schema.mock_name { + Some(_) => "mock_server.url().as_ref()".into(), + None => format!("\"{}\"", self.schema.query_url), + }; format!( - r#"querygen_compile_run::send("{url}", {operation_construct}).unwrap();"#, - url = self.schema.query_url, + r#"querygen_compile_run::send({url}, {operation_construct}).await.unwrap();"#, operation_construct = self.operation_construct ) }; @@ -332,8 +342,9 @@ impl TestCase { r#" #![allow(unused_imports, clippy::large_enum_variant)] - #[test] - fn generated_test() {{ + #[tokio::test] + async fn generated_test() {{ + {startup_mock} {norun_code} use cynic::{{QueryBuilder, MutationBuilder, SubscriptionBuilder}}; {run_code} @@ -358,9 +369,15 @@ struct Schema { query_url: String, schema_name: String, path_for_loading: PathBuf, + mock_name: Option, } impl Schema { + fn with_mock(mut self, name: &str) -> Self { + self.mock_name = Some(name.into()); + self + } + /// Constructs a SchemaPath from the examples package fn from_repo_schemas( schema_name: impl Into, @@ -379,6 +396,7 @@ impl Schema { query_url: query_url.into(), path_for_loading: path, schema_name, + mock_name: None, } } } diff --git a/tests/querygen-compile-run/src/lib.rs b/tests/querygen-compile-run/src/lib.rs index 90a71c9aa..44446d976 100644 --- a/tests/querygen-compile-run/src/lib.rs +++ b/tests/querygen-compile-run/src/lib.rs @@ -1,6 +1,4 @@ -use serde_json::json; - -pub fn send( +pub async fn send( url: &str, operation: cynic::Operation, ) -> Result> @@ -8,12 +6,18 @@ where Vars: cynic::serde::Serialize, ResponseData: cynic::serde::de::DeserializeOwned, { - let response = ureq::post(url) - .set("User-Agent", "obmarg/cynic") - .send_json(json!(operation)) + let response = reqwest::Client::new() + .post(url) + .header("User-Agent", "obmarg/cynic") + .json(&operation) + .send() + .await .unwrap(); - let response_data = response.into_json::>()?; + let response_data = response + .json::>() + .await?; + if let Some(_errors) = response_data.errors { println!("{:?}", _errors); return Err("GraphQL server returned errors".into());