From f76ba00ce4a0ee39ba8dd4f896e3091b3667a42c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hans=20M=C3=BCndelein?= Date: Fri, 19 May 2023 17:19:19 +0200 Subject: [PATCH] Remove legacy graphql stuff Graphql is dead. Long live gRPC!!! --- Cargo.lock | 333 +------- crabidy-core/Cargo.toml | 8 - crabidy-core/build.rs | 33 - crabidy-core/src/lib.rs | 199 +---- crabidy-core/src/query.graphql | 3 - crabidy-core/src/query.rs | 35 - crabidy-core/src/schema.graphql | 81 -- crabidy-core/src/schema.json | 1386 ------------------------------- 8 files changed, 45 insertions(+), 2033 deletions(-) delete mode 100644 crabidy-core/src/query.graphql delete mode 100644 crabidy-core/src/query.rs delete mode 100644 crabidy-core/src/schema.graphql delete mode 100644 crabidy-core/src/schema.json diff --git a/Cargo.lock b/Cargo.lock index 19b6507..2b761d4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -8,17 +8,6 @@ version = "0.11.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fe438c63458706e03479442743baae6c88256498e6431708f6dfc520a26515d3" -[[package]] -name = "ahash" -version = "0.7.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" -dependencies = [ - "getrandom", - "once_cell", - "version_check", -] - [[package]] name = "aliasable" version = "0.1.3" @@ -99,12 +88,6 @@ dependencies = [ "tower-service", ] -[[package]] -name = "base64" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" - [[package]] name = "base64" version = "0.21.0" @@ -117,40 +100,6 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" -[[package]] -name = "bitvec" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c" -dependencies = [ - "funty", - "radium", - "tap", - "wyz", -] - -[[package]] -name = "bson" -version = "2.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9aeb8bae494e49dbc330dd23cf78f6f7accee22f640ce3ab17841badaa4ce232" -dependencies = [ - "ahash", - "base64 0.13.1", - "bitvec", - "chrono", - "hex", - "indexmap", - "js-sys", - "lazy_static", - "rand", - "serde", - "serde_bytes", - "serde_json", - "time", - "uuid", -] - [[package]] name = "bumpalo" version = "3.12.2" @@ -199,16 +148,6 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" -[[package]] -name = "chrono" -version = "0.4.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e3c5919066adf22df73762e50cffcde3a758f2a848b113b586d1f86728b673b" -dependencies = [ - "num-integer", - "num-traits", -] - [[package]] name = "combine" version = "3.8.1" @@ -252,10 +191,6 @@ name = "crabidy-core" version = "0.1.0" dependencies = [ "async-trait", - "futures", - "graphql_client", - "juniper", - "juniper_subscriptions", "prost", "serde", "tonic", @@ -364,17 +299,6 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "derive_utils" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "532b4c15dccee12c7044f1fcad956e98410860b22231e44a3b827464797ca7bf" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "either" version = "1.8.1" @@ -469,27 +393,6 @@ dependencies = [ "percent-encoding", ] -[[package]] -name = "funty" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" - -[[package]] -name = "futures" -version = "0.3.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23342abe12aba583913b2e62f22225ff9c950774065e4bfb61a19cd9770fec40" -dependencies = [ - "futures-channel", - "futures-core", - "futures-executor", - "futures-io", - "futures-sink", - "futures-task", - "futures-util", -] - [[package]] name = "futures-channel" version = "0.3.28" @@ -497,7 +400,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "955518d47e09b25bbebc7a18df10b81f0c766eaf4c4f1cccef2fca5f2a4fb5f2" dependencies = [ "futures-core", - "futures-sink", ] [[package]] @@ -506,45 +408,6 @@ version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4bca583b7e26f571124fe5b7561d49cb2868d79116cfa0eefce955557c6fee8c" -[[package]] -name = "futures-enum" -version = "0.1.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3422d14de7903a52e9dbc10ae05a7e14445ec61890100e098754e120b2bd7b1e" -dependencies = [ - "derive_utils", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "futures-executor" -version = "0.3.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccecee823288125bd88b4d7f565c9e58e41858e47ab72e8ea2d64e93624386e0" -dependencies = [ - "futures-core", - "futures-task", - "futures-util", -] - -[[package]] -name = "futures-io" -version = "0.3.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fff74096e71ed47f8e023204cfd0aa1289cd54ae5430a9523be060cdb849964" - -[[package]] -name = "futures-macro" -version = "0.3.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.16", -] - [[package]] name = "futures-sink" version = "0.3.28" @@ -563,16 +426,10 @@ version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "26b01e40b772d54cf6c6d721c1d1abd0647a0106a12ecaa1c186273392a69533" dependencies = [ - "futures-channel", "futures-core", - "futures-io", - "futures-macro", - "futures-sink", "futures-task", - "memchr", "pin-project-lite", "pin-utils", - "slab", ] [[package]] @@ -588,15 +445,6 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "graphql-introspection-query" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f2a4732cf5140bd6c082434494f785a19cfb566ab07d1382c3671f5812fed6d" -dependencies = [ - "serde", -] - [[package]] name = "graphql-parser" version = "0.4.0" @@ -607,45 +455,6 @@ dependencies = [ "thiserror", ] -[[package]] -name = "graphql_client" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa61bb9dc6d373a8b465a5da17b62809483e8527a34b0e9034dc0915b09e160a" -dependencies = [ - "graphql_query_derive", - "serde", - "serde_json", -] - -[[package]] -name = "graphql_client_codegen" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e55df64cc702c4ad6647f8df13a799ad11688a3781fadf5045f7ba12733fa9b" -dependencies = [ - "graphql-introspection-query", - "graphql-parser", - "heck", - "lazy_static", - "proc-macro2", - "quote", - "serde", - "serde_json", - "syn 1.0.109", -] - -[[package]] -name = "graphql_query_derive" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d52fc9cde811f44b15ec0692b31e56a3067f6f431c5ace712f286e47c1dacc98" -dependencies = [ - "graphql_client_codegen", - "proc-macro2", - "syn 1.0.109", -] - [[package]] name = "h2" version = "0.3.19" @@ -692,12 +501,6 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fed44880c466736ef9a5c5b5facefb5ed0785676d0c02d612db14e54f0d84286" -[[package]] -name = "hex" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" - [[package]] name = "http" version = "0.2.9" @@ -805,7 +608,6 @@ checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" dependencies = [ "autocfg", "hashbrown", - "serde", ] [[package]] @@ -858,48 +660,6 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "juniper" -version = "0.16.0-dev" -source = "git+https://github.com/graphql-rust/juniper.git?branch=master#a648dd727519991c2e3c762af16eac027b2acec2" -dependencies = [ - "async-trait", - "bson", - "fnv", - "futures", - "futures-enum", - "graphql-parser", - "indexmap", - "juniper_codegen", - "serde", - "smartstring", - "static_assertions", - "url", - "uuid", - "void", -] - -[[package]] -name = "juniper_codegen" -version = "0.16.0-dev" -source = "git+https://github.com/graphql-rust/juniper.git?branch=master#a648dd727519991c2e3c762af16eac027b2acec2" -dependencies = [ - "proc-macro-error", - "proc-macro2", - "quote", - "syn 1.0.109", - "url", -] - -[[package]] -name = "juniper_subscriptions" -version = "0.17.0-dev" -source = "git+https://github.com/graphql-rust/juniper.git?branch=master#a648dd727519991c2e3c762af16eac027b2acec2" -dependencies = [ - "futures", - "juniper", -] - [[package]] name = "lazy_static" version = "1.4.0" @@ -1000,16 +760,6 @@ dependencies = [ "tempfile", ] -[[package]] -name = "num-integer" -version = "0.1.45" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" -dependencies = [ - "autocfg", - "num-traits", -] - [[package]] name = "num-traits" version = "0.2.15" @@ -1291,12 +1041,6 @@ dependencies = [ "proc-macro2", ] -[[package]] -name = "radium" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" - [[package]] name = "rand" version = "0.8.5" @@ -1379,7 +1123,7 @@ version = "0.11.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cde824a14b7c14f85caff81225f411faacc04a2013f41670f41443742b1c1c55" dependencies = [ - "base64 0.21.0", + "base64", "bytes", "encoding_rs", "futures-core", @@ -1483,15 +1227,6 @@ dependencies = [ "serde_derive", ] -[[package]] -name = "serde_bytes" -version = "0.11.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "416bda436f9aab92e02c8e10d49a15ddd339cea90b6e340fe51ed97abb548294" -dependencies = [ - "serde", -] - [[package]] name = "serde_derive" version = "1.0.163" @@ -1509,7 +1244,6 @@ version = "1.0.96" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "057d394a50403bcac12672b2b18fb387ab6d289d957dab67dd201875391e52f1" dependencies = [ - "indexmap", "itoa", "ryu", "serde", @@ -1572,17 +1306,6 @@ version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" -[[package]] -name = "smartstring" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fb72c633efbaa2dd666986505016c32c3044395ceaf881518399d2f4127ee29" -dependencies = [ - "autocfg", - "static_assertions", - "version_check", -] - [[package]] name = "socket2" version = "0.4.9" @@ -1642,12 +1365,6 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" -[[package]] -name = "tap" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" - [[package]] name = "tempfile" version = "3.5.0" @@ -1681,33 +1398,6 @@ dependencies = [ "syn 2.0.16", ] -[[package]] -name = "time" -version = "0.3.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f3403384eaacbca9923fa06940178ac13e4edb725486d70e8e15881d0c836cc" -dependencies = [ - "itoa", - "serde", - "time-core", - "time-macros", -] - -[[package]] -name = "time-core" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7300fbefb4dadc1af235a9cef3737cea692a9d97e1b9cbcd4ebdae6f8868e6fb" - -[[package]] -name = "time-macros" -version = "0.2.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "372950940a5f07bf38dbe211d7283c9e6d7327df53794992d293e534c733d09b" -dependencies = [ - "time-core", -] - [[package]] name = "tinyvec" version = "1.6.0" @@ -1806,7 +1496,7 @@ checksum = "3082666a3a6433f7f511c7192923fa1fe07c69332d3c6a2e6bb040b569199d5a" dependencies = [ "async-trait", "axum", - "base64 0.21.0", + "base64", "bytes", "futures-core", "futures-util", @@ -1962,16 +1652,6 @@ dependencies = [ "percent-encoding", ] -[[package]] -name = "uuid" -version = "1.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "345444e32442451b267fc254ae85a209c64be56d2890e601a0c37ff0c3c5ecd2" -dependencies = [ - "getrandom", - "serde", -] - [[package]] name = "vcpkg" version = "0.2.15" @@ -2270,12 +1950,3 @@ checksum = "80d0f4e272c85def139476380b12f9ac60926689dd2e01d4923222f40580869d" dependencies = [ "winapi", ] - -[[package]] -name = "wyz" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05f360fc0b24296329c78fda852a1e9ae82de9cf7b27dae4b7f62f118f77b9ed" -dependencies = [ - "tap", -] diff --git a/crabidy-core/Cargo.toml b/crabidy-core/Cargo.toml index b7f5b8c..d2f7fad 100644 --- a/crabidy-core/Cargo.toml +++ b/crabidy-core/Cargo.toml @@ -7,19 +7,11 @@ edition = "2021" [dependencies] async-trait = "0.1.68" -futures = "0.3.28" -graphql_client = "0.12.0" -juniper = { git = "https://github.com/graphql-rust/juniper.git", branch = "master" } -juniper_subscriptions = { git = "https://github.com/graphql-rust/juniper.git", branch = "master" } prost = "0.11" serde = "1.0.163" tonic = "0.9" [build-dependencies] async-trait = "0.1.68" -futures = "0.3.28" -graphql_client = "0.12.0" -juniper = { git = "https://github.com/graphql-rust/juniper.git", branch = "master" } -juniper_subscriptions = { git = "https://github.com/graphql-rust/juniper.git", branch = "master" } serde = "1.0.163" tonic-build = "0.9" diff --git a/crabidy-core/build.rs b/crabidy-core/build.rs index 4c00549..42ae371 100644 --- a/crabidy-core/build.rs +++ b/crabidy-core/build.rs @@ -1,37 +1,4 @@ -use juniper::{EmptyMutation, EmptySubscription, IntrospectionFormat}; -use std::fs::File; -use std::io::prelude::*; - -#[path = "src/lib.rs"] -mod lib; - fn main() -> Result<(), Box> { - // --- OLD JUNIPER STUFF --- - // let (res, _errors) = juniper::introspect( - // &lib::Schema::new( - // lib::ItemList::new(), - // lib::Queue::new(), - // lib::Subscription::new(), - // ), - // &(), - // IntrospectionFormat::default(), - // ) - // .unwrap(); - // let mut file = File::create("src/schema.json").unwrap(); - // let json_result = serde_json::to_string_pretty(&res).unwrap(); - // file.write_all(json_result.as_bytes()).unwrap(); - - let schema = lib::Schema::new( - lib::ItemList::new(), - lib::Mutation::new(), - lib::Subscription::new(), - ); - let schema_str = schema.as_schema_language(); - - let mut file = File::create("src/schema.graphql").unwrap(); - file.write_all(schema_str.as_bytes()).unwrap(); - - // --- NEW TONIC STUFF --- tonic_build::compile_protos("proto/crabidy.proto")?; Ok(()) } diff --git a/crabidy-core/src/lib.rs b/crabidy-core/src/lib.rs index 93cb3d1..175ab40 100644 --- a/crabidy-core/src/lib.rs +++ b/crabidy-core/src/lib.rs @@ -1,25 +1,13 @@ pub mod proto; use async_trait::async_trait; -use futures::Stream; -use juniper::{ - graphql_object, graphql_subscription, FieldError, FieldResult, GraphQLEnum, GraphQLInputObject, - GraphQLObject, RootNode, -}; -use std::{collections::HashMap, pin::Pin, sync::Arc}; #[async_trait] -pub trait ProviderClient: Send + Sync { +pub trait ProviderClient: std::fmt::Debug + Send + Sync { async fn get_urls_for_track(&self, track_uuid: &str) -> Result, ProviderError>; - async fn get_item_lists_full(&self) -> Result, ProviderError>; - async fn get_item_lists_partial( - &self, - list_uuid: String, - ) -> Result, ProviderError>; - async fn get_item_list_partial_without_children( - &self, - list_uuid: String, - ) -> Result; + fn get_root_list(&self) -> ItemList; + async fn get_item_list(&self, list_uuid: &str, depth: usize) + -> Result; } #[derive(Clone, Debug, Hash)] @@ -32,47 +20,39 @@ pub enum ProviderError { pub struct ItemList { pub name: String, pub uuid: String, - pub provider: String, + pub parent: String, pub tracks: Option>, - pub children: Option>, + pub children: Vec, pub is_queable: bool, - without_children: bool, -} - -#[graphql_object(context = Context)] -impl ItemList { - fn name(&self) -> &str { - &self.name - } - fn uuid(&self) -> &str { - &self.uuid - } - fn provider(&self) -> &str { - &self.provider - } - //TODO: Be smarter than clone here - fn tracks(&self, refresh: bool) -> Option> { - self.tracks.clone() - } - //TODO: Be smarter than clone here - fn children(&self, refresh: bool) -> Option> { - self.children.clone() - } - fn is_queable(&self) -> bool { - self.is_queable - } + pub ephemeral: bool, + pub is_partial: bool, } impl ItemList { pub fn new() -> Self { Self { - name: "root".to_string(), - uuid: "root".to_string(), - provider: "root".to_string(), + name: "/".to_string(), + uuid: "/".to_string(), + parent: "".to_string(), tracks: None, - children: None, + children: Vec::new(), is_queable: false, - without_children: true, + ephemeral: false, + is_partial: true, + } + } + pub fn replace_sublist(&mut self, sublist: &Self) { + if self.uuid == sublist.uuid { + self.name = sublist.name.clone(); + self.tracks = sublist.tracks.clone(); + self.children = sublist.children.clone(); + self.is_queable = sublist.is_queable; + self.ephemeral = sublist.ephemeral; + self.is_partial = sublist.is_partial; + return; + } + for child in self.children.iter_mut() { + child.replace_sublist(sublist); } } pub fn flatten(&self) -> Vec { @@ -80,16 +60,21 @@ impl ItemList { if let Some(own_tracks) = &self.tracks { tracks.extend(own_tracks.clone()); } - if let Some(childs) = &self.children { - for child in childs { - tracks.extend(child.flatten()); - } + for child in self.children.iter() { + tracks.extend(child.flatten()); } tracks } } -#[derive(Clone, Debug, GraphQLEnum)] +#[derive(Clone, Debug)] +struct ItemListFilter { + uuid_filter: Option, + name_filter: Option, + provider_filter: Option, +} + +#[derive(Clone, Debug)] enum PlayState { Buffering, Playing, @@ -97,7 +82,7 @@ enum PlayState { Stopped, } -#[derive(Clone, Debug, GraphQLObject)] +#[derive(Clone, Debug)] pub struct Track { pub title: String, pub uuid: String, @@ -107,19 +92,19 @@ pub struct Track { pub provider: String, } -#[derive(Clone, Debug, GraphQLInputObject)] +#[derive(Clone, Debug)] pub struct InputTrack { pub uuid: String, pub provider: String, } -#[derive(Clone, Debug, GraphQLObject)] +#[derive(Clone, Debug)] pub struct Album { pub title: String, pub release_date: Option, } -#[derive(Clone, Debug, GraphQLObject)] +#[derive(Clone, Debug)] pub struct Artist { pub name: String, } @@ -129,7 +114,7 @@ pub enum QueueError { ItemListNotQueuable, } -#[derive(Clone, Debug, GraphQLObject)] +#[derive(Clone, Debug)] pub struct Queue { pub tracks: Vec, current: i32, @@ -215,58 +200,6 @@ impl Queue { } #[derive(Clone, Debug)] -pub struct Mutation; - -impl Mutation { - pub fn new() -> Self { - Self - } -} - -#[graphql_object(context = Context)] -impl Mutation { - fn playpause(&self, track: InputTrack) -> FieldResult { - Ok(ActiveTrack::new()) - } - fn stop(&self, track: InputTrack) -> FieldResult { - Ok(ActiveTrack::new()) - } - fn previous(&self, track: InputTrack) -> FieldResult { - Ok(ActiveTrack::new()) - } - fn next(&self, track: InputTrack) -> FieldResult { - Ok(ActiveTrack::new()) - } - fn seek(&self, track: InputTrack, millis: i32) -> FieldResult { - Ok(ActiveTrack::new()) - } - fn append(&self, tracks: Vec) -> FieldResult { - Ok(Success::Appending) - } - fn queue(&self, tracks: Vec) -> FieldResult { - Ok(Success::Queuing) - } - fn replace(&self, tracks: Vec) -> FieldResult { - Ok(Success::Replacing) - } - fn delete(&self, track: InputTrack) -> FieldResult { - Ok(Success::Deleting) - } - fn clear(&self, track: InputTrack) -> FieldResult { - Ok(Success::Clearing) - } -} - -#[derive(Clone, Debug, GraphQLEnum)] -enum Success { - Appending, - Replacing, - Queuing, - Deleting, - Clearing, -} - -#[derive(Clone, Debug, GraphQLObject)] pub struct ActiveTrack { track: Option, completion: i32, @@ -282,49 +215,3 @@ impl ActiveTrack { } } } - -type ActiveTrackStream = Pin> + Send>>; -type QueueStream = Pin> + Send>>; - -#[derive(Clone, Debug)] -pub struct Subscription { - queue: Queue, - active_track: Option, -} - -#[graphql_subscription(context = Context)] -impl Subscription { - async fn queue() -> QueueStream { - let stream = futures::stream::iter(vec![Ok(Queue::new())]); - Box::pin(stream) - } - async fn active_track() -> ActiveTrackStream { - let stream = futures::stream::iter(vec![Ok(ActiveTrack::new())]); - Box::pin(stream) - } -} - -impl Subscription { - pub fn new() -> Self { - Self { - queue: Queue::new(), - active_track: None, - } - } -} - -pub struct Context { - clients: HashMap>, - queue: Queue, -} - -impl Context { - pub fn new(clients: HashMap>) -> Self { - let queue = Queue::new(); - Self { clients, queue } - } -} - -impl juniper::Context for Context {} - -pub type Schema = RootNode<'static, ItemList, Mutation, Subscription>; diff --git a/crabidy-core/src/query.graphql b/crabidy-core/src/query.graphql deleted file mode 100644 index 748d839..0000000 --- a/crabidy-core/src/query.graphql +++ /dev/null @@ -1,3 +0,0 @@ -query ItemList { - name -} diff --git a/crabidy-core/src/query.rs b/crabidy-core/src/query.rs deleted file mode 100644 index 390fcb3..0000000 --- a/crabidy-core/src/query.rs +++ /dev/null @@ -1,35 +0,0 @@ -#![allow(clippy::all, warnings)] -pub struct ItemList; -pub mod item_list { - #![allow(dead_code)] - use std::result::Result; - pub const OPERATION_NAME: &str = "ItemList"; - pub const QUERY: &str = "query ItemList {\n name\n}\n"; - use super::*; - use serde::{Deserialize, Serialize}; - #[allow(dead_code)] - type Boolean = bool; - #[allow(dead_code)] - type Float = f64; - #[allow(dead_code)] - type Int = i64; - #[allow(dead_code)] - type ID = String; - #[derive(Serialize)] - pub struct Variables; - #[derive(Deserialize)] - pub struct ResponseData { - pub name: String, - } -} -impl graphql_client::GraphQLQuery for ItemList { - type Variables = item_list::Variables; - type ResponseData = item_list::ResponseData; - fn build_query(variables: Self::Variables) -> ::graphql_client::QueryBody { - graphql_client::QueryBody { - variables, - query: item_list::QUERY, - operation_name: item_list::OPERATION_NAME, - } - } -} diff --git a/crabidy-core/src/schema.graphql b/crabidy-core/src/schema.graphql deleted file mode 100644 index ed3faae..0000000 --- a/crabidy-core/src/schema.graphql +++ /dev/null @@ -1,81 +0,0 @@ -type Queue { - tracks: [Track!]! - current: Int! -} - -type Mutation { - playpause(track: InputTrack!): ActiveTrack! - stop(track: InputTrack!): ActiveTrack! - previous(track: InputTrack!): ActiveTrack! - next(track: InputTrack!): ActiveTrack! - seek(track: InputTrack!, millis: Int!): ActiveTrack! - append(tracks: [InputTrack!]!): Success! - queue(tracks: [InputTrack!]!): Success! - replace(tracks: [InputTrack!]!): Success! - delete(track: InputTrack!): Success! - clear(track: InputTrack!): Success! -} - -type Album { - title: String! - releaseDate: String -} - -enum PlayState { - BUFFERING - PLAYING - PAUSED - STOPPED -} - -type Subscription { - queue: Queue! - activeTrack: ActiveTrack! -} - -type Artist { - name: String! -} - -type ActiveTrack { - track: Track - completion: Int! - playState: PlayState! -} - -type ItemList { - name: String! - uuid: String! - provider: String! - tracks(refresh: Boolean!): [Track!] - children(refresh: Boolean!): [ItemList!] - isQueable: Boolean! -} - -type Track { - title: String! - uuid: String! - duration: Int - album: Album - artist: Artist - provider: String! -} - -enum Success { - APPENDING - REPLACING - QUEUING - DELETING - CLEARING -} - -input InputTrack { - uuid: String! - provider: String! -} - -schema { - query: ItemList - mutation: Mutation - subscription: Subscription -} diff --git a/crabidy-core/src/schema.json b/crabidy-core/src/schema.json deleted file mode 100644 index 7c35a90..0000000 --- a/crabidy-core/src/schema.json +++ /dev/null @@ -1,1386 +0,0 @@ -{ - "__schema": { - "description": null, - "queryType": { - "name": "ItemList" - }, - "mutationType": { - "name": "Queue" - }, - "subscriptionType": { - "name": "Subscription" - }, - "types": [ - { - "kind": "SCALAR", - "name": "Boolean", - "description": null, - "specifiedByUrl": null, - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "__InputValue", - "description": null, - "specifiedByUrl": null, - "fields": [ - { - "name": "name", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "description", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "type", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "__Type", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "defaultValue", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "SCALAR", - "name": "String", - "description": null, - "specifiedByUrl": null, - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "Queue", - "description": null, - "specifiedByUrl": null, - "fields": [ - { - "name": "tracks", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "Track", - "ofType": null - } - } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "current", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "__Field", - "description": null, - "specifiedByUrl": null, - "fields": [ - { - "name": "name", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "description", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "args", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "__InputValue", - "ofType": null - } - } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "type", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "__Type", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "isDeprecated", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "deprecationReason", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "Album", - "description": null, - "specifiedByUrl": null, - "fields": [ - { - "name": "title", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "releaseDate", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "ENUM", - "name": "__TypeKind", - "description": "GraphQL type kind\n\nThe GraphQL specification defines a number of type kinds - the meta type of a type.", - "specifiedByUrl": null, - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": [ - { - "name": "SCALAR", - "description": "## Scalar types\n\nScalar types appear as the leaf nodes of GraphQL queries. Strings, numbers, and booleans are the built in types, and while it's possible to define your own, it's relatively uncommon.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "OBJECT", - "description": "## Object types\n\nThe most common type to be implemented by users. Objects have fields and can implement interfaces.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "INTERFACE", - "description": "## Interface types\n\nInterface types are used to represent overlapping fields between multiple types, and can be queried for their concrete type.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "UNION", - "description": "## Union types\n\nUnions are similar to interfaces but can not contain any fields on their own.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "ENUM", - "description": "## Enum types\n\nLike scalars, enum types appear as the leaf nodes of GraphQL queries.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "INPUT_OBJECT", - "description": "## Input objects\n\nRepresents complex values provided in queries _into_ the system.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "LIST", - "description": "## List types\n\nRepresent lists of other types. This library provides implementations for vectors and slices, but other Rust types can be extended to serve as GraphQL lists.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "NON_NULL", - "description": "## Non-null types\n\nIn GraphQL, nullable types are the default. By putting a `!` after a type, it becomes non-nullable.", - "isDeprecated": false, - "deprecationReason": null - } - ], - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "__Type", - "description": null, - "specifiedByUrl": null, - "fields": [ - { - "name": "name", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "description", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "specifiedByUrl", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "kind", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "ENUM", - "name": "__TypeKind", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "fields", - "description": null, - "args": [ - { - "name": "includeDeprecated", - "description": null, - "type": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - }, - "defaultValue": "false" - } - ], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "__Field", - "ofType": null - } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "ofType", - "description": null, - "args": [], - "type": { - "kind": "OBJECT", - "name": "__Type", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "inputFields", - "description": null, - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "__InputValue", - "ofType": null - } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "interfaces", - "description": null, - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "__Type", - "ofType": null - } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "possibleTypes", - "description": null, - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "__Type", - "ofType": null - } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "enumValues", - "description": null, - "args": [ - { - "name": "includeDeprecated", - "description": null, - "type": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - }, - "defaultValue": "false" - } - ], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "__EnumValue", - "ofType": null - } - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "Subscription", - "description": null, - "specifiedByUrl": null, - "fields": [ - { - "name": "queue", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "Queue", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "__Schema", - "description": null, - "specifiedByUrl": null, - "fields": [ - { - "name": "description", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "types", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "__Type", - "ofType": null - } - } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "queryType", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "__Type", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "mutationType", - "description": null, - "args": [], - "type": { - "kind": "OBJECT", - "name": "__Type", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "subscriptionType", - "description": null, - "args": [], - "type": { - "kind": "OBJECT", - "name": "__Type", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "directives", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "__Directive", - "ofType": null - } - } - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "SCALAR", - "name": "Int", - "description": null, - "specifiedByUrl": null, - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "Artist", - "description": null, - "specifiedByUrl": null, - "fields": [ - { - "name": "name", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "__EnumValue", - "description": null, - "specifiedByUrl": null, - "fields": [ - { - "name": "name", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "description", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "isDeprecated", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "deprecationReason", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "ItemList", - "description": null, - "specifiedByUrl": null, - "fields": [ - { - "name": "name", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "uuid", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "provider", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "tracks", - "description": null, - "args": [ - { - "name": "refresh", - "description": null, - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - } - }, - "defaultValue": null - } - ], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "Track", - "ofType": null - } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "children", - "description": null, - "args": [ - { - "name": "refresh", - "description": null, - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - } - }, - "defaultValue": null - } - ], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "ItemList", - "ofType": null - } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "isQueable", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "ENUM", - "name": "__DirectiveLocation", - "description": null, - "specifiedByUrl": null, - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": [ - { - "name": "QUERY", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "MUTATION", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "SUBSCRIPTION", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "FIELD", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "SCALAR", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "FRAGMENT_DEFINITION", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "FIELD_DEFINITION", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "VARIABLE_DEFINITION", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "FRAGMENT_SPREAD", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "INLINE_FRAGMENT", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "ENUM_VALUE", - "description": null, - "isDeprecated": false, - "deprecationReason": null - } - ], - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "Track", - "description": null, - "specifiedByUrl": null, - "fields": [ - { - "name": "title", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "uuid", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "duration", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "album", - "description": null, - "args": [], - "type": { - "kind": "OBJECT", - "name": "Album", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "artist", - "description": null, - "args": [], - "type": { - "kind": "OBJECT", - "name": "Artist", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "provider", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "__Directive", - "description": null, - "specifiedByUrl": null, - "fields": [ - { - "name": "name", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "description", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "locations", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "ENUM", - "name": "__DirectiveLocation", - "ofType": null - } - } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "isRepeatable", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "args", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "__InputValue", - "ofType": null - } - } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "onOperation", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - } - }, - "isDeprecated": true, - "deprecationReason": "Use the locations array instead" - }, - { - "name": "onFragment", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - } - }, - "isDeprecated": true, - "deprecationReason": "Use the locations array instead" - }, - { - "name": "onField", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - } - }, - "isDeprecated": true, - "deprecationReason": "Use the locations array instead" - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - } - ], - "directives": [ - { - "name": "include", - "description": null, - "isRepeatable": false, - "locations": [ - "FIELD", - "FRAGMENT_SPREAD", - "INLINE_FRAGMENT" - ], - "args": [ - { - "name": "if", - "description": null, - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - } - }, - "defaultValue": null - } - ] - }, - { - "name": "deprecated", - "description": null, - "isRepeatable": false, - "locations": [ - "FIELD_DEFINITION", - "ENUM_VALUE" - ], - "args": [ - { - "name": "reason", - "description": null, - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "defaultValue": null - } - ] - }, - { - "name": "specifiedBy", - "description": null, - "isRepeatable": false, - "locations": [ - "SCALAR" - ], - "args": [ - { - "name": "url", - "description": null, - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "defaultValue": null - } - ] - }, - { - "name": "skip", - "description": null, - "isRepeatable": false, - "locations": [ - "FIELD", - "FRAGMENT_SPREAD", - "INLINE_FRAGMENT" - ], - "args": [ - { - "name": "if", - "description": null, - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - } - }, - "defaultValue": null - } - ] - } - ] - } -} \ No newline at end of file