diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 43d65394..64d3cedd 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -127,7 +127,7 @@ jobs:
# The device tests and the ingest benchmark need a device and do not
# run here; the benchmark's APKs build.
- run: >
- gradle --no-daemon :baton-gradle:build :baton:build :baton:jvmRelayTest :baton:jvmFateTest
+ gradle --no-daemon :baton-gradle:build :baton:build :baton:jvmRelayTest :baton:jvmFateTest :baton:jvmAniListTest
:baton-testing:build :baton-inspector:build :baton-okhttp:build
:goldens:compileKotlinJvm :samples:shared:build :samples:desktop:build
:samples:exchange:build :samples:github:build :samples:android:assembleDebug
diff --git a/BENCHMARKS.md b/BENCHMARKS.md
index 2223e1e1..984ee143 100644
--- a/BENCHMARKS.md
+++ b/BENCHMARKS.md
@@ -21,6 +21,83 @@ Best ingest and best commit of the fixture at each release below.
+## Unreleased, the AniList list — 2026-10-18
+
+Revision: `c4b9078`. Machine: Apple M1 Pro (MacBook Pro), macOS 26.5.2,
+Xcode 26.6, Swift 6.3.3, release build; the JVM is OpenJDK 21.0.12.1
+(Homebrew) on the same machine. `swift run -c release BatonBenchmarks`,
+the whole suite, three runs, then `gradle :baton:runAniListBench`, the
+Kotlin twin of the suite's AniList section, two runs; best of the runs,
+the median of the medians in parentheses. Each JVM measurement takes as
+many warm-up rounds as samples before it samples. Not a quiet machine:
+the load average stood between 8 and 14 and other sessions were building.
+
+The fixture is `spec/anilist/`: two chunks of AniList's
+`MediaListCollection`, 500 entries each, 457,499 and 458,874 bytes,
+recorded from a public list and anonymized (`spec/anilist/README.md`);
+6,014 records after both. *Every field* is the row's fragment and its
+media's card, 44 slots an entry, 44,006 over the list; *five values* is
+the reading of the derived-state recipe's model, seven slots an entry.
+The save is entry 991's `progress` changed by a payload of the mutation's
+shape, committed with a body observing every row and a detail's body
+observing entry 991, which the lookup `MediaList(id:)` answers from the
+list's records.
+
+### The list into the store, the image and a launch
+
+| Measurement | Swift | Kotlin, the JVM |
+|---|---|---|
+| Ingest of a chunk of 500 entries, bytes → change set, per chunk | 1.81 ms (1.95) | 1.66 ms (1.79) |
+| Commit of both chunks into an empty store, 6,014 records | 5.26 ms (5.45) | 1.58 ms (2.01) |
+| Write-behind of both chunks, off the main actor or the store's thread | 5.92 ms (10.0) | 12.5 ms (16.3) |
+| The image after both chunks, closed | 811,008 bytes | 811,008 bytes |
+| A launch in a new process: open and hydrate at once, both handles ready | 21.6 ms (23.0) | 297 ms (307) |
+| The same, once the image has opened off the main actor | 18.1 ms (19.4) | 97.5 ms (101) |
+| The save's commit, 1,000 row bodies and a detail observing | 27.4 µs (34.0) | 108 µs (114) |
+| Notifications of that commit | 2 | 2 |
+
+The ingest of a 500-entry chunk is 3.6 µs an entry in Swift and 3.3 µs on
+the JVM. The commit of the two chunks is 0.87 µs a record in Swift,
+against 0.51 µs a record for the 899-record fixture in the same runs
+(462 µs). A launch from the
+image reaches both handles ready, 6,014 records hydrated, in 21.6 ms in
+Swift, 18.1 ms of it the hydration once the file is open: 3.0 µs a
+record. The JVM's launch is a new JVM, interpreting and loading classes
+as it goes, and says little of a launch on Android, which a device would
+measure. The save notifies the two bodies that read `progress` of
+`MediaList:991`, the row's and the detail's, and none of the other 999
+rows; the count is in `benchmarks/counts.txt`.
+
+### A reading of the whole list, tracked and untracked
+
+| Measurement | Swift | Kotlin, the JVM |
+|---|---|---|
+| Every field, untracked, the whole list | 891 µs (923) | 646 µs (849) |
+| The same, per field | 20.2 ns (21.0) | 13.6 ns (15.0) |
+| The first reading of a fresh store, untracked, its channels made | | 1.13 ms (1.33) |
+| Every field inside one tracking scope or read-observing snapshot, the whole list | 28.5 ms (29.9) | 2.56 ms (3.13) |
+| The same, per field | 647 ns (682) | 57.3 ns (62.5) |
+| One chunk's every field in its own scope, 500 entries | 14.2 ms (14.9) | 1.20 ms (1.27) |
+| One chunk's five values in its own scope | 2.57 ms (2.68) | 264 µs (293) |
+| Every field through `Observations` or `snapshotFlow`, made to its first value | 28.3 ms (29.8) | 2.16 ms (2.56) |
+| A one-field save in a chunk, the commit to that chunk's reading delivered, every field | 15.6 ms (16.1) | 1.16 ms (1.40) |
+| The same, the chunk read for five values | 2.70 ms (2.80) | 305 µs (377) |
+
+In the same Swift runs, the suite's untracked lens read was 20.3 ns a
+field and its tracked read of a row body of eight fields 585 ns (608).
+A tracked field in one scope over the whole list costs 647 ns, and 643 ns
+over one chunk: linear in the scope's size, and what a row body's field
+costs, about thirty untracked reads. That is Observation's registrar,
+an access registered with each record and an observer installed on it
+when the scope ends; through `Observations` the first value costs the same
+as the scope. On the JVM a tracked field is 57.3 ns, four untracked reads:
+Compose's read observer adds the slot's state to a set, and the channel,
+made at a slot's first read, is made by the untracked reading too, which
+costs 1.13 ms on a fresh store where a later one costs 646 µs. The
+composition's re-read after a save is the chunk's tracked reading and the
+delivery: 15.6 ms in Swift for every field, 2.70 ms for the model's five
+values.
+
## Unreleased, a streamed list — 2026-10-13
Revision: the working tree on top of `d027f18`; the runtime change was
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 22905f95..a8385f04 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -27,6 +27,51 @@ are expected and listed without apology.
a mutation's response moves the row with no updater, and carried by the
image to the next launch. The README, the docs index and the site link
them.
+- `docs/recipes/derived-state.md`, *A derivation over a whole operation*:
+ how a model that derives one value from every entry of a large
+ operation keeps the tracked reads off the launch and each change to one
+ chunk. One `Observations` or `snapshotFlow` per operation handle, the
+ first reading untracked and synchronous before the streams start, a
+ reading applied only when it differs from the last, and a closure that
+ reads only what the value needs. With the arithmetic to budget a pass of
+ N entries by M fields: a field read costs 20 ns untracked and 647 ns
+ tracked in Swift, and 14 and 57 ns on the JVM. The model is compiled on
+ both runtimes beside the AniList tests and proven by `ListModelTests`. No
+ coarser observation channel is added: per-slot registration is what the
+ store's principle rests on, and the record
+ [derived state is observed, not signaled](docs/decisions/derived-state-is-observed-not-signaled.md)
+ now names the operation-level and per-record channels as not chosen and
+ reopens on a whole-operation derivation the composition cannot keep in
+ budget at a measured size ([#53](https://github.com/shergin/baton/issues/53)).
+- `spec/anilist/`: a user's list recorded from AniList's public API, two
+ chunks of `MediaListCollection` of 500 entries each, with the SDL the API
+ answers to the standard introspection query. The user's id, the entries'
+ ids and the notes are anonymized; the rest is the server's bytes. Frozen
+ by one dump of 6,014 records on both runtimes, by the Swift target
+ `BatonAniListTests` and the Kotlin harness's `jvmAniListTest`, with an
+ entry answered by the lookup `MediaList(id:)` from the list's records and
+ a save that notifies the two bodies that read the field it changed
+ ([#51](https://github.com/shergin/baton/issues/51)).
+- Bench rows for that list on both runtimes, the AniList section of
+ `swift run -c release BatonBenchmarks` and its Kotlin twin
+ `gradle :baton:runAniListBench`: the ingest of a 500-entry chunk, 1.81 ms
+ in Swift; the image after both chunks, 811,008 bytes; a launch from it
+ to both handles ready, 21.6 ms; a one-field save's notifications, 2; and
+ a tracked reading of the whole list, 28.5 ms in Swift and 2.6 ms on the
+ JVM, against 0.89 and 0.65 ms untracked. Recorded in `BENCHMARKS.md`,
+ 18 October.
+- The test schema learns AniList's shapes: capitalized root fields, one
+ spelled like its type, an enum that grows behind a `version` argument,
+ and a union of twenty members with no interface. The goldens of both
+ emitters hold documents over them, and three cases,
+ `capitalized-roots-1`, `episode-status-1` and `notifications-1`, freeze
+ them at run time on both runtimes. A root field's accessor keeps its
+ spelling, `MediaListCollection`, and its lens takes a number,
+ `MediaListCollection2`.
+- AniList's schema is a second set of the compiler's goldens, Swift,
+ Kotlin and plans, compiled with its own configuration from the AniList
+ documents and built by a Swift target and the Kotlin goldens module of
+ their own.
## 0.17.0 (Kulich) — 2026-10-18
diff --git a/Package.swift b/Package.swift
index 9461c78c..ca61168e 100644
--- a/Package.swift
+++ b/Package.swift
@@ -92,7 +92,7 @@ let package = Package(
exclude: ["README.md", "runtime.md"],
sources: ["Spec.swift", "Manifest.swift"],
resources: [
- .copy("documents"), .copy("fate"), .copy("manifest.json"), .copy("relay"), .copy("rickandmorty"),
+ .copy("anilist"), .copy("documents"), .copy("fate"), .copy("manifest.json"), .copy("relay"), .copy("rickandmorty"),
.copy("scripts"), .copy("sources"), .copy("tests"), .copy("tokenizer"),
],
swiftSettings: [.swiftLanguageMode(.v6)]
@@ -122,6 +122,24 @@ let package = Package(
swiftSettings: [.swiftLanguageMode(.v6)],
plugins: ["BatonPlugin"]
),
+ // The documents of the list recorded from AniList under
+ // `spec/anilist/`, compiled against the schema recorded beside it,
+ // for the tests that freeze the recording and the bench that
+ // measures it.
+ .target(
+ name: "AniListDocuments",
+ dependencies: ["Baton"],
+ path: "swift/Tests/AniListDocuments",
+ exclude: ["baton.json"],
+ swiftSettings: [.swiftLanguageMode(.v6)],
+ plugins: ["BatonPlugin"]
+ ),
+ .testTarget(
+ name: "BatonAniListTests",
+ dependencies: ["AniListDocuments", "Baton", "BatonInspector", "BatonSpec", "BatonTesting"],
+ path: "swift/Tests/BatonAniListTests",
+ swiftSettings: [.swiftLanguageMode(.v6)]
+ ),
// The emitter's goldens, compiled as an app compiles them with the
// Xcode template's default of main-actor isolation: generated code
// states its isolation, so it builds under either default.
@@ -131,6 +149,15 @@ let package = Package(
path: "compiler/src/tests/goldens",
swiftSettings: [.swiftLanguageMode(.v6), .defaultIsolation(MainActor.self)]
),
+ // The goldens of the second schema, AniList's, compiled the same way
+ // in a module of their own, since each schema's shared file declares
+ // its own types and slots.
+ .testTarget(
+ name: "BatonAniListGoldenTests",
+ dependencies: ["Baton"],
+ path: "compiler/src/tests/goldens-anilist",
+ swiftSettings: [.swiftLanguageMode(.v6), .defaultIsolation(MainActor.self)]
+ ),
.testTarget(
name: "BatonMacrosTests",
dependencies: [
@@ -187,7 +214,7 @@ let package = Package(
),
.executableTarget(
name: "BatonBenchmarks",
- dependencies: ["Baton", "BatonTesting", "BatonSpec"],
+ dependencies: ["AniListDocuments", "Baton", "BatonTesting", "BatonSpec"],
path: "swift/Benchmarks",
swiftSettings: [.swiftLanguageMode(.v6)],
plugins: ["BatonPlugin"]
diff --git a/benchmarks/counts.txt b/benchmarks/counts.txt
index 1dd2aa03..01f2c9b3 100644
--- a/benchmarks/counts.txt
+++ b/benchmarks/counts.txt
@@ -15,3 +15,5 @@ count notifications-refetch-first-page 1
count log-events-during-edge-commits 0
count eviction-kept-the-last-launch 1
count eviction-dropped-the-older-launch 1
+count records-anilist-two-chunks 6014
+count notifications-anilist-save-one-field 2
diff --git a/compiler/src/tests/emit_tests.rs b/compiler/src/tests/emit_tests.rs
index b14ba8d5..d4eec098 100644
--- a/compiler/src/tests/emit_tests.rs
+++ b/compiler/src/tests/emit_tests.rs
@@ -6,7 +6,10 @@
//! goldens. Those
//! documents exist to exercise every directive the runtime's tests prove, so
//! they cover every shape the lowering and the emitter write, and a change to
-//! either shows up here as a diff to review.
+//! either shows up here as a diff to review. A second schema, AniList's, and
+//! the documents of the list recorded from it have goldens of their own,
+//! `goldens-anilist/`, `goldens-anilist-kotlin/` and `plans-anilist/`: a
+//! production schema's shapes, compiled with a configuration of their own.
//!
//! After an intended change, `BATON_BLESS=1 cargo test` rewrites the goldens.
@@ -92,13 +95,19 @@ fn compile_kotlin_tests() -> (Plan, BTreeMap>) {
/// named from the repository's root, with the package each Kotlin host
/// declares, by its source.
fn compile_sources(hosts: &[PathBuf]) -> (Plan, BTreeMap>) {
- let target = repository().join("swift/Tests/BatonTests");
+ compile_target(&repository().join("swift/Tests/BatonTests"), hosts)
+}
+
+/// The plan of a Swift target's sources, compiled with the `baton.json`
+/// beside them, and of `hosts`, named from the repository's root, with the
+/// package each Kotlin host declares, by its source.
+fn compile_target(target: &Path, hosts: &[PathBuf]) -> (Plan, BTreeMap>) {
let config_path = target.join("baton.json");
- let config = swift_tests_config();
+ let config = Config::load(&config_path).expect("the target has a baton.json");
let schema_path = config.schema_path(&config_path);
let schema = std::fs::read_to_string(&schema_path).expect("the test schema is readable");
- let mut sources: Vec = std::fs::read_dir(&target)
- .expect("the test target is readable")
+ let mut sources: Vec = std::fs::read_dir(target)
+ .expect("the target is readable")
.filter_map(|entry| entry.ok().map(|entry| entry.path()))
.filter(|path| {
path.extension()
@@ -199,6 +208,12 @@ fn plan_swift_tests() -> BTreeMap {
.retain(|fragment| fragment.source != hostile_names::CORPUS);
plan.operations
.retain(|operation| operation.source != hostile_names::CORPUS);
+ plan_by_source(&plan)
+}
+
+/// A plan as `batonc plan` prints it, one source's documents to a golden,
+/// each with the enums and inputs its own documents read or pass.
+fn plan_by_source(plan: &Plan) -> BTreeMap {
let mut by_source: BTreeMap = BTreeMap::new();
for fragment in &plan.fragments {
by_source
@@ -460,6 +475,119 @@ fn the_report_reproduces_its_golden_byte_for_byte() {
check_goldens(reports(), &report_swift_tests(), ".report.json");
}
+/// The Swift target of the documents of the list recorded from AniList under
+/// `spec/anilist/`, compiled against the schema AniList answered by
+/// introspection with the `baton.json` beside them.
+const ANILIST_TARGET: &str = "swift/Tests/AniListDocuments";
+
+/// The AniList documents' configuration.
+fn anilist_config() -> Config {
+ Config::load(&repository().join(ANILIST_TARGET).join("baton.json"))
+ .expect("the AniList target has a baton.json")
+}
+
+/// The plan of the AniList documents, named from the repository's root.
+fn compile_anilist() -> Plan {
+ compile_target(&repository().join(ANILIST_TARGET), &[]).0
+}
+
+/// The AniList documents' Swift goldens, which the Swift test target
+/// `BatonAniListGoldenTests` compiles.
+fn anilist_goldens() -> PathBuf {
+ Path::new(env!("CARGO_MANIFEST_DIR")).join("src/tests/goldens-anilist")
+}
+
+/// The AniList documents' Kotlin goldens, which the Gradle module
+/// `kotlin/goldens` compiles beside the first schema's, in a package of
+/// their own.
+fn anilist_kotlin_goldens() -> PathBuf {
+ Path::new(env!("CARGO_MANIFEST_DIR")).join("src/tests/goldens-anilist-kotlin")
+}
+
+/// The AniList documents' plan goldens.
+fn anilist_plans() -> PathBuf {
+ Path::new(env!("CARGO_MANIFEST_DIR")).join("src/tests/plans-anilist")
+}
+
+/// The Swift the AniList documents generate, by output name, the shared
+/// file among them.
+fn emit_anilist_swift() -> BTreeMap {
+ let output = swift(&compile_anilist(), &anilist_config()).unwrap_or_else(|duplicates| {
+ let messages: Vec = duplicates.iter().map(ToString::to_string).collect();
+ panic!(
+ "the AniList documents emit names twice:\n{}",
+ messages.join("\n")
+ )
+ });
+ let mut files: BTreeMap = output
+ .files
+ .into_iter()
+ .map(|(source, text)| (golden_name(&source, ".baton.swift"), text))
+ .collect();
+ files.insert("Baton.baton.swift".to_string(), output.shared);
+ files
+}
+
+/// The Kotlin the AniList documents generate under the package
+/// `baton.goldens.anilist`, by output name, the shared file among them.
+fn emit_anilist_kotlin() -> BTreeMap {
+ let mut config = anilist_config();
+ config.language = crate::config::Language::Kotlin;
+ config.kotlin = Some(crate::config::KotlinConfig {
+ package: Some("baton.goldens.anilist".to_string()),
+ });
+ let output = super::kotlin::kotlin(&compile_anilist(), &config, BTreeMap::new())
+ .unwrap_or_else(|duplicates| {
+ let messages: Vec = duplicates.iter().map(ToString::to_string).collect();
+ panic!(
+ "the AniList documents emit names twice in Kotlin:\n{}",
+ messages.join("\n")
+ )
+ });
+ let mut files: BTreeMap = output
+ .files
+ .into_iter()
+ .map(|(source, text)| (golden_name(&source, ".baton.kt"), text))
+ .collect();
+ files.insert("Baton.baton.kt".to_string(), output.shared);
+ files
+}
+
+#[test]
+fn the_swift_emitter_reproduces_the_anilist_goldens_byte_for_byte() {
+ check_goldens(anilist_goldens(), &emit_anilist_swift(), ".baton.swift");
+}
+
+#[test]
+fn the_kotlin_emitter_reproduces_the_anilist_goldens_byte_for_byte() {
+ check_goldens(
+ anilist_kotlin_goldens(),
+ &emit_anilist_kotlin(),
+ ".baton.kt",
+ );
+}
+
+#[test]
+fn the_plan_reproduces_the_anilist_goldens_byte_for_byte() {
+ check_goldens(
+ anilist_plans(),
+ &plan_by_source(&compile_anilist()),
+ ".plan.json",
+ );
+}
+
+#[test]
+fn compiling_the_anilist_documents_twice_emits_the_same_bytes() {
+ assert!(
+ emit_anilist_swift() == emit_anilist_swift(),
+ "two compilations of the AniList documents emitted different Swift"
+ );
+ assert!(
+ emit_anilist_kotlin() == emit_anilist_kotlin(),
+ "two compilations of the AniList documents emitted different Kotlin"
+ );
+}
+
#[test]
fn compiling_the_same_sources_twice_emits_the_same_bytes() {
assert!(
diff --git a/compiler/src/tests/goldens-anilist-kotlin/AniListDocuments.baton.kt b/compiler/src/tests/goldens-anilist-kotlin/AniListDocuments.baton.kt
new file mode 100644
index 00000000..42cb60fd
--- /dev/null
+++ b/compiler/src/tests/goldens-anilist-kotlin/AniListDocuments.baton.kt
@@ -0,0 +1,560 @@
+// Generated by batonc. Do not edit.
+@file:OptIn(baton.Generated::class)
+
+package baton.goldens.anilist
+
+import androidx.compose.runtime.Immutable
+import androidx.compose.runtime.Stable
+import baton.Anchor
+import baton.Document
+import baton.Generated
+import baton.Lens
+import baton.Lookup
+import baton.MutationAction
+import baton.MutationOperation
+import baton.MutationType
+import baton.OperationKind
+import baton.OperationType
+import baton.Payload
+import baton.Plan
+import baton.PlanField
+import baton.QueryOperation
+import baton.QueryType
+import baton.ScalarKind
+import baton.Selection
+import baton.StorageKey
+import baton.Variable
+import baton.Variables
+
+/** Lens for `fragment EntryRow_mediaList on MediaList`. */
+@Stable
+class EntryRow_mediaList(override val anchor: Anchor) : Lens {
+ val id: Int get() = anchor.requiredInt(Slots.MediaList.id)
+ val status: MediaListStatus? get() = anchor.enumValue(Slots.MediaList.status, MediaListStatus::of)
+ val progress: Int? get() = anchor.int(Slots.MediaList.progress)
+ val progressVolumes: Int? get() = anchor.int(Slots.MediaList.progressVolumes)
+ val score: Double? get() = anchor.double(Slots.MediaList.score)
+ val repeat: Int? get() = anchor.int(Slots.MediaList.repeat)
+ val priority: Int? get() = anchor.int(Slots.MediaList.priority)
+ val notes: String? get() = anchor.string(Slots.MediaList.notes)
+ val private: Boolean? get() = anchor.bool(Slots.MediaList.private)
+ val hiddenFromStatusLists: Boolean? get() = anchor.bool(Slots.MediaList.hiddenFromStatusLists)
+ val customLists: String? get() = anchor.string(Slots.MediaList.customLists_3a6c27)
+ val startedAt: StartedAt? get() = anchor.linked(Slots.MediaList.startedAt)?.let(::StartedAt)
+ val completedAt: CompletedAt? get() = anchor.linked(Slots.MediaList.completedAt)?.let(::CompletedAt)
+ val updatedAt: Int? get() = anchor.int(Slots.MediaList.updatedAt)
+ val media: Media? get() = anchor.linked(Slots.MediaList.media)?.let(::Media)
+ override fun equals(other: Any?): Boolean = other is EntryRow_mediaList && other.anchor == anchor
+ override fun hashCode(): Int = anchor.hashCode()
+
+ @Stable
+ class StartedAt(override val anchor: Anchor) : Lens {
+ val year: Int? get() = anchor.int(Slots.FuzzyDate.year)
+ val month: Int? get() = anchor.int(Slots.FuzzyDate.month)
+ val day: Int? get() = anchor.int(Slots.FuzzyDate.day)
+ override fun equals(other: Any?): Boolean = other is EntryRow_mediaList.StartedAt && other.anchor == anchor
+ override fun hashCode(): Int = anchor.hashCode()
+ }
+
+ @Stable
+ class CompletedAt(override val anchor: Anchor) : Lens {
+ val year: Int? get() = anchor.int(Slots.FuzzyDate.year)
+ val month: Int? get() = anchor.int(Slots.FuzzyDate.month)
+ val day: Int? get() = anchor.int(Slots.FuzzyDate.day)
+ override fun equals(other: Any?): Boolean = other is EntryRow_mediaList.CompletedAt && other.anchor == anchor
+ override fun hashCode(): Int = anchor.hashCode()
+ }
+
+ @Stable
+ class Media(override val anchor: Anchor) : Lens {
+ val id: Int get() = anchor.requiredInt(Slots.Media.id)
+ val mediaCard: MediaCard_media get() = MediaCard_media(anchor.entering())
+ override fun equals(other: Any?): Boolean = other is EntryRow_mediaList.Media && other.anchor == anchor
+ override fun hashCode(): Int = anchor.hashCode()
+ }
+}
+
+/** Lens for `fragment MediaCard_media on Media`. */
+@Stable
+class MediaCard_media(override val anchor: Anchor) : Lens {
+ val id: Int get() = anchor.requiredInt(Slots.Media.id)
+ val idMal: Int? get() = anchor.int(Slots.Media.idMal)
+ val type: MediaType? get() = anchor.enumValue(Slots.Media.type, MediaType::of)
+ val format: MediaFormat? get() = anchor.enumValue(Slots.Media.format, MediaFormat::of)
+ val status: MediaStatus? get() = anchor.enumValue(Slots.Media.status_98c3c3, MediaStatus::of)
+ val episodes: Int? get() = anchor.int(Slots.Media.episodes)
+ val chapters: Int? get() = anchor.int(Slots.Media.chapters)
+ val volumes: Int? get() = anchor.int(Slots.Media.volumes)
+ val duration: Int? get() = anchor.int(Slots.Media.duration)
+ val season: MediaSeason? get() = anchor.enumValue(Slots.Media.season, MediaSeason::of)
+ val seasonYear: Int? get() = anchor.int(Slots.Media.seasonYear)
+ val countryOfOrigin: String? get() = anchor.string(Slots.Media.countryOfOrigin)
+ val isAdult: Boolean? get() = anchor.bool(Slots.Media.isAdult)
+ val siteUrl: String? get() = anchor.string(Slots.Media.siteUrl)
+ val title: Title? get() = anchor.linked(Slots.Media.title)?.let(::Title)
+ val coverImage: CoverImage? get() = anchor.linked(Slots.Media.coverImage)?.let(::CoverImage)
+ val nextAiringEpisode: NextAiringEpisode? get() = anchor.linked(Slots.Media.nextAiringEpisode)?.let(::NextAiringEpisode)
+ override fun equals(other: Any?): Boolean = other is MediaCard_media && other.anchor == anchor
+ override fun hashCode(): Int = anchor.hashCode()
+
+ @Stable
+ class Title(override val anchor: Anchor) : Lens {
+ val romaji: String? get() = anchor.string(Slots.MediaTitle.romaji)
+ val english: String? get() = anchor.string(Slots.MediaTitle.english)
+ val native: String? get() = anchor.string(Slots.MediaTitle.native)
+ val userPreferred: String? get() = anchor.string(Slots.MediaTitle.userPreferred)
+ override fun equals(other: Any?): Boolean = other is MediaCard_media.Title && other.anchor == anchor
+ override fun hashCode(): Int = anchor.hashCode()
+ }
+
+ @Stable
+ class CoverImage(override val anchor: Anchor) : Lens {
+ val large: String? get() = anchor.string(Slots.MediaCoverImage.large)
+ val color: String? get() = anchor.string(Slots.MediaCoverImage.color)
+ override fun equals(other: Any?): Boolean = other is MediaCard_media.CoverImage && other.anchor == anchor
+ override fun hashCode(): Int = anchor.hashCode()
+ }
+
+ @Stable
+ class NextAiringEpisode(override val anchor: Anchor) : Lens {
+ val id: Int get() = anchor.requiredInt(Slots.AiringSchedule.id)
+ val episode: Int get() = anchor.requiredInt(Slots.AiringSchedule.episode)
+ val airingAt: Int get() = anchor.requiredInt(Slots.AiringSchedule.airingAt)
+ override fun equals(other: Any?): Boolean = other is MediaCard_media.NextAiringEpisode && other.anchor == anchor
+ override fun hashCode(): Int = anchor.hashCode()
+ }
+}
+
+/** Operation value for `query EntryQuery`. */
+@Immutable
+class EntryQuery(val id: Int) : QueryOperation {
+ override val variables: Variables
+ get() = Variables.of("id" to Variable.of(id))
+ override val type: OperationType get() = Companion
+
+ override fun equals(other: Any?): Boolean = other is EntryQuery && other.id == id
+ override fun hashCode(): Int = listOf(id).hashCode()
+
+ companion object : QueryType {
+ override val name = "EntryQuery"
+ override val document: Document = Document.Text("query EntryQuery(\$id:Int!){MediaList(id:\$id){id,...EntryRow_mediaList}}fragment EntryRow_mediaList on MediaList{id,status,progress,progressVolumes,score,repeat,priority,notes,private,hiddenFromStatusLists,customLists(asArray:true),startedAt{year,month,day},completedAt{year,month,day},updatedAt,media{id,...MediaCard_media}}fragment MediaCard_media on Media{id,idMal,type,format,status(version:2),episodes,chapters,volumes,duration,season,seasonYear,countryOfOrigin,isAdult,siteUrl,title{romaji,english,native,userPreferred},coverImage{large,color},nextAiringEpisode{id,episode,airingAt}}")
+ override val kind = OperationKind.QUERY
+ override val plan: Plan by lazy { Plan(root = `EntryQuery-plan`.selection0) }
+
+ override fun data(anchor: Anchor): Data = Data(anchor)
+ }
+
+ @Stable
+ class Data(override val anchor: Anchor) : Lens {
+ val MediaList: MediaList2? get() = anchor.linked(anchor.owner.slot(Slots.Query.MediaList_8bfff7))?.let(::MediaList2)
+ override fun equals(other: Any?): Boolean = other is EntryQuery.Data && other.anchor == anchor
+ override fun hashCode(): Int = anchor.hashCode()
+
+ @Stable
+ class MediaList2(override val anchor: Anchor) : Lens {
+ val id: Int get() = anchor.requiredInt(Slots.MediaList.id)
+ val entryRow: EntryRow_mediaList get() = EntryRow_mediaList(anchor.entering())
+ override fun equals(other: Any?): Boolean = other is EntryQuery.Data.MediaList2 && other.anchor == anchor
+ override fun hashCode(): Int = anchor.hashCode()
+ }
+ }
+}
+
+private object `EntryQuery-plan` {
+ val selection0: Selection by lazy {
+ Selection(type = Types.Query, key = listOf(), isAbstract = false, fields = listOf(
+ PlanField.linked("MediaList", key = StorageKey.Dynamic(Slots.Query.MediaList_8bfff7), plural = false, lookup = Lookup(type = Types.MediaList, key = listOf(Lookup.Key.Variable("id"))), selection = selection1),
+ ))
+ }
+ val selection1: Selection by lazy {
+ Selection(type = Types.MediaList, key = listOf("id"), isAbstract = false, fields = listOf(
+ PlanField.scalar("id", key = StorageKey.Fixed(Slots.MediaList.id), kind = ScalarKind.INT, list = false),
+ PlanField.scalar("status", key = StorageKey.Fixed(Slots.MediaList.status), kind = ScalarKind.STRING, list = false),
+ PlanField.scalar("progress", key = StorageKey.Fixed(Slots.MediaList.progress), kind = ScalarKind.INT, list = false),
+ PlanField.scalar("progressVolumes", key = StorageKey.Fixed(Slots.MediaList.progressVolumes), kind = ScalarKind.INT, list = false),
+ PlanField.scalar("score", key = StorageKey.Fixed(Slots.MediaList.score), kind = ScalarKind.DOUBLE, list = false),
+ PlanField.scalar("repeat", key = StorageKey.Fixed(Slots.MediaList.repeat), kind = ScalarKind.INT, list = false),
+ PlanField.scalar("priority", key = StorageKey.Fixed(Slots.MediaList.priority), kind = ScalarKind.INT, list = false),
+ PlanField.scalar("notes", key = StorageKey.Fixed(Slots.MediaList.notes), kind = ScalarKind.STRING, list = false),
+ PlanField.scalar("private", key = StorageKey.Fixed(Slots.MediaList.private), kind = ScalarKind.BOOL, list = false),
+ PlanField.scalar("hiddenFromStatusLists", key = StorageKey.Fixed(Slots.MediaList.hiddenFromStatusLists), kind = ScalarKind.BOOL, list = false),
+ PlanField.scalar("customLists", key = StorageKey.Fixed(Slots.MediaList.customLists_3a6c27), kind = ScalarKind.CUSTOM, list = false),
+ PlanField.linked("startedAt", key = StorageKey.Fixed(Slots.MediaList.startedAt), plural = false, selection = selection6),
+ PlanField.linked("completedAt", key = StorageKey.Fixed(Slots.MediaList.completedAt), plural = false, selection = selection6),
+ PlanField.scalar("updatedAt", key = StorageKey.Fixed(Slots.MediaList.updatedAt), kind = ScalarKind.INT, list = false),
+ PlanField.linked("media", key = StorageKey.Fixed(Slots.MediaList.media), plural = false, selection = selection2),
+ ))
+ }
+ val selection2: Selection by lazy {
+ Selection(type = Types.Media, key = listOf("id"), isAbstract = false, fields = listOf(
+ PlanField.scalar("id", key = StorageKey.Fixed(Slots.Media.id), kind = ScalarKind.INT, list = false),
+ PlanField.scalar("idMal", key = StorageKey.Fixed(Slots.Media.idMal), kind = ScalarKind.INT, list = false),
+ PlanField.scalar("type", key = StorageKey.Fixed(Slots.Media.type), kind = ScalarKind.STRING, list = false),
+ PlanField.scalar("format", key = StorageKey.Fixed(Slots.Media.format), kind = ScalarKind.STRING, list = false),
+ PlanField.scalar("status", key = StorageKey.Fixed(Slots.Media.status_98c3c3), kind = ScalarKind.STRING, list = false),
+ PlanField.scalar("episodes", key = StorageKey.Fixed(Slots.Media.episodes), kind = ScalarKind.INT, list = false),
+ PlanField.scalar("chapters", key = StorageKey.Fixed(Slots.Media.chapters), kind = ScalarKind.INT, list = false),
+ PlanField.scalar("volumes", key = StorageKey.Fixed(Slots.Media.volumes), kind = ScalarKind.INT, list = false),
+ PlanField.scalar("duration", key = StorageKey.Fixed(Slots.Media.duration), kind = ScalarKind.INT, list = false),
+ PlanField.scalar("season", key = StorageKey.Fixed(Slots.Media.season), kind = ScalarKind.STRING, list = false),
+ PlanField.scalar("seasonYear", key = StorageKey.Fixed(Slots.Media.seasonYear), kind = ScalarKind.INT, list = false),
+ PlanField.scalar("countryOfOrigin", key = StorageKey.Fixed(Slots.Media.countryOfOrigin), kind = ScalarKind.CUSTOM, list = false),
+ PlanField.scalar("isAdult", key = StorageKey.Fixed(Slots.Media.isAdult), kind = ScalarKind.BOOL, list = false),
+ PlanField.scalar("siteUrl", key = StorageKey.Fixed(Slots.Media.siteUrl), kind = ScalarKind.STRING, list = false),
+ PlanField.linked("title", key = StorageKey.Fixed(Slots.Media.title), plural = false, selection = selection5),
+ PlanField.linked("coverImage", key = StorageKey.Fixed(Slots.Media.coverImage), plural = false, selection = selection4),
+ PlanField.linked("nextAiringEpisode", key = StorageKey.Fixed(Slots.Media.nextAiringEpisode), plural = false, selection = selection3),
+ ))
+ }
+ val selection3: Selection by lazy {
+ Selection(type = Types.AiringSchedule, key = listOf("id"), isAbstract = false, fields = listOf(
+ PlanField.scalar("id", key = StorageKey.Fixed(Slots.AiringSchedule.id), kind = ScalarKind.INT, list = false),
+ PlanField.scalar("episode", key = StorageKey.Fixed(Slots.AiringSchedule.episode), kind = ScalarKind.INT, list = false),
+ PlanField.scalar("airingAt", key = StorageKey.Fixed(Slots.AiringSchedule.airingAt), kind = ScalarKind.INT, list = false),
+ ))
+ }
+ val selection4: Selection by lazy {
+ Selection(type = Types.MediaCoverImage, key = listOf(), isAbstract = false, fields = listOf(
+ PlanField.scalar("large", key = StorageKey.Fixed(Slots.MediaCoverImage.large), kind = ScalarKind.STRING, list = false),
+ PlanField.scalar("color", key = StorageKey.Fixed(Slots.MediaCoverImage.color), kind = ScalarKind.STRING, list = false),
+ ))
+ }
+ val selection5: Selection by lazy {
+ Selection(type = Types.MediaTitle, key = listOf(), isAbstract = false, fields = listOf(
+ PlanField.scalar("romaji", key = StorageKey.Fixed(Slots.MediaTitle.romaji), kind = ScalarKind.STRING, list = false),
+ PlanField.scalar("english", key = StorageKey.Fixed(Slots.MediaTitle.english), kind = ScalarKind.STRING, list = false),
+ PlanField.scalar("native", key = StorageKey.Fixed(Slots.MediaTitle.native), kind = ScalarKind.STRING, list = false),
+ PlanField.scalar("userPreferred", key = StorageKey.Fixed(Slots.MediaTitle.userPreferred), kind = ScalarKind.STRING, list = false),
+ ))
+ }
+ val selection6: Selection by lazy {
+ Selection(type = Types.FuzzyDate, key = listOf(), isAbstract = false, fields = listOf(
+ PlanField.scalar("year", key = StorageKey.Fixed(Slots.FuzzyDate.year), kind = ScalarKind.INT, list = false),
+ PlanField.scalar("month", key = StorageKey.Fixed(Slots.FuzzyDate.month), kind = ScalarKind.INT, list = false),
+ PlanField.scalar("day", key = StorageKey.Fixed(Slots.FuzzyDate.day), kind = ScalarKind.INT, list = false),
+ ))
+ }
+}
+
+/** Operation value for `query ListQuery`. */
+@Immutable
+class ListQuery(val userId: Int, val mediaType: MediaType, val chunk: Int) : QueryOperation {
+ override val variables: Variables
+ get() = Variables.of("userId" to Variable.of(userId), "mediaType" to Variable.of(mediaType), "chunk" to Variable.of(chunk))
+ override val type: OperationType get() = Companion
+
+ override fun equals(other: Any?): Boolean = other is ListQuery && other.userId == userId && other.mediaType == mediaType && other.chunk == chunk
+ override fun hashCode(): Int = listOf(userId, mediaType, chunk).hashCode()
+
+ companion object : QueryType {
+ override val name = "ListQuery"
+ override val document: Document = Document.Text("query ListQuery(\$userId:Int!,\$mediaType:MediaType!,\$chunk:Int!){MediaListCollection(userId:\$userId,type:\$mediaType,chunk:\$chunk,perChunk:500,forceSingleCompletedList:true){hasNextChunk,lists{name,isCustomList,status,entries{id,...EntryRow_mediaList}}}}fragment EntryRow_mediaList on MediaList{id,status,progress,progressVolumes,score,repeat,priority,notes,private,hiddenFromStatusLists,customLists(asArray:true),startedAt{year,month,day},completedAt{year,month,day},updatedAt,media{id,...MediaCard_media}}fragment MediaCard_media on Media{id,idMal,type,format,status(version:2),episodes,chapters,volumes,duration,season,seasonYear,countryOfOrigin,isAdult,siteUrl,title{romaji,english,native,userPreferred},coverImage{large,color},nextAiringEpisode{id,episode,airingAt}}")
+ override val kind = OperationKind.QUERY
+ override val plan: Plan by lazy { Plan(root = `ListQuery-plan`.selection0) }
+
+ override fun data(anchor: Anchor): Data = Data(anchor)
+ }
+
+ @Stable
+ class Data(override val anchor: Anchor) : Lens {
+ val MediaListCollection: MediaListCollection2? get() = anchor.linked(anchor.owner.slot(Slots.Query.MediaListCollection_fc1216))?.let(::MediaListCollection2)
+ override fun equals(other: Any?): Boolean = other is ListQuery.Data && other.anchor == anchor
+ override fun hashCode(): Int = anchor.hashCode()
+
+ @Stable
+ class MediaListCollection2(override val anchor: Anchor) : Lens {
+ val hasNextChunk: Boolean? get() = anchor.bool(Slots.MediaListCollection.hasNextChunk)
+ val lists: List? get() = anchor.list(Slots.MediaListCollection.lists, ::Lists)
+ override fun equals(other: Any?): Boolean = other is ListQuery.Data.MediaListCollection2 && other.anchor == anchor
+ override fun hashCode(): Int = anchor.hashCode()
+
+ @Stable
+ class Lists(override val anchor: Anchor) : Lens {
+ val name: String? get() = anchor.string(Slots.MediaListGroup.name)
+ val isCustomList: Boolean? get() = anchor.bool(Slots.MediaListGroup.isCustomList)
+ val status: MediaListStatus? get() = anchor.enumValue(Slots.MediaListGroup.status, MediaListStatus::of)
+ val entries: List? get() = anchor.list(Slots.MediaListGroup.entries, ::Entries)
+ override fun equals(other: Any?): Boolean = other is ListQuery.Data.MediaListCollection2.Lists && other.anchor == anchor
+ override fun hashCode(): Int = anchor.hashCode()
+
+ @Stable
+ class Entries(override val anchor: Anchor) : Lens {
+ val id: Int get() = anchor.requiredInt(Slots.MediaList.id)
+ val entryRow: EntryRow_mediaList get() = EntryRow_mediaList(anchor.entering())
+ override fun equals(other: Any?): Boolean = other is ListQuery.Data.MediaListCollection2.Lists.Entries && other.anchor == anchor
+ override fun hashCode(): Int = anchor.hashCode()
+ }
+ }
+ }
+ }
+}
+
+private object `ListQuery-plan` {
+ val selection0: Selection by lazy {
+ Selection(type = Types.Query, key = listOf(), isAbstract = false, fields = listOf(
+ PlanField.linked("MediaListCollection", key = StorageKey.Dynamic(Slots.Query.MediaListCollection_fc1216), plural = false, selection = selection1),
+ ))
+ }
+ val selection1: Selection by lazy {
+ Selection(type = Types.MediaListCollection, key = listOf(), isAbstract = false, fields = listOf(
+ PlanField.scalar("hasNextChunk", key = StorageKey.Fixed(Slots.MediaListCollection.hasNextChunk), kind = ScalarKind.BOOL, list = false),
+ PlanField.linked("lists", key = StorageKey.Fixed(Slots.MediaListCollection.lists), plural = true, selection = selection2),
+ ))
+ }
+ val selection2: Selection by lazy {
+ Selection(type = Types.MediaListGroup, key = listOf(), isAbstract = false, fields = listOf(
+ PlanField.scalar("name", key = StorageKey.Fixed(Slots.MediaListGroup.name), kind = ScalarKind.STRING, list = false),
+ PlanField.scalar("isCustomList", key = StorageKey.Fixed(Slots.MediaListGroup.isCustomList), kind = ScalarKind.BOOL, list = false),
+ PlanField.scalar("status", key = StorageKey.Fixed(Slots.MediaListGroup.status), kind = ScalarKind.STRING, list = false),
+ PlanField.linked("entries", key = StorageKey.Fixed(Slots.MediaListGroup.entries), plural = true, selection = selection3),
+ ))
+ }
+ val selection3: Selection by lazy {
+ Selection(type = Types.MediaList, key = listOf("id"), isAbstract = false, fields = listOf(
+ PlanField.scalar("id", key = StorageKey.Fixed(Slots.MediaList.id), kind = ScalarKind.INT, list = false),
+ PlanField.scalar("status", key = StorageKey.Fixed(Slots.MediaList.status), kind = ScalarKind.STRING, list = false),
+ PlanField.scalar("progress", key = StorageKey.Fixed(Slots.MediaList.progress), kind = ScalarKind.INT, list = false),
+ PlanField.scalar("progressVolumes", key = StorageKey.Fixed(Slots.MediaList.progressVolumes), kind = ScalarKind.INT, list = false),
+ PlanField.scalar("score", key = StorageKey.Fixed(Slots.MediaList.score), kind = ScalarKind.DOUBLE, list = false),
+ PlanField.scalar("repeat", key = StorageKey.Fixed(Slots.MediaList.repeat), kind = ScalarKind.INT, list = false),
+ PlanField.scalar("priority", key = StorageKey.Fixed(Slots.MediaList.priority), kind = ScalarKind.INT, list = false),
+ PlanField.scalar("notes", key = StorageKey.Fixed(Slots.MediaList.notes), kind = ScalarKind.STRING, list = false),
+ PlanField.scalar("private", key = StorageKey.Fixed(Slots.MediaList.private), kind = ScalarKind.BOOL, list = false),
+ PlanField.scalar("hiddenFromStatusLists", key = StorageKey.Fixed(Slots.MediaList.hiddenFromStatusLists), kind = ScalarKind.BOOL, list = false),
+ PlanField.scalar("customLists", key = StorageKey.Fixed(Slots.MediaList.customLists_3a6c27), kind = ScalarKind.CUSTOM, list = false),
+ PlanField.linked("startedAt", key = StorageKey.Fixed(Slots.MediaList.startedAt), plural = false, selection = selection8),
+ PlanField.linked("completedAt", key = StorageKey.Fixed(Slots.MediaList.completedAt), plural = false, selection = selection8),
+ PlanField.scalar("updatedAt", key = StorageKey.Fixed(Slots.MediaList.updatedAt), kind = ScalarKind.INT, list = false),
+ PlanField.linked("media", key = StorageKey.Fixed(Slots.MediaList.media), plural = false, selection = selection4),
+ ))
+ }
+ val selection4: Selection by lazy {
+ Selection(type = Types.Media, key = listOf("id"), isAbstract = false, fields = listOf(
+ PlanField.scalar("id", key = StorageKey.Fixed(Slots.Media.id), kind = ScalarKind.INT, list = false),
+ PlanField.scalar("idMal", key = StorageKey.Fixed(Slots.Media.idMal), kind = ScalarKind.INT, list = false),
+ PlanField.scalar("type", key = StorageKey.Fixed(Slots.Media.type), kind = ScalarKind.STRING, list = false),
+ PlanField.scalar("format", key = StorageKey.Fixed(Slots.Media.format), kind = ScalarKind.STRING, list = false),
+ PlanField.scalar("status", key = StorageKey.Fixed(Slots.Media.status_98c3c3), kind = ScalarKind.STRING, list = false),
+ PlanField.scalar("episodes", key = StorageKey.Fixed(Slots.Media.episodes), kind = ScalarKind.INT, list = false),
+ PlanField.scalar("chapters", key = StorageKey.Fixed(Slots.Media.chapters), kind = ScalarKind.INT, list = false),
+ PlanField.scalar("volumes", key = StorageKey.Fixed(Slots.Media.volumes), kind = ScalarKind.INT, list = false),
+ PlanField.scalar("duration", key = StorageKey.Fixed(Slots.Media.duration), kind = ScalarKind.INT, list = false),
+ PlanField.scalar("season", key = StorageKey.Fixed(Slots.Media.season), kind = ScalarKind.STRING, list = false),
+ PlanField.scalar("seasonYear", key = StorageKey.Fixed(Slots.Media.seasonYear), kind = ScalarKind.INT, list = false),
+ PlanField.scalar("countryOfOrigin", key = StorageKey.Fixed(Slots.Media.countryOfOrigin), kind = ScalarKind.CUSTOM, list = false),
+ PlanField.scalar("isAdult", key = StorageKey.Fixed(Slots.Media.isAdult), kind = ScalarKind.BOOL, list = false),
+ PlanField.scalar("siteUrl", key = StorageKey.Fixed(Slots.Media.siteUrl), kind = ScalarKind.STRING, list = false),
+ PlanField.linked("title", key = StorageKey.Fixed(Slots.Media.title), plural = false, selection = selection7),
+ PlanField.linked("coverImage", key = StorageKey.Fixed(Slots.Media.coverImage), plural = false, selection = selection6),
+ PlanField.linked("nextAiringEpisode", key = StorageKey.Fixed(Slots.Media.nextAiringEpisode), plural = false, selection = selection5),
+ ))
+ }
+ val selection5: Selection by lazy {
+ Selection(type = Types.AiringSchedule, key = listOf("id"), isAbstract = false, fields = listOf(
+ PlanField.scalar("id", key = StorageKey.Fixed(Slots.AiringSchedule.id), kind = ScalarKind.INT, list = false),
+ PlanField.scalar("episode", key = StorageKey.Fixed(Slots.AiringSchedule.episode), kind = ScalarKind.INT, list = false),
+ PlanField.scalar("airingAt", key = StorageKey.Fixed(Slots.AiringSchedule.airingAt), kind = ScalarKind.INT, list = false),
+ ))
+ }
+ val selection6: Selection by lazy {
+ Selection(type = Types.MediaCoverImage, key = listOf(), isAbstract = false, fields = listOf(
+ PlanField.scalar("large", key = StorageKey.Fixed(Slots.MediaCoverImage.large), kind = ScalarKind.STRING, list = false),
+ PlanField.scalar("color", key = StorageKey.Fixed(Slots.MediaCoverImage.color), kind = ScalarKind.STRING, list = false),
+ ))
+ }
+ val selection7: Selection by lazy {
+ Selection(type = Types.MediaTitle, key = listOf(), isAbstract = false, fields = listOf(
+ PlanField.scalar("romaji", key = StorageKey.Fixed(Slots.MediaTitle.romaji), kind = ScalarKind.STRING, list = false),
+ PlanField.scalar("english", key = StorageKey.Fixed(Slots.MediaTitle.english), kind = ScalarKind.STRING, list = false),
+ PlanField.scalar("native", key = StorageKey.Fixed(Slots.MediaTitle.native), kind = ScalarKind.STRING, list = false),
+ PlanField.scalar("userPreferred", key = StorageKey.Fixed(Slots.MediaTitle.userPreferred), kind = ScalarKind.STRING, list = false),
+ ))
+ }
+ val selection8: Selection by lazy {
+ Selection(type = Types.FuzzyDate, key = listOf(), isAbstract = false, fields = listOf(
+ PlanField.scalar("year", key = StorageKey.Fixed(Slots.FuzzyDate.year), kind = ScalarKind.INT, list = false),
+ PlanField.scalar("month", key = StorageKey.Fixed(Slots.FuzzyDate.month), kind = ScalarKind.INT, list = false),
+ PlanField.scalar("day", key = StorageKey.Fixed(Slots.FuzzyDate.day), kind = ScalarKind.INT, list = false),
+ ))
+ }
+}
+
+/** Operation value for `mutation SaveEntryMutation`. */
+@Immutable
+class SaveEntryMutation(val id: Int? = null, val progress: Int? = null) : MutationOperation {
+ override val variables: Variables
+ get() = Variables.of("id" to id?.let { Variable.of(it) }, "progress" to progress?.let { Variable.of(it) })
+ override val type: OperationType get() = Companion
+
+ override fun equals(other: Any?): Boolean = other is SaveEntryMutation && other.id == id && other.progress == progress
+ override fun hashCode(): Int = listOf(id, progress).hashCode()
+
+ companion object : MutationType {
+ override val name = "SaveEntryMutation"
+ override val document: Document = Document.Text("mutation SaveEntryMutation(\$id:Int,\$progress:Int){SaveMediaListEntry(id:\$id,progress:\$progress){id,...EntryRow_mediaList}}fragment EntryRow_mediaList on MediaList{id,status,progress,progressVolumes,score,repeat,priority,notes,private,hiddenFromStatusLists,customLists(asArray:true),startedAt{year,month,day},completedAt{year,month,day},updatedAt,media{id,...MediaCard_media}}fragment MediaCard_media on Media{id,idMal,type,format,status(version:2),episodes,chapters,volumes,duration,season,seasonYear,countryOfOrigin,isAdult,siteUrl,title{romaji,english,native,userPreferred},coverImage{large,color},nextAiringEpisode{id,episode,airingAt}}")
+ override val kind = OperationKind.MUTATION
+ override val plan: Plan by lazy { Plan(root = `SaveEntryMutation-plan`.selection0) }
+
+ override fun data(anchor: Anchor): Data = Data(anchor)
+ }
+
+ @Stable
+ class Data(override val anchor: Anchor) : Lens {
+ val SaveMediaListEntry: SaveMediaListEntry2? get() = anchor.linked(Slots.Mutation.SaveMediaListEntry)?.let(::SaveMediaListEntry2)
+ override fun equals(other: Any?): Boolean = other is SaveEntryMutation.Data && other.anchor == anchor
+ override fun hashCode(): Int = anchor.hashCode()
+
+ @Stable
+ class SaveMediaListEntry2(override val anchor: Anchor) : Lens {
+ val id: Int get() = anchor.requiredInt(Slots.MediaList.id)
+ val entryRow: EntryRow_mediaList get() = EntryRow_mediaList(anchor.entering())
+ override fun equals(other: Any?): Boolean = other is SaveEntryMutation.Data.SaveMediaListEntry2 && other.anchor == anchor
+ override fun hashCode(): Int = anchor.hashCode()
+ }
+ }
+
+ /** A partial response to show before the server answers; absent fields leave the store untouched. */
+ class OptimisticResponse(val SaveMediaListEntry: SaveMediaListEntry2? = null) {
+ /** The response's data as a variable, an absent field left out. */
+ @Generated
+ val variable: Variable
+ get() = Variable.Object(Variables.of("SaveMediaListEntry" to this.SaveMediaListEntry?.variable).values)
+ /** The response this builder describes, as the bytes the door takes. */
+ val payload: Payload get() = Payload(data = variable)
+
+ /** A partial response to show before the server answers; absent fields leave the store untouched. */
+ class SaveMediaListEntry2(val id: Int? = null, val status: MediaListStatus? = null, val progress: Int? = null, val progressVolumes: Int? = null, val score: Double? = null, val repeat: Int? = null, val priority: Int? = null, val notes: String? = null, val private: Boolean? = null, val hiddenFromStatusLists: Boolean? = null, val customLists: String? = null, val startedAt: StartedAt? = null, val completedAt: CompletedAt? = null, val updatedAt: Int? = null, val media: Media? = null) {
+ /** The response's data as a variable, an absent field left out. */
+ @Generated
+ val variable: Variable
+ get() = Variable.Object(Variables.of("id" to this.id?.let { Variable.of(it) }, "status" to this.status?.let { Variable.of(it) }, "progress" to this.progress?.let { Variable.of(it) }, "progressVolumes" to this.progressVolumes?.let { Variable.of(it) }, "score" to this.score?.let { Variable.of(it) }, "repeat" to this.repeat?.let { Variable.of(it) }, "priority" to this.priority?.let { Variable.of(it) }, "notes" to this.notes?.let { Variable.of(it) }, "private" to this.private?.let { Variable.of(it) }, "hiddenFromStatusLists" to this.hiddenFromStatusLists?.let { Variable.of(it) }, "customLists" to this.customLists?.let { Variable.of(it) }, "startedAt" to this.startedAt?.variable, "completedAt" to this.completedAt?.variable, "updatedAt" to this.updatedAt?.let { Variable.of(it) }, "media" to this.media?.variable).values)
+
+ /** A partial response to show before the server answers; absent fields leave the store untouched. */
+ class StartedAt(val year: Int? = null, val month: Int? = null, val day: Int? = null) {
+ /** The response's data as a variable, an absent field left out. */
+ @Generated
+ val variable: Variable
+ get() = Variable.Object(Variables.of("year" to this.year?.let { Variable.of(it) }, "month" to this.month?.let { Variable.of(it) }, "day" to this.day?.let { Variable.of(it) }).values)
+ }
+
+ /** A partial response to show before the server answers; absent fields leave the store untouched. */
+ class CompletedAt(val year: Int? = null, val month: Int? = null, val day: Int? = null) {
+ /** The response's data as a variable, an absent field left out. */
+ @Generated
+ val variable: Variable
+ get() = Variable.Object(Variables.of("year" to this.year?.let { Variable.of(it) }, "month" to this.month?.let { Variable.of(it) }, "day" to this.day?.let { Variable.of(it) }).values)
+ }
+
+ /** A partial response to show before the server answers; absent fields leave the store untouched. */
+ class Media(val id: Int? = null, val idMal: Int? = null, val type: MediaType? = null, val format: MediaFormat? = null, val status: MediaStatus? = null, val episodes: Int? = null, val chapters: Int? = null, val volumes: Int? = null, val duration: Int? = null, val season: MediaSeason? = null, val seasonYear: Int? = null, val countryOfOrigin: String? = null, val isAdult: Boolean? = null, val siteUrl: String? = null, val title: Title? = null, val coverImage: CoverImage? = null, val nextAiringEpisode: NextAiringEpisode? = null) {
+ /** The response's data as a variable, an absent field left out. */
+ @Generated
+ val variable: Variable
+ get() = Variable.Object(Variables.of("id" to this.id?.let { Variable.of(it) }, "idMal" to this.idMal?.let { Variable.of(it) }, "type" to this.type?.let { Variable.of(it) }, "format" to this.format?.let { Variable.of(it) }, "status" to this.status?.let { Variable.of(it) }, "episodes" to this.episodes?.let { Variable.of(it) }, "chapters" to this.chapters?.let { Variable.of(it) }, "volumes" to this.volumes?.let { Variable.of(it) }, "duration" to this.duration?.let { Variable.of(it) }, "season" to this.season?.let { Variable.of(it) }, "seasonYear" to this.seasonYear?.let { Variable.of(it) }, "countryOfOrigin" to this.countryOfOrigin?.let { Variable.of(it) }, "isAdult" to this.isAdult?.let { Variable.of(it) }, "siteUrl" to this.siteUrl?.let { Variable.of(it) }, "title" to this.title?.variable, "coverImage" to this.coverImage?.variable, "nextAiringEpisode" to this.nextAiringEpisode?.variable).values)
+
+ /** A partial response to show before the server answers; absent fields leave the store untouched. */
+ class Title(val romaji: String? = null, val english: String? = null, val native: String? = null, val userPreferred: String? = null) {
+ /** The response's data as a variable, an absent field left out. */
+ @Generated
+ val variable: Variable
+ get() = Variable.Object(Variables.of("romaji" to this.romaji?.let { Variable.of(it) }, "english" to this.english?.let { Variable.of(it) }, "native" to this.native?.let { Variable.of(it) }, "userPreferred" to this.userPreferred?.let { Variable.of(it) }).values)
+ }
+
+ /** A partial response to show before the server answers; absent fields leave the store untouched. */
+ class CoverImage(val large: String? = null, val color: String? = null) {
+ /** The response's data as a variable, an absent field left out. */
+ @Generated
+ val variable: Variable
+ get() = Variable.Object(Variables.of("large" to this.large?.let { Variable.of(it) }, "color" to this.color?.let { Variable.of(it) }).values)
+ }
+
+ /** A partial response to show before the server answers; absent fields leave the store untouched. */
+ class NextAiringEpisode(val id: Int? = null, val episode: Int? = null, val airingAt: Int? = null) {
+ /** The response's data as a variable, an absent field left out. */
+ @Generated
+ val variable: Variable
+ get() = Variable.Object(Variables.of("id" to this.id?.let { Variable.of(it) }, "episode" to this.episode?.let { Variable.of(it) }, "airingAt" to this.airingAt?.let { Variable.of(it) }).values)
+ }
+ }
+ }
+ }
+}
+
+private object `SaveEntryMutation-plan` {
+ val selection0: Selection by lazy {
+ Selection(type = Types.Mutation, key = listOf(), isAbstract = false, fields = listOf(
+ PlanField.linked("SaveMediaListEntry", key = StorageKey.Fixed(Slots.Mutation.SaveMediaListEntry), plural = false, selection = selection1),
+ ))
+ }
+ val selection1: Selection by lazy {
+ Selection(type = Types.MediaList, key = listOf("id"), isAbstract = false, fields = listOf(
+ PlanField.scalar("id", key = StorageKey.Fixed(Slots.MediaList.id), kind = ScalarKind.INT, list = false),
+ PlanField.scalar("status", key = StorageKey.Fixed(Slots.MediaList.status), kind = ScalarKind.STRING, list = false),
+ PlanField.scalar("progress", key = StorageKey.Fixed(Slots.MediaList.progress), kind = ScalarKind.INT, list = false),
+ PlanField.scalar("progressVolumes", key = StorageKey.Fixed(Slots.MediaList.progressVolumes), kind = ScalarKind.INT, list = false),
+ PlanField.scalar("score", key = StorageKey.Fixed(Slots.MediaList.score), kind = ScalarKind.DOUBLE, list = false),
+ PlanField.scalar("repeat", key = StorageKey.Fixed(Slots.MediaList.repeat), kind = ScalarKind.INT, list = false),
+ PlanField.scalar("priority", key = StorageKey.Fixed(Slots.MediaList.priority), kind = ScalarKind.INT, list = false),
+ PlanField.scalar("notes", key = StorageKey.Fixed(Slots.MediaList.notes), kind = ScalarKind.STRING, list = false),
+ PlanField.scalar("private", key = StorageKey.Fixed(Slots.MediaList.private), kind = ScalarKind.BOOL, list = false),
+ PlanField.scalar("hiddenFromStatusLists", key = StorageKey.Fixed(Slots.MediaList.hiddenFromStatusLists), kind = ScalarKind.BOOL, list = false),
+ PlanField.scalar("customLists", key = StorageKey.Fixed(Slots.MediaList.customLists_3a6c27), kind = ScalarKind.CUSTOM, list = false),
+ PlanField.linked("startedAt", key = StorageKey.Fixed(Slots.MediaList.startedAt), plural = false, selection = selection6),
+ PlanField.linked("completedAt", key = StorageKey.Fixed(Slots.MediaList.completedAt), plural = false, selection = selection6),
+ PlanField.scalar("updatedAt", key = StorageKey.Fixed(Slots.MediaList.updatedAt), kind = ScalarKind.INT, list = false),
+ PlanField.linked("media", key = StorageKey.Fixed(Slots.MediaList.media), plural = false, selection = selection2),
+ ))
+ }
+ val selection2: Selection by lazy {
+ Selection(type = Types.Media, key = listOf("id"), isAbstract = false, fields = listOf(
+ PlanField.scalar("id", key = StorageKey.Fixed(Slots.Media.id), kind = ScalarKind.INT, list = false),
+ PlanField.scalar("idMal", key = StorageKey.Fixed(Slots.Media.idMal), kind = ScalarKind.INT, list = false),
+ PlanField.scalar("type", key = StorageKey.Fixed(Slots.Media.type), kind = ScalarKind.STRING, list = false),
+ PlanField.scalar("format", key = StorageKey.Fixed(Slots.Media.format), kind = ScalarKind.STRING, list = false),
+ PlanField.scalar("status", key = StorageKey.Fixed(Slots.Media.status_98c3c3), kind = ScalarKind.STRING, list = false),
+ PlanField.scalar("episodes", key = StorageKey.Fixed(Slots.Media.episodes), kind = ScalarKind.INT, list = false),
+ PlanField.scalar("chapters", key = StorageKey.Fixed(Slots.Media.chapters), kind = ScalarKind.INT, list = false),
+ PlanField.scalar("volumes", key = StorageKey.Fixed(Slots.Media.volumes), kind = ScalarKind.INT, list = false),
+ PlanField.scalar("duration", key = StorageKey.Fixed(Slots.Media.duration), kind = ScalarKind.INT, list = false),
+ PlanField.scalar("season", key = StorageKey.Fixed(Slots.Media.season), kind = ScalarKind.STRING, list = false),
+ PlanField.scalar("seasonYear", key = StorageKey.Fixed(Slots.Media.seasonYear), kind = ScalarKind.INT, list = false),
+ PlanField.scalar("countryOfOrigin", key = StorageKey.Fixed(Slots.Media.countryOfOrigin), kind = ScalarKind.CUSTOM, list = false),
+ PlanField.scalar("isAdult", key = StorageKey.Fixed(Slots.Media.isAdult), kind = ScalarKind.BOOL, list = false),
+ PlanField.scalar("siteUrl", key = StorageKey.Fixed(Slots.Media.siteUrl), kind = ScalarKind.STRING, list = false),
+ PlanField.linked("title", key = StorageKey.Fixed(Slots.Media.title), plural = false, selection = selection5),
+ PlanField.linked("coverImage", key = StorageKey.Fixed(Slots.Media.coverImage), plural = false, selection = selection4),
+ PlanField.linked("nextAiringEpisode", key = StorageKey.Fixed(Slots.Media.nextAiringEpisode), plural = false, selection = selection3),
+ ))
+ }
+ val selection3: Selection by lazy {
+ Selection(type = Types.AiringSchedule, key = listOf("id"), isAbstract = false, fields = listOf(
+ PlanField.scalar("id", key = StorageKey.Fixed(Slots.AiringSchedule.id), kind = ScalarKind.INT, list = false),
+ PlanField.scalar("episode", key = StorageKey.Fixed(Slots.AiringSchedule.episode), kind = ScalarKind.INT, list = false),
+ PlanField.scalar("airingAt", key = StorageKey.Fixed(Slots.AiringSchedule.airingAt), kind = ScalarKind.INT, list = false),
+ ))
+ }
+ val selection4: Selection by lazy {
+ Selection(type = Types.MediaCoverImage, key = listOf(), isAbstract = false, fields = listOf(
+ PlanField.scalar("large", key = StorageKey.Fixed(Slots.MediaCoverImage.large), kind = ScalarKind.STRING, list = false),
+ PlanField.scalar("color", key = StorageKey.Fixed(Slots.MediaCoverImage.color), kind = ScalarKind.STRING, list = false),
+ ))
+ }
+ val selection5: Selection by lazy {
+ Selection(type = Types.MediaTitle, key = listOf(), isAbstract = false, fields = listOf(
+ PlanField.scalar("romaji", key = StorageKey.Fixed(Slots.MediaTitle.romaji), kind = ScalarKind.STRING, list = false),
+ PlanField.scalar("english", key = StorageKey.Fixed(Slots.MediaTitle.english), kind = ScalarKind.STRING, list = false),
+ PlanField.scalar("native", key = StorageKey.Fixed(Slots.MediaTitle.native), kind = ScalarKind.STRING, list = false),
+ PlanField.scalar("userPreferred", key = StorageKey.Fixed(Slots.MediaTitle.userPreferred), kind = ScalarKind.STRING, list = false),
+ ))
+ }
+ val selection6: Selection by lazy {
+ Selection(type = Types.FuzzyDate, key = listOf(), isAbstract = false, fields = listOf(
+ PlanField.scalar("year", key = StorageKey.Fixed(Slots.FuzzyDate.year), kind = ScalarKind.INT, list = false),
+ PlanField.scalar("month", key = StorageKey.Fixed(Slots.FuzzyDate.month), kind = ScalarKind.INT, list = false),
+ PlanField.scalar("day", key = StorageKey.Fixed(Slots.FuzzyDate.day), kind = ScalarKind.INT, list = false),
+ ))
+ }
+}
+
+/** Commits the mutation; the optimistic response, if any, shows at once and rebases until the server answers. */
+suspend operator fun MutationAction.invoke(id: Int? = null, progress: Int? = null, optimistic: SaveEntryMutation.OptimisticResponse? = null): SaveEntryMutation.Data = this.commit(SaveEntryMutation(id, progress), optimistic?.payload)
diff --git a/compiler/src/tests/goldens-anilist-kotlin/AniListShapes.baton.kt b/compiler/src/tests/goldens-anilist-kotlin/AniListShapes.baton.kt
new file mode 100644
index 00000000..061c411d
--- /dev/null
+++ b/compiler/src/tests/goldens-anilist-kotlin/AniListShapes.baton.kt
@@ -0,0 +1,753 @@
+// Generated by batonc. Do not edit.
+@file:OptIn(baton.Generated::class)
+
+package baton.goldens.anilist
+
+import androidx.compose.runtime.Immutable
+import androidx.compose.runtime.Stable
+import baton.Anchor
+import baton.Deletion
+import baton.Document
+import baton.Generated
+import baton.Lens
+import baton.Lookup
+import baton.MutationAction
+import baton.MutationOperation
+import baton.MutationType
+import baton.OperationKind
+import baton.OperationType
+import baton.Payload
+import baton.Plan
+import baton.PlanField
+import baton.QueryOperation
+import baton.QueryType
+import baton.ScalarKind
+import baton.Selection
+import baton.StorageKey
+import baton.Variable
+import baton.Variables
+
+/** Operation value for `mutation DeleteEntryMutation`. */
+@Immutable
+class DeleteEntryMutation(val id: Int) : MutationOperation {
+ override val variables: Variables
+ get() = Variables.of("id" to Variable.of(id))
+ override val type: OperationType get() = Companion
+
+ override fun equals(other: Any?): Boolean = other is DeleteEntryMutation && other.id == id
+ override fun hashCode(): Int = listOf(id).hashCode()
+
+ companion object : MutationType {
+ override val name = "DeleteEntryMutation"
+ override val document: Document = Document.Text("mutation DeleteEntryMutation(\$id:Int!){DeleteMediaListEntry(id:\$id){deleted}}")
+ override val kind = OperationKind.MUTATION
+ override val plan: Plan by lazy { Plan(root = `DeleteEntryMutation-plan`.selection0, deletions = listOf(Deletion(Types.MediaList, "id"))) }
+
+ override fun data(anchor: Anchor): Data = Data(anchor)
+ }
+
+ @Stable
+ class Data(override val anchor: Anchor) : Lens {
+ val DeleteMediaListEntry: DeleteMediaListEntry2? get() = anchor.linked(Slots.Mutation.DeleteMediaListEntry)?.let(::DeleteMediaListEntry2)
+ override fun equals(other: Any?): Boolean = other is DeleteEntryMutation.Data && other.anchor == anchor
+ override fun hashCode(): Int = anchor.hashCode()
+
+ @Stable
+ class DeleteMediaListEntry2(override val anchor: Anchor) : Lens {
+ val deleted: Boolean? get() = anchor.bool(Slots.Deleted.deleted)
+ override fun equals(other: Any?): Boolean = other is DeleteEntryMutation.Data.DeleteMediaListEntry2 && other.anchor == anchor
+ override fun hashCode(): Int = anchor.hashCode()
+ }
+ }
+
+ /** A partial response to show before the server answers; absent fields leave the store untouched. */
+ class OptimisticResponse(val DeleteMediaListEntry: DeleteMediaListEntry2? = null) {
+ /** The response's data as a variable, an absent field left out. */
+ @Generated
+ val variable: Variable
+ get() = Variable.Object(Variables.of("DeleteMediaListEntry" to this.DeleteMediaListEntry?.variable).values)
+ /** The response this builder describes, as the bytes the door takes. */
+ val payload: Payload get() = Payload(data = variable)
+
+ /** A partial response to show before the server answers; absent fields leave the store untouched. */
+ class DeleteMediaListEntry2(val deleted: Boolean? = null) {
+ /** The response's data as a variable, an absent field left out. */
+ @Generated
+ val variable: Variable
+ get() = Variable.Object(Variables.of("deleted" to this.deleted?.let { Variable.of(it) }).values)
+ }
+ }
+}
+
+private object `DeleteEntryMutation-plan` {
+ val selection0: Selection by lazy {
+ Selection(type = Types.Mutation, key = listOf(), isAbstract = false, fields = listOf(
+ PlanField.linked("DeleteMediaListEntry", key = StorageKey.Fixed(Slots.Mutation.DeleteMediaListEntry), plural = false, selection = selection1),
+ ))
+ }
+ val selection1: Selection by lazy {
+ Selection(type = Types.Deleted, key = listOf(), isAbstract = false, fields = listOf(
+ PlanField.scalar("deleted", key = StorageKey.Fixed(Slots.Deleted.deleted), kind = ScalarKind.BOOL, list = false),
+ ))
+ }
+}
+
+/** Commits the mutation; the optimistic response, if any, shows at once and rebases until the server answers. */
+suspend operator fun MutationAction.invoke(id: Int, optimistic: DeleteEntryMutation.OptimisticResponse? = null): DeleteEntryMutation.Data = this.commit(DeleteEntryMutation(id), optimistic?.payload)
+
+/** Operation value for `query EntryScoresQuery`. */
+@Immutable
+class EntryScoresQuery(val id: Int) : QueryOperation {
+ override val variables: Variables
+ get() = Variables.of("id" to Variable.of(id))
+ override val type: OperationType get() = Companion
+
+ override fun equals(other: Any?): Boolean = other is EntryScoresQuery && other.id == id
+ override fun hashCode(): Int = listOf(id).hashCode()
+
+ companion object : QueryType {
+ override val name = "EntryScoresQuery"
+ override val document: Document = Document.Text("query EntryScoresQuery(\$id:Int!){MediaList(id:\$id){id,score,advancedScores,customLists(asArray:true)}}")
+ override val kind = OperationKind.QUERY
+ override val plan: Plan by lazy { Plan(root = `EntryScoresQuery-plan`.selection0) }
+
+ override fun data(anchor: Anchor): Data = Data(anchor)
+ }
+
+ @Stable
+ class Data(override val anchor: Anchor) : Lens {
+ val MediaList: MediaList2? get() = anchor.linked(anchor.owner.slot(Slots.Query.MediaList_8bfff7))?.let(::MediaList2)
+ override fun equals(other: Any?): Boolean = other is EntryScoresQuery.Data && other.anchor == anchor
+ override fun hashCode(): Int = anchor.hashCode()
+
+ @Stable
+ class MediaList2(override val anchor: Anchor) : Lens {
+ val id: Int get() = anchor.requiredInt(Slots.MediaList.id)
+ val score: Double? get() = anchor.double(Slots.MediaList.score)
+ val advancedScores: String? get() = anchor.string(Slots.MediaList.advancedScores)
+ val customLists: String? get() = anchor.string(Slots.MediaList.customLists_3a6c27)
+ override fun equals(other: Any?): Boolean = other is EntryScoresQuery.Data.MediaList2 && other.anchor == anchor
+ override fun hashCode(): Int = anchor.hashCode()
+ }
+ }
+}
+
+private object `EntryScoresQuery-plan` {
+ val selection0: Selection by lazy {
+ Selection(type = Types.Query, key = listOf(), isAbstract = false, fields = listOf(
+ PlanField.linked("MediaList", key = StorageKey.Dynamic(Slots.Query.MediaList_8bfff7), plural = false, lookup = Lookup(type = Types.MediaList, key = listOf(Lookup.Key.Variable("id"))), selection = selection1),
+ ))
+ }
+ val selection1: Selection by lazy {
+ Selection(type = Types.MediaList, key = listOf("id"), isAbstract = false, fields = listOf(
+ PlanField.scalar("id", key = StorageKey.Fixed(Slots.MediaList.id), kind = ScalarKind.INT, list = false),
+ PlanField.scalar("score", key = StorageKey.Fixed(Slots.MediaList.score), kind = ScalarKind.DOUBLE, list = false),
+ PlanField.scalar("advancedScores", key = StorageKey.Fixed(Slots.MediaList.advancedScores), kind = ScalarKind.CUSTOM, list = false),
+ PlanField.scalar("customLists", key = StorageKey.Fixed(Slots.MediaList.customLists_3a6c27), kind = ScalarKind.CUSTOM, list = false),
+ ))
+ }
+}
+
+/** Operation value for `query MediaQuery`. */
+@Immutable
+class MediaQuery(val id: Int) : QueryOperation {
+ override val variables: Variables
+ get() = Variables.of("id" to Variable.of(id))
+ override val type: OperationType get() = Companion
+
+ override fun equals(other: Any?): Boolean = other is MediaQuery && other.id == id
+ override fun hashCode(): Int = listOf(id).hashCode()
+
+ companion object : QueryType {
+ override val name = "MediaQuery"
+ override val document: Document = Document.Text("query MediaQuery(\$id:Int!){Media(id:\$id){id,...MediaCard_media,statusV1:status,source(version:3),relations{edges{id,relationType(version:2),node{id,title{romaji}}}}}}fragment MediaCard_media on Media{id,idMal,type,format,status(version:2),episodes,chapters,volumes,duration,season,seasonYear,countryOfOrigin,isAdult,siteUrl,title{romaji,english,native,userPreferred},coverImage{large,color},nextAiringEpisode{id,episode,airingAt}}")
+ override val kind = OperationKind.QUERY
+ override val plan: Plan by lazy { Plan(root = `MediaQuery-plan`.selection0) }
+
+ override fun data(anchor: Anchor): Data = Data(anchor)
+ }
+
+ @Stable
+ class Data(override val anchor: Anchor) : Lens {
+ val Media: Media2? get() = anchor.linked(anchor.owner.slot(Slots.Query.Media_976b29))?.let(::Media2)
+ override fun equals(other: Any?): Boolean = other is MediaQuery.Data && other.anchor == anchor
+ override fun hashCode(): Int = anchor.hashCode()
+
+ @Stable
+ class Media2(override val anchor: Anchor) : Lens {
+ val id: Int get() = anchor.requiredInt(Slots.Media.id)
+ val mediaCard: MediaCard_media get() = MediaCard_media(anchor.entering())
+ val statusV1: MediaStatus? get() = anchor.enumValue(Slots.Media.status, MediaStatus::of)
+ val source: MediaSource? get() = anchor.enumValue(Slots.Media.source_3f939b, MediaSource::of)
+ val relations: Relations? get() = anchor.linked(Slots.Media.relations)?.let(::Relations)
+ override fun equals(other: Any?): Boolean = other is MediaQuery.Data.Media2 && other.anchor == anchor
+ override fun hashCode(): Int = anchor.hashCode()
+
+ @Stable
+ class Relations(override val anchor: Anchor) : Lens {
+ val edges: List? get() = anchor.list(Slots.MediaConnection.edges, ::Edges)
+ override fun equals(other: Any?): Boolean = other is MediaQuery.Data.Media2.Relations && other.anchor == anchor
+ override fun hashCode(): Int = anchor.hashCode()
+
+ @Stable
+ class Edges(override val anchor: Anchor) : Lens {
+ val id: Int? get() = anchor.int(Slots.MediaEdge.id)
+ val relationType: MediaRelation? get() = anchor.enumValue(Slots.MediaEdge.relationType_4caf07, MediaRelation::of)
+ val node: Node? get() = anchor.linked(Slots.MediaEdge.node)?.let(::Node)
+ override fun equals(other: Any?): Boolean = other is MediaQuery.Data.Media2.Relations.Edges && other.anchor == anchor
+ override fun hashCode(): Int = anchor.hashCode()
+
+ @Stable
+ class Node(override val anchor: Anchor) : Lens {
+ val id: Int get() = anchor.requiredInt(Slots.Media.id)
+ val title: Title? get() = anchor.linked(Slots.Media.title)?.let(::Title)
+ override fun equals(other: Any?): Boolean = other is MediaQuery.Data.Media2.Relations.Edges.Node && other.anchor == anchor
+ override fun hashCode(): Int = anchor.hashCode()
+
+ @Stable
+ class Title(override val anchor: Anchor) : Lens {
+ val romaji: String? get() = anchor.string(Slots.MediaTitle.romaji)
+ override fun equals(other: Any?): Boolean = other is MediaQuery.Data.Media2.Relations.Edges.Node.Title && other.anchor == anchor
+ override fun hashCode(): Int = anchor.hashCode()
+ }
+ }
+ }
+ }
+ }
+ }
+}
+
+private object `MediaQuery-plan` {
+ val selection0: Selection by lazy {
+ Selection(type = Types.Query, key = listOf(), isAbstract = false, fields = listOf(
+ PlanField.linked("Media", key = StorageKey.Dynamic(Slots.Query.Media_976b29), plural = false, lookup = Lookup(type = Types.Media, key = listOf(Lookup.Key.Variable("id"))), selection = selection1),
+ ))
+ }
+ val selection1: Selection by lazy {
+ Selection(type = Types.Media, key = listOf("id"), isAbstract = false, fields = listOf(
+ PlanField.scalar("id", key = StorageKey.Fixed(Slots.Media.id), kind = ScalarKind.INT, list = false),
+ PlanField.scalar("idMal", key = StorageKey.Fixed(Slots.Media.idMal), kind = ScalarKind.INT, list = false),
+ PlanField.scalar("type", key = StorageKey.Fixed(Slots.Media.type), kind = ScalarKind.STRING, list = false),
+ PlanField.scalar("format", key = StorageKey.Fixed(Slots.Media.format), kind = ScalarKind.STRING, list = false),
+ PlanField.scalar("status", key = StorageKey.Fixed(Slots.Media.status_98c3c3), kind = ScalarKind.STRING, list = false),
+ PlanField.scalar("episodes", key = StorageKey.Fixed(Slots.Media.episodes), kind = ScalarKind.INT, list = false),
+ PlanField.scalar("chapters", key = StorageKey.Fixed(Slots.Media.chapters), kind = ScalarKind.INT, list = false),
+ PlanField.scalar("volumes", key = StorageKey.Fixed(Slots.Media.volumes), kind = ScalarKind.INT, list = false),
+ PlanField.scalar("duration", key = StorageKey.Fixed(Slots.Media.duration), kind = ScalarKind.INT, list = false),
+ PlanField.scalar("season", key = StorageKey.Fixed(Slots.Media.season), kind = ScalarKind.STRING, list = false),
+ PlanField.scalar("seasonYear", key = StorageKey.Fixed(Slots.Media.seasonYear), kind = ScalarKind.INT, list = false),
+ PlanField.scalar("countryOfOrigin", key = StorageKey.Fixed(Slots.Media.countryOfOrigin), kind = ScalarKind.CUSTOM, list = false),
+ PlanField.scalar("isAdult", key = StorageKey.Fixed(Slots.Media.isAdult), kind = ScalarKind.BOOL, list = false),
+ PlanField.scalar("siteUrl", key = StorageKey.Fixed(Slots.Media.siteUrl), kind = ScalarKind.STRING, list = false),
+ PlanField.linked("title", key = StorageKey.Fixed(Slots.Media.title), plural = false, selection = selection8),
+ PlanField.linked("coverImage", key = StorageKey.Fixed(Slots.Media.coverImage), plural = false, selection = selection7),
+ PlanField.linked("nextAiringEpisode", key = StorageKey.Fixed(Slots.Media.nextAiringEpisode), plural = false, selection = selection6),
+ PlanField.scalar("statusV1", key = StorageKey.Fixed(Slots.Media.status), kind = ScalarKind.STRING, list = false),
+ PlanField.scalar("source", key = StorageKey.Fixed(Slots.Media.source_3f939b), kind = ScalarKind.STRING, list = false),
+ PlanField.linked("relations", key = StorageKey.Fixed(Slots.Media.relations), plural = false, selection = selection2),
+ ))
+ }
+ val selection2: Selection by lazy {
+ Selection(type = Types.MediaConnection, key = listOf(), isAbstract = false, fields = listOf(
+ PlanField.linked("edges", key = StorageKey.Fixed(Slots.MediaConnection.edges), plural = true, selection = selection3),
+ ))
+ }
+ val selection3: Selection by lazy {
+ Selection(type = Types.MediaEdge, key = listOf("id"), isAbstract = false, fields = listOf(
+ PlanField.scalar("id", key = StorageKey.Fixed(Slots.MediaEdge.id), kind = ScalarKind.INT, list = false),
+ PlanField.scalar("relationType", key = StorageKey.Fixed(Slots.MediaEdge.relationType_4caf07), kind = ScalarKind.STRING, list = false),
+ PlanField.linked("node", key = StorageKey.Fixed(Slots.MediaEdge.node), plural = false, selection = selection4),
+ ))
+ }
+ val selection4: Selection by lazy {
+ Selection(type = Types.Media, key = listOf("id"), isAbstract = false, fields = listOf(
+ PlanField.scalar("id", key = StorageKey.Fixed(Slots.Media.id), kind = ScalarKind.INT, list = false),
+ PlanField.linked("title", key = StorageKey.Fixed(Slots.Media.title), plural = false, selection = selection5),
+ ))
+ }
+ val selection5: Selection by lazy {
+ Selection(type = Types.MediaTitle, key = listOf(), isAbstract = false, fields = listOf(
+ PlanField.scalar("romaji", key = StorageKey.Fixed(Slots.MediaTitle.romaji), kind = ScalarKind.STRING, list = false),
+ ))
+ }
+ val selection6: Selection by lazy {
+ Selection(type = Types.AiringSchedule, key = listOf("id"), isAbstract = false, fields = listOf(
+ PlanField.scalar("id", key = StorageKey.Fixed(Slots.AiringSchedule.id), kind = ScalarKind.INT, list = false),
+ PlanField.scalar("episode", key = StorageKey.Fixed(Slots.AiringSchedule.episode), kind = ScalarKind.INT, list = false),
+ PlanField.scalar("airingAt", key = StorageKey.Fixed(Slots.AiringSchedule.airingAt), kind = ScalarKind.INT, list = false),
+ ))
+ }
+ val selection7: Selection by lazy {
+ Selection(type = Types.MediaCoverImage, key = listOf(), isAbstract = false, fields = listOf(
+ PlanField.scalar("large", key = StorageKey.Fixed(Slots.MediaCoverImage.large), kind = ScalarKind.STRING, list = false),
+ PlanField.scalar("color", key = StorageKey.Fixed(Slots.MediaCoverImage.color), kind = ScalarKind.STRING, list = false),
+ ))
+ }
+ val selection8: Selection by lazy {
+ Selection(type = Types.MediaTitle, key = listOf(), isAbstract = false, fields = listOf(
+ PlanField.scalar("romaji", key = StorageKey.Fixed(Slots.MediaTitle.romaji), kind = ScalarKind.STRING, list = false),
+ PlanField.scalar("english", key = StorageKey.Fixed(Slots.MediaTitle.english), kind = ScalarKind.STRING, list = false),
+ PlanField.scalar("native", key = StorageKey.Fixed(Slots.MediaTitle.native), kind = ScalarKind.STRING, list = false),
+ PlanField.scalar("userPreferred", key = StorageKey.Fixed(Slots.MediaTitle.userPreferred), kind = ScalarKind.STRING, list = false),
+ ))
+ }
+}
+
+/** Operation value for `query NotificationsQuery`. */
+@Immutable
+class NotificationsQuery(val page: Int) : QueryOperation {
+ override val variables: Variables
+ get() = Variables.of("page" to Variable.of(page))
+ override val type: OperationType get() = Companion
+
+ override fun equals(other: Any?): Boolean = other is NotificationsQuery && other.page == page
+ override fun hashCode(): Int = listOf(page).hashCode()
+
+ companion object : QueryType {
+ override val name = "NotificationsQuery"
+ override val document: Document = Document.Text("query NotificationsQuery(\$page:Int!){Page(page:\$page,perPage:25){notifications{__typename,...on AiringNotification{id,episode,contexts,media{id,title{romaji}}},...on FollowingNotification{id,user{id,name}},...on ActivityLikeNotification{id,activityId,user{id,name}},...on ThreadCommentReplyNotification{id,commentId},...on MediaDataChangeNotification{id,mediaId,reason},...on ActivityMentionNotification{id},...on ActivityMessageNotification{id},...on ActivityReplyLikeNotification{id},...on ActivityReplyNotification{id},...on ActivityReplySubscribedNotification{id},...on CharacterSubmissionUpdateNotification{id},...on MediaDeletionNotification{id},...on MediaMergeNotification{id},...on MediaSubmissionUpdateNotification{id},...on RelatedMediaAdditionNotification{id},...on StaffSubmissionUpdateNotification{id},...on ThreadCommentLikeNotification{id},...on ThreadCommentMentionNotification{id},...on ThreadCommentSubscribedNotification{id},...on ThreadLikeNotification{id}}}}")
+ override val kind = OperationKind.QUERY
+ override val plan: Plan by lazy { Plan(root = `NotificationsQuery-plan`.selection0) }
+
+ override fun data(anchor: Anchor): Data = Data(anchor)
+ }
+
+ @Stable
+ class Data(override val anchor: Anchor) : Lens {
+ val Page: Page2? get() = anchor.linked(anchor.owner.slot(Slots.Query.Page_839a80))?.let(::Page2)
+ override fun equals(other: Any?): Boolean = other is NotificationsQuery.Data && other.anchor == anchor
+ override fun hashCode(): Int = anchor.hashCode()
+
+ @Stable
+ class Page2(override val anchor: Anchor) : Lens {
+ val notifications: List? get() = anchor.list(Slots.Page.notifications, ::Notifications)
+ override fun equals(other: Any?): Boolean = other is NotificationsQuery.Data.Page2 && other.anchor == anchor
+ override fun hashCode(): Int = anchor.hashCode()
+
+ @Stable
+ class Notifications(override val anchor: Anchor) : Lens {
+ val asAiringNotification: AsAiringNotification? get() = if (anchor.record.type == Types.AiringNotification) AsAiringNotification(anchor) else null
+ val asFollowingNotification: AsFollowingNotification? get() = if (anchor.record.type == Types.FollowingNotification) AsFollowingNotification(anchor) else null
+ val asActivityLikeNotification: AsActivityLikeNotification? get() = if (anchor.record.type == Types.ActivityLikeNotification) AsActivityLikeNotification(anchor) else null
+ val asThreadCommentReplyNotification: AsThreadCommentReplyNotification? get() = if (anchor.record.type == Types.ThreadCommentReplyNotification) AsThreadCommentReplyNotification(anchor) else null
+ val asMediaDataChangeNotification: AsMediaDataChangeNotification? get() = if (anchor.record.type == Types.MediaDataChangeNotification) AsMediaDataChangeNotification(anchor) else null
+ override fun equals(other: Any?): Boolean = other is NotificationsQuery.Data.Page2.Notifications && other.anchor == anchor
+ override fun hashCode(): Int = anchor.hashCode()
+
+ @Stable
+ class AsAiringNotification(override val anchor: Anchor) : Lens {
+ val id: Int get() = anchor.requiredInt(Slots.AiringNotification.id)
+ val episode: Int get() = anchor.requiredInt(Slots.AiringNotification.episode)
+ val contexts: List? get() = anchor.nullableStrings(Slots.AiringNotification.contexts)
+ val media: Media? get() = anchor.linked(Slots.AiringNotification.media)?.let(::Media)
+ override fun equals(other: Any?): Boolean = other is NotificationsQuery.Data.Page2.Notifications.AsAiringNotification && other.anchor == anchor
+ override fun hashCode(): Int = anchor.hashCode()
+
+ @Stable
+ class Media(override val anchor: Anchor) : Lens {
+ val id: Int get() = anchor.requiredInt(Slots.Media.id)
+ val title: Title? get() = anchor.linked(Slots.Media.title)?.let(::Title)
+ override fun equals(other: Any?): Boolean = other is NotificationsQuery.Data.Page2.Notifications.AsAiringNotification.Media && other.anchor == anchor
+ override fun hashCode(): Int = anchor.hashCode()
+
+ @Stable
+ class Title(override val anchor: Anchor) : Lens {
+ val romaji: String? get() = anchor.string(Slots.MediaTitle.romaji)
+ override fun equals(other: Any?): Boolean = other is NotificationsQuery.Data.Page2.Notifications.AsAiringNotification.Media.Title && other.anchor == anchor
+ override fun hashCode(): Int = anchor.hashCode()
+ }
+ }
+ }
+
+ @Stable
+ class AsFollowingNotification(override val anchor: Anchor) : Lens {
+ val id: Int get() = anchor.requiredInt(Slots.FollowingNotification.id)
+ val user: User? get() = anchor.linked(Slots.FollowingNotification.user)?.let(::User)
+ override fun equals(other: Any?): Boolean = other is NotificationsQuery.Data.Page2.Notifications.AsFollowingNotification && other.anchor == anchor
+ override fun hashCode(): Int = anchor.hashCode()
+
+ @Stable
+ class User(override val anchor: Anchor) : Lens {
+ val id: Int get() = anchor.requiredInt(Slots.User.id)
+ val name: String get() = anchor.requiredString(Slots.User.name)
+ override fun equals(other: Any?): Boolean = other is NotificationsQuery.Data.Page2.Notifications.AsFollowingNotification.User && other.anchor == anchor
+ override fun hashCode(): Int = anchor.hashCode()
+ }
+ }
+
+ @Stable
+ class AsActivityLikeNotification(override val anchor: Anchor) : Lens {
+ val id: Int get() = anchor.requiredInt(Slots.ActivityLikeNotification.id)
+ val activityId: Int get() = anchor.requiredInt(Slots.ActivityLikeNotification.activityId)
+ val user: User? get() = anchor.linked(Slots.ActivityLikeNotification.user)?.let(::User)
+ override fun equals(other: Any?): Boolean = other is NotificationsQuery.Data.Page2.Notifications.AsActivityLikeNotification && other.anchor == anchor
+ override fun hashCode(): Int = anchor.hashCode()
+
+ @Stable
+ class User(override val anchor: Anchor) : Lens {
+ val id: Int get() = anchor.requiredInt(Slots.User.id)
+ val name: String get() = anchor.requiredString(Slots.User.name)
+ override fun equals(other: Any?): Boolean = other is NotificationsQuery.Data.Page2.Notifications.AsActivityLikeNotification.User && other.anchor == anchor
+ override fun hashCode(): Int = anchor.hashCode()
+ }
+ }
+
+ @Stable
+ class AsThreadCommentReplyNotification(override val anchor: Anchor) : Lens {
+ val id: Int get() = anchor.requiredInt(Slots.ThreadCommentReplyNotification.id)
+ val commentId: Int get() = anchor.requiredInt(Slots.ThreadCommentReplyNotification.commentId)
+ override fun equals(other: Any?): Boolean = other is NotificationsQuery.Data.Page2.Notifications.AsThreadCommentReplyNotification && other.anchor == anchor
+ override fun hashCode(): Int = anchor.hashCode()
+ }
+
+ @Stable
+ class AsMediaDataChangeNotification(override val anchor: Anchor) : Lens {
+ val id: Int get() = anchor.requiredInt(Slots.MediaDataChangeNotification.id)
+ val mediaId: Int get() = anchor.requiredInt(Slots.MediaDataChangeNotification.mediaId)
+ val reason: String? get() = anchor.string(Slots.MediaDataChangeNotification.reason)
+ override fun equals(other: Any?): Boolean = other is NotificationsQuery.Data.Page2.Notifications.AsMediaDataChangeNotification && other.anchor == anchor
+ override fun hashCode(): Int = anchor.hashCode()
+ }
+ }
+ }
+ }
+}
+
+private object `NotificationsQuery-plan` {
+ val selection0: Selection by lazy {
+ Selection(type = Types.Query, key = listOf(), isAbstract = false, fields = listOf(
+ PlanField.linked("Page", key = StorageKey.Dynamic(Slots.Query.Page_839a80), plural = false, selection = selection1),
+ ))
+ }
+ val selection1: Selection by lazy {
+ Selection(type = Types.Page, key = listOf(), isAbstract = false, fields = listOf(
+ PlanField.linked("notifications", key = StorageKey.Fixed(Slots.Page.notifications), plural = true, selection = selection2),
+ ))
+ }
+ val selection2: Selection by lazy {
+ Selection(type = Types.NotificationUnion, key = listOf("id"), isAbstract = true, variants = listOf(
+ Selection.Variant(types = listOf(Types.ActivityLikeNotification), key = listOf("id"), fields = listOf(
+ PlanField.scalar("__typename", key = StorageKey.Fixed(Slots.ActivityLikeNotification.__typename), kind = ScalarKind.STRING, list = false),
+ PlanField.scalar("id", key = StorageKey.Fixed(Slots.ActivityLikeNotification.id), kind = ScalarKind.INT, list = false),
+ PlanField.scalar("activityId", key = StorageKey.Fixed(Slots.ActivityLikeNotification.activityId), kind = ScalarKind.INT, list = false),
+ PlanField.linked("user", key = StorageKey.Fixed(Slots.ActivityLikeNotification.user), plural = false, selection = selection5),
+ )),
+ Selection.Variant(types = listOf(Types.ActivityMentionNotification, Types.ActivityMessageNotification, Types.ActivityReplyLikeNotification, Types.ActivityReplyNotification, Types.ActivityReplySubscribedNotification, Types.CharacterSubmissionUpdateNotification, Types.MediaDeletionNotification, Types.MediaMergeNotification, Types.MediaSubmissionUpdateNotification, Types.RelatedMediaAdditionNotification, Types.StaffSubmissionUpdateNotification, Types.ThreadCommentLikeNotification, Types.ThreadCommentMentionNotification, Types.ThreadCommentSubscribedNotification, Types.ThreadLikeNotification), key = listOf("id"), fields = listOf(
+ PlanField.scalar("__typename", key = StorageKey.Fixed(Slots.NotificationUnion.__typename), kind = ScalarKind.STRING, list = false),
+ PlanField.scalar("id", key = StorageKey.Fixed(Slots.NotificationUnion.id), kind = ScalarKind.INT, list = false),
+ )),
+ Selection.Variant(types = listOf(Types.AiringNotification), key = listOf("id"), fields = listOf(
+ PlanField.scalar("__typename", key = StorageKey.Fixed(Slots.AiringNotification.__typename), kind = ScalarKind.STRING, list = false),
+ PlanField.scalar("id", key = StorageKey.Fixed(Slots.AiringNotification.id), kind = ScalarKind.INT, list = false),
+ PlanField.scalar("episode", key = StorageKey.Fixed(Slots.AiringNotification.episode), kind = ScalarKind.INT, list = false),
+ PlanField.scalar("contexts", key = StorageKey.Fixed(Slots.AiringNotification.contexts), kind = ScalarKind.STRING, list = true),
+ PlanField.linked("media", key = StorageKey.Fixed(Slots.AiringNotification.media), plural = false, selection = selection3),
+ )),
+ Selection.Variant(types = listOf(Types.FollowingNotification), key = listOf("id"), fields = listOf(
+ PlanField.scalar("__typename", key = StorageKey.Fixed(Slots.FollowingNotification.__typename), kind = ScalarKind.STRING, list = false),
+ PlanField.scalar("id", key = StorageKey.Fixed(Slots.FollowingNotification.id), kind = ScalarKind.INT, list = false),
+ PlanField.linked("user", key = StorageKey.Fixed(Slots.FollowingNotification.user), plural = false, selection = selection5),
+ )),
+ Selection.Variant(types = listOf(Types.MediaDataChangeNotification), key = listOf("id"), fields = listOf(
+ PlanField.scalar("__typename", key = StorageKey.Fixed(Slots.MediaDataChangeNotification.__typename), kind = ScalarKind.STRING, list = false),
+ PlanField.scalar("id", key = StorageKey.Fixed(Slots.MediaDataChangeNotification.id), kind = ScalarKind.INT, list = false),
+ PlanField.scalar("mediaId", key = StorageKey.Fixed(Slots.MediaDataChangeNotification.mediaId), kind = ScalarKind.INT, list = false),
+ PlanField.scalar("reason", key = StorageKey.Fixed(Slots.MediaDataChangeNotification.reason), kind = ScalarKind.STRING, list = false),
+ )),
+ Selection.Variant(types = listOf(Types.ThreadCommentReplyNotification), key = listOf("id"), fields = listOf(
+ PlanField.scalar("__typename", key = StorageKey.Fixed(Slots.ThreadCommentReplyNotification.__typename), kind = ScalarKind.STRING, list = false),
+ PlanField.scalar("id", key = StorageKey.Fixed(Slots.ThreadCommentReplyNotification.id), kind = ScalarKind.INT, list = false),
+ PlanField.scalar("commentId", key = StorageKey.Fixed(Slots.ThreadCommentReplyNotification.commentId), kind = ScalarKind.INT, list = false),
+ )),
+ Selection.Variant(types = null, fields = listOf(
+ PlanField.scalar("__typename", key = StorageKey.Fixed(Slots.NotificationUnion.__typename), kind = ScalarKind.STRING, list = false),
+ )),
+ ))
+ }
+ val selection3: Selection by lazy {
+ Selection(type = Types.Media, key = listOf("id"), isAbstract = false, fields = listOf(
+ PlanField.scalar("id", key = StorageKey.Fixed(Slots.Media.id), kind = ScalarKind.INT, list = false),
+ PlanField.linked("title", key = StorageKey.Fixed(Slots.Media.title), plural = false, selection = selection4),
+ ))
+ }
+ val selection4: Selection by lazy {
+ Selection(type = Types.MediaTitle, key = listOf(), isAbstract = false, fields = listOf(
+ PlanField.scalar("romaji", key = StorageKey.Fixed(Slots.MediaTitle.romaji), kind = ScalarKind.STRING, list = false),
+ ))
+ }
+ val selection5: Selection by lazy {
+ Selection(type = Types.User, key = listOf("id"), isAbstract = false, fields = listOf(
+ PlanField.scalar("id", key = StorageKey.Fixed(Slots.User.id), kind = ScalarKind.INT, list = false),
+ PlanField.scalar("name", key = StorageKey.Fixed(Slots.User.name), kind = ScalarKind.STRING, list = false),
+ ))
+ }
+}
+
+/** Operation value for `query SeasonQuery`. */
+@Immutable
+class SeasonQuery(val season: MediaSeason, val seasonYear: Int, val page: Int) : QueryOperation {
+ override val variables: Variables
+ get() = Variables.of("season" to Variable.of(season), "seasonYear" to Variable.of(seasonYear), "page" to Variable.of(page))
+ override val type: OperationType get() = Companion
+
+ override fun equals(other: Any?): Boolean = other is SeasonQuery && other.season == season && other.seasonYear == seasonYear && other.page == page
+ override fun hashCode(): Int = listOf(season, seasonYear, page).hashCode()
+
+ companion object : QueryType {
+ override val name = "SeasonQuery"
+ override val document: Document = Document.Text("query SeasonQuery(\$season:MediaSeason!,\$seasonYear:Int!,\$page:Int!){Page(page:\$page,perPage:48){pageInfo{hasNextPage},media(season:\$season,seasonYear:\$seasonYear,type:ANIME,sort:[POPULARITY_DESC]){id,...MediaCard_media}}}fragment MediaCard_media on Media{id,idMal,type,format,status(version:2),episodes,chapters,volumes,duration,season,seasonYear,countryOfOrigin,isAdult,siteUrl,title{romaji,english,native,userPreferred},coverImage{large,color},nextAiringEpisode{id,episode,airingAt}}")
+ override val kind = OperationKind.QUERY
+ override val plan: Plan by lazy { Plan(root = `SeasonQuery-plan`.selection0) }
+
+ override fun data(anchor: Anchor): Data = Data(anchor)
+ }
+
+ @Stable
+ class Data(override val anchor: Anchor) : Lens {
+ val Page: Page2? get() = anchor.linked(anchor.owner.slot(Slots.Query.Page_9d9873))?.let(::Page2)
+ override fun equals(other: Any?): Boolean = other is SeasonQuery.Data && other.anchor == anchor
+ override fun hashCode(): Int = anchor.hashCode()
+
+ @Stable
+ class Page2(override val anchor: Anchor) : Lens {
+ val pageInfo: PageInfo? get() = anchor.linked(Slots.Page.pageInfo)?.let(::PageInfo)
+ val media: List? get() = anchor.list(anchor.owner.slot(Slots.Page.media_aca52b), ::Media)
+ override fun equals(other: Any?): Boolean = other is SeasonQuery.Data.Page2 && other.anchor == anchor
+ override fun hashCode(): Int = anchor.hashCode()
+
+ @Stable
+ class PageInfo(override val anchor: Anchor) : Lens {
+ val hasNextPage: Boolean? get() = anchor.bool(Slots.PageInfo.hasNextPage)
+ override fun equals(other: Any?): Boolean = other is SeasonQuery.Data.Page2.PageInfo && other.anchor == anchor
+ override fun hashCode(): Int = anchor.hashCode()
+ }
+
+ @Stable
+ class Media(override val anchor: Anchor) : Lens {
+ val id: Int get() = anchor.requiredInt(Slots.Media.id)
+ val mediaCard: MediaCard_media get() = MediaCard_media(anchor.entering())
+ override fun equals(other: Any?): Boolean = other is SeasonQuery.Data.Page2.Media && other.anchor == anchor
+ override fun hashCode(): Int = anchor.hashCode()
+ }
+ }
+ }
+}
+
+private object `SeasonQuery-plan` {
+ val selection0: Selection by lazy {
+ Selection(type = Types.Query, key = listOf(), isAbstract = false, fields = listOf(
+ PlanField.linked("Page", key = StorageKey.Dynamic(Slots.Query.Page_9d9873), plural = false, selection = selection1),
+ ))
+ }
+ val selection1: Selection by lazy {
+ Selection(type = Types.Page, key = listOf(), isAbstract = false, fields = listOf(
+ PlanField.linked("pageInfo", key = StorageKey.Fixed(Slots.Page.pageInfo), plural = false, selection = selection6),
+ PlanField.linked("media", key = StorageKey.Dynamic(Slots.Page.media_aca52b), plural = true, selection = selection2),
+ ))
+ }
+ val selection2: Selection by lazy {
+ Selection(type = Types.Media, key = listOf("id"), isAbstract = false, fields = listOf(
+ PlanField.scalar("id", key = StorageKey.Fixed(Slots.Media.id), kind = ScalarKind.INT, list = false),
+ PlanField.scalar("idMal", key = StorageKey.Fixed(Slots.Media.idMal), kind = ScalarKind.INT, list = false),
+ PlanField.scalar("type", key = StorageKey.Fixed(Slots.Media.type), kind = ScalarKind.STRING, list = false),
+ PlanField.scalar("format", key = StorageKey.Fixed(Slots.Media.format), kind = ScalarKind.STRING, list = false),
+ PlanField.scalar("status", key = StorageKey.Fixed(Slots.Media.status_98c3c3), kind = ScalarKind.STRING, list = false),
+ PlanField.scalar("episodes", key = StorageKey.Fixed(Slots.Media.episodes), kind = ScalarKind.INT, list = false),
+ PlanField.scalar("chapters", key = StorageKey.Fixed(Slots.Media.chapters), kind = ScalarKind.INT, list = false),
+ PlanField.scalar("volumes", key = StorageKey.Fixed(Slots.Media.volumes), kind = ScalarKind.INT, list = false),
+ PlanField.scalar("duration", key = StorageKey.Fixed(Slots.Media.duration), kind = ScalarKind.INT, list = false),
+ PlanField.scalar("season", key = StorageKey.Fixed(Slots.Media.season), kind = ScalarKind.STRING, list = false),
+ PlanField.scalar("seasonYear", key = StorageKey.Fixed(Slots.Media.seasonYear), kind = ScalarKind.INT, list = false),
+ PlanField.scalar("countryOfOrigin", key = StorageKey.Fixed(Slots.Media.countryOfOrigin), kind = ScalarKind.CUSTOM, list = false),
+ PlanField.scalar("isAdult", key = StorageKey.Fixed(Slots.Media.isAdult), kind = ScalarKind.BOOL, list = false),
+ PlanField.scalar("siteUrl", key = StorageKey.Fixed(Slots.Media.siteUrl), kind = ScalarKind.STRING, list = false),
+ PlanField.linked("title", key = StorageKey.Fixed(Slots.Media.title), plural = false, selection = selection5),
+ PlanField.linked("coverImage", key = StorageKey.Fixed(Slots.Media.coverImage), plural = false, selection = selection4),
+ PlanField.linked("nextAiringEpisode", key = StorageKey.Fixed(Slots.Media.nextAiringEpisode), plural = false, selection = selection3),
+ ))
+ }
+ val selection3: Selection by lazy {
+ Selection(type = Types.AiringSchedule, key = listOf("id"), isAbstract = false, fields = listOf(
+ PlanField.scalar("id", key = StorageKey.Fixed(Slots.AiringSchedule.id), kind = ScalarKind.INT, list = false),
+ PlanField.scalar("episode", key = StorageKey.Fixed(Slots.AiringSchedule.episode), kind = ScalarKind.INT, list = false),
+ PlanField.scalar("airingAt", key = StorageKey.Fixed(Slots.AiringSchedule.airingAt), kind = ScalarKind.INT, list = false),
+ ))
+ }
+ val selection4: Selection by lazy {
+ Selection(type = Types.MediaCoverImage, key = listOf(), isAbstract = false, fields = listOf(
+ PlanField.scalar("large", key = StorageKey.Fixed(Slots.MediaCoverImage.large), kind = ScalarKind.STRING, list = false),
+ PlanField.scalar("color", key = StorageKey.Fixed(Slots.MediaCoverImage.color), kind = ScalarKind.STRING, list = false),
+ ))
+ }
+ val selection5: Selection by lazy {
+ Selection(type = Types.MediaTitle, key = listOf(), isAbstract = false, fields = listOf(
+ PlanField.scalar("romaji", key = StorageKey.Fixed(Slots.MediaTitle.romaji), kind = ScalarKind.STRING, list = false),
+ PlanField.scalar("english", key = StorageKey.Fixed(Slots.MediaTitle.english), kind = ScalarKind.STRING, list = false),
+ PlanField.scalar("native", key = StorageKey.Fixed(Slots.MediaTitle.native), kind = ScalarKind.STRING, list = false),
+ PlanField.scalar("userPreferred", key = StorageKey.Fixed(Slots.MediaTitle.userPreferred), kind = ScalarKind.STRING, list = false),
+ ))
+ }
+ val selection6: Selection by lazy {
+ Selection(type = Types.PageInfo, key = listOf(), isAbstract = false, fields = listOf(
+ PlanField.scalar("hasNextPage", key = StorageKey.Fixed(Slots.PageInfo.hasNextPage), kind = ScalarKind.BOOL, list = false),
+ ))
+ }
+}
+
+/** Operation value for `query ThreadCommentsQuery`. */
+@Immutable
+class ThreadCommentsQuery(val threadId: Int) : QueryOperation {
+ override val variables: Variables
+ get() = Variables.of("threadId" to Variable.of(threadId))
+ override val type: OperationType get() = Companion
+
+ override fun equals(other: Any?): Boolean = other is ThreadCommentsQuery && other.threadId == threadId
+ override fun hashCode(): Int = listOf(threadId).hashCode()
+
+ companion object : QueryType {
+ override val name = "ThreadCommentsQuery"
+ override val document: Document = Document.Text("query ThreadCommentsQuery(\$threadId:Int!){Page(page:1,perPage:25){threadComments(threadId:\$threadId){id,comment,childComments}}}")
+ override val kind = OperationKind.QUERY
+ override val plan: Plan by lazy { Plan(root = `ThreadCommentsQuery-plan`.selection0) }
+
+ override fun data(anchor: Anchor): Data = Data(anchor)
+ }
+
+ @Stable
+ class Data(override val anchor: Anchor) : Lens {
+ val Page: Page2? get() = anchor.linked(Slots.Query.Page_c5f40b)?.let(::Page2)
+ override fun equals(other: Any?): Boolean = other is ThreadCommentsQuery.Data && other.anchor == anchor
+ override fun hashCode(): Int = anchor.hashCode()
+
+ @Stable
+ class Page2(override val anchor: Anchor) : Lens {
+ val threadComments: List? get() = anchor.list(anchor.owner.slot(Slots.Page.threadComments_88ffc8), ::ThreadComments)
+ override fun equals(other: Any?): Boolean = other is ThreadCommentsQuery.Data.Page2 && other.anchor == anchor
+ override fun hashCode(): Int = anchor.hashCode()
+
+ @Stable
+ class ThreadComments(override val anchor: Anchor) : Lens {
+ val id: Int get() = anchor.requiredInt(Slots.ThreadComment.id)
+ val comment: String? get() = anchor.string(Slots.ThreadComment.comment)
+ val childComments: String? get() = anchor.string(Slots.ThreadComment.childComments)
+ override fun equals(other: Any?): Boolean = other is ThreadCommentsQuery.Data.Page2.ThreadComments && other.anchor == anchor
+ override fun hashCode(): Int = anchor.hashCode()
+ }
+ }
+ }
+}
+
+private object `ThreadCommentsQuery-plan` {
+ val selection0: Selection by lazy {
+ Selection(type = Types.Query, key = listOf(), isAbstract = false, fields = listOf(
+ PlanField.linked("Page", key = StorageKey.Fixed(Slots.Query.Page_c5f40b), plural = false, selection = selection1),
+ ))
+ }
+ val selection1: Selection by lazy {
+ Selection(type = Types.Page, key = listOf(), isAbstract = false, fields = listOf(
+ PlanField.linked("threadComments", key = StorageKey.Dynamic(Slots.Page.threadComments_88ffc8), plural = true, selection = selection2),
+ ))
+ }
+ val selection2: Selection by lazy {
+ Selection(type = Types.ThreadComment, key = listOf("id"), isAbstract = false, fields = listOf(
+ PlanField.scalar("id", key = StorageKey.Fixed(Slots.ThreadComment.id), kind = ScalarKind.INT, list = false),
+ PlanField.scalar("comment", key = StorageKey.Fixed(Slots.ThreadComment.comment), kind = ScalarKind.STRING, list = false),
+ PlanField.scalar("childComments", key = StorageKey.Fixed(Slots.ThreadComment.childComments), kind = ScalarKind.CUSTOM, list = false),
+ ))
+ }
+}
+
+/** Operation value for `query ViewerQuery`. */
+@Immutable
+class ViewerQuery : QueryOperation {
+ override val variables: Variables
+ get() = Variables.none
+ override val type: OperationType get() = Companion
+
+ override fun equals(other: Any?): Boolean = other is ViewerQuery
+ override fun hashCode(): Int = 0
+
+ companion object : QueryType {
+ override val name = "ViewerQuery"
+ override val document: Document = Document.Text("query ViewerQuery{Viewer{id,name,avatar{large},unreadNotificationCount,mediaListOptions{scoreFormat,animeList{customLists,advancedScoringEnabled}}}}")
+ override val kind = OperationKind.QUERY
+ override val plan: Plan by lazy { Plan(root = `ViewerQuery-plan`.selection0) }
+
+ override fun data(anchor: Anchor): Data = Data(anchor)
+ }
+
+ @Stable
+ class Data(override val anchor: Anchor) : Lens {
+ val Viewer: Viewer2? get() = anchor.linked(Slots.Query.Viewer)?.let(::Viewer2)
+ override fun equals(other: Any?): Boolean = other is ViewerQuery.Data && other.anchor == anchor
+ override fun hashCode(): Int = anchor.hashCode()
+
+ @Stable
+ class Viewer2(override val anchor: Anchor) : Lens {
+ val id: Int get() = anchor.requiredInt(Slots.User.id)
+ val name: String get() = anchor.requiredString(Slots.User.name)
+ val avatar: Avatar? get() = anchor.linked(Slots.User.avatar)?.let(::Avatar)
+ val unreadNotificationCount: Int? get() = anchor.int(Slots.User.unreadNotificationCount)
+ val mediaListOptions: MediaListOptions? get() = anchor.linked(Slots.User.mediaListOptions)?.let(::MediaListOptions)
+ override fun equals(other: Any?): Boolean = other is ViewerQuery.Data.Viewer2 && other.anchor == anchor
+ override fun hashCode(): Int = anchor.hashCode()
+
+ @Stable
+ class Avatar(override val anchor: Anchor) : Lens {
+ val large: String? get() = anchor.string(Slots.UserAvatar.large)
+ override fun equals(other: Any?): Boolean = other is ViewerQuery.Data.Viewer2.Avatar && other.anchor == anchor
+ override fun hashCode(): Int = anchor.hashCode()
+ }
+
+ @Stable
+ class MediaListOptions(override val anchor: Anchor) : Lens {
+ val scoreFormat: ScoreFormat? get() = anchor.enumValue(Slots.MediaListOptions.scoreFormat, ScoreFormat::of)
+ val animeList: AnimeList? get() = anchor.linked(Slots.MediaListOptions.animeList)?.let(::AnimeList)
+ override fun equals(other: Any?): Boolean = other is ViewerQuery.Data.Viewer2.MediaListOptions && other.anchor == anchor
+ override fun hashCode(): Int = anchor.hashCode()
+
+ @Stable
+ class AnimeList(override val anchor: Anchor) : Lens {
+ val customLists: List? get() = anchor.nullableStrings(Slots.MediaListTypeOptions.customLists)
+ val advancedScoringEnabled: Boolean? get() = anchor.bool(Slots.MediaListTypeOptions.advancedScoringEnabled)
+ override fun equals(other: Any?): Boolean = other is ViewerQuery.Data.Viewer2.MediaListOptions.AnimeList && other.anchor == anchor
+ override fun hashCode(): Int = anchor.hashCode()
+ }
+ }
+ }
+ }
+}
+
+private object `ViewerQuery-plan` {
+ val selection0: Selection by lazy {
+ Selection(type = Types.Query, key = listOf(), isAbstract = false, fields = listOf(
+ PlanField.linked("Viewer", key = StorageKey.Fixed(Slots.Query.Viewer), plural = false, selection = selection1),
+ ))
+ }
+ val selection1: Selection by lazy {
+ Selection(type = Types.User, key = listOf("id"), isAbstract = false, fields = listOf(
+ PlanField.scalar("id", key = StorageKey.Fixed(Slots.User.id), kind = ScalarKind.INT, list = false),
+ PlanField.scalar("name", key = StorageKey.Fixed(Slots.User.name), kind = ScalarKind.STRING, list = false),
+ PlanField.linked("avatar", key = StorageKey.Fixed(Slots.User.avatar), plural = false, selection = selection4),
+ PlanField.scalar("unreadNotificationCount", key = StorageKey.Fixed(Slots.User.unreadNotificationCount), kind = ScalarKind.INT, list = false),
+ PlanField.linked("mediaListOptions", key = StorageKey.Fixed(Slots.User.mediaListOptions), plural = false, selection = selection2),
+ ))
+ }
+ val selection2: Selection by lazy {
+ Selection(type = Types.MediaListOptions, key = listOf(), isAbstract = false, fields = listOf(
+ PlanField.scalar("scoreFormat", key = StorageKey.Fixed(Slots.MediaListOptions.scoreFormat), kind = ScalarKind.STRING, list = false),
+ PlanField.linked("animeList", key = StorageKey.Fixed(Slots.MediaListOptions.animeList), plural = false, selection = selection3),
+ ))
+ }
+ val selection3: Selection by lazy {
+ Selection(type = Types.MediaListTypeOptions, key = listOf(), isAbstract = false, fields = listOf(
+ PlanField.scalar("customLists", key = StorageKey.Fixed(Slots.MediaListTypeOptions.customLists), kind = ScalarKind.STRING, list = true),
+ PlanField.scalar("advancedScoringEnabled", key = StorageKey.Fixed(Slots.MediaListTypeOptions.advancedScoringEnabled), kind = ScalarKind.BOOL, list = false),
+ ))
+ }
+ val selection4: Selection by lazy {
+ Selection(type = Types.UserAvatar, key = listOf(), isAbstract = false, fields = listOf(
+ PlanField.scalar("large", key = StorageKey.Fixed(Slots.UserAvatar.large), kind = ScalarKind.STRING, list = false),
+ ))
+ }
+}
diff --git a/compiler/src/tests/goldens-anilist-kotlin/Baton.baton.kt b/compiler/src/tests/goldens-anilist-kotlin/Baton.baton.kt
new file mode 100644
index 00000000..04ca7d5b
--- /dev/null
+++ b/compiler/src/tests/goldens-anilist-kotlin/Baton.baton.kt
@@ -0,0 +1,442 @@
+// Generated by batonc. Do not edit.
+@file:OptIn(baton.Generated::class)
+
+package baton.goldens.anilist
+
+import baton.DynamicKey
+import baton.GeneratedEnum
+import baton.KeyArgument
+import baton.KeyPart
+import baton.Registry
+import baton.Slot
+import baton.TypeID
+
+/** Interned schema types used by this module's documents. */
+object Types {
+ /** The schema's digest: pass it as the image's `version`, so an image written under another schema starts again. */
+ val schemaDigest = "64c79d9bee49eec0fb16214f1f7b77c0"
+ /** The format of this generated code, which the runtime that reads it declares; a runtime of another format fails to compile this line. */
+ val format = baton.Format4
+ val ActivityLikeNotification: TypeID = Registry.type("ActivityLikeNotification")
+ val ActivityMentionNotification: TypeID = Registry.type("ActivityMentionNotification")
+ val ActivityMessageNotification: TypeID = Registry.type("ActivityMessageNotification")
+ val ActivityReplyLikeNotification: TypeID = Registry.type("ActivityReplyLikeNotification")
+ val ActivityReplyNotification: TypeID = Registry.type("ActivityReplyNotification")
+ val ActivityReplySubscribedNotification: TypeID = Registry.type("ActivityReplySubscribedNotification")
+ val AiringNotification: TypeID = Registry.type("AiringNotification")
+ val AiringSchedule: TypeID = Registry.type("AiringSchedule")
+ val CharacterSubmissionUpdateNotification: TypeID = Registry.type("CharacterSubmissionUpdateNotification")
+ val Deleted: TypeID = Registry.type("Deleted")
+ val FollowingNotification: TypeID = Registry.type("FollowingNotification")
+ val FuzzyDate: TypeID = Registry.type("FuzzyDate")
+ val Media: TypeID = Registry.type("Media")
+ val MediaConnection: TypeID = Registry.type("MediaConnection")
+ val MediaCoverImage: TypeID = Registry.type("MediaCoverImage")
+ val MediaDataChangeNotification: TypeID = Registry.type("MediaDataChangeNotification")
+ val MediaDeletionNotification: TypeID = Registry.type("MediaDeletionNotification")
+ val MediaEdge: TypeID = Registry.type("MediaEdge")
+ val MediaList: TypeID = Registry.type("MediaList")
+ val MediaListCollection: TypeID = Registry.type("MediaListCollection")
+ val MediaListGroup: TypeID = Registry.type("MediaListGroup")
+ val MediaListOptions: TypeID = Registry.type("MediaListOptions")
+ val MediaListTypeOptions: TypeID = Registry.type("MediaListTypeOptions")
+ val MediaMergeNotification: TypeID = Registry.type("MediaMergeNotification")
+ val MediaSubmissionUpdateNotification: TypeID = Registry.type("MediaSubmissionUpdateNotification")
+ val MediaTitle: TypeID = Registry.type("MediaTitle")
+ val Mutation: TypeID = Registry.type("Mutation")
+ val NotificationUnion: TypeID = Registry.type("NotificationUnion")
+ val Page: TypeID = Registry.type("Page")
+ val PageInfo: TypeID = Registry.type("PageInfo")
+ val Query: TypeID = Registry.type("Query")
+ val RelatedMediaAdditionNotification: TypeID = Registry.type("RelatedMediaAdditionNotification")
+ val StaffSubmissionUpdateNotification: TypeID = Registry.type("StaffSubmissionUpdateNotification")
+ val ThreadComment: TypeID = Registry.type("ThreadComment")
+ val ThreadCommentLikeNotification: TypeID = Registry.type("ThreadCommentLikeNotification")
+ val ThreadCommentMentionNotification: TypeID = Registry.type("ThreadCommentMentionNotification")
+ val ThreadCommentReplyNotification: TypeID = Registry.type("ThreadCommentReplyNotification")
+ val ThreadCommentSubscribedNotification: TypeID = Registry.type("ThreadCommentSubscribedNotification")
+ val ThreadLikeNotification: TypeID = Registry.type("ThreadLikeNotification")
+ val User: TypeID = Registry.type("User")
+ val UserAvatar: TypeID = Registry.type("UserAvatar")
+}
+
+/** Interned storage keys used by this module's documents. */
+object Slots {
+ object ActivityLikeNotification {
+ val __typename: Slot = Registry.slot(Types.ActivityLikeNotification, "__typename")
+ val activityId: Slot = Registry.slot(Types.ActivityLikeNotification, "activityId")
+ val id: Slot = Registry.slot(Types.ActivityLikeNotification, "id")
+ val user: Slot = Registry.slot(Types.ActivityLikeNotification, "user")
+ }
+ object AiringNotification {
+ val __typename: Slot = Registry.slot(Types.AiringNotification, "__typename")
+ val contexts: Slot = Registry.slot(Types.AiringNotification, "contexts")
+ val episode: Slot = Registry.slot(Types.AiringNotification, "episode")
+ val id: Slot = Registry.slot(Types.AiringNotification, "id")
+ val media: Slot = Registry.slot(Types.AiringNotification, "media")
+ }
+ object AiringSchedule {
+ val airingAt: Slot = Registry.slot(Types.AiringSchedule, "airingAt")
+ val episode: Slot = Registry.slot(Types.AiringSchedule, "episode")
+ val id: Slot = Registry.slot(Types.AiringSchedule, "id")
+ }
+ object Deleted {
+ val deleted: Slot = Registry.slot(Types.Deleted, "deleted")
+ }
+ object FollowingNotification {
+ val __typename: Slot = Registry.slot(Types.FollowingNotification, "__typename")
+ val id: Slot = Registry.slot(Types.FollowingNotification, "id")
+ val user: Slot = Registry.slot(Types.FollowingNotification, "user")
+ }
+ object FuzzyDate {
+ val day: Slot = Registry.slot(Types.FuzzyDate, "day")
+ val month: Slot = Registry.slot(Types.FuzzyDate, "month")
+ val year: Slot = Registry.slot(Types.FuzzyDate, "year")
+ }
+ object Media {
+ val chapters: Slot = Registry.slot(Types.Media, "chapters")
+ val countryOfOrigin: Slot = Registry.slot(Types.Media, "countryOfOrigin")
+ val coverImage: Slot = Registry.slot(Types.Media, "coverImage")
+ val duration: Slot = Registry.slot(Types.Media, "duration")
+ val episodes: Slot = Registry.slot(Types.Media, "episodes")
+ val format: Slot = Registry.slot(Types.Media, "format")
+ val id: Slot = Registry.slot(Types.Media, "id")
+ val idMal: Slot = Registry.slot(Types.Media, "idMal")
+ val isAdult: Slot = Registry.slot(Types.Media, "isAdult")
+ val nextAiringEpisode: Slot = Registry.slot(Types.Media, "nextAiringEpisode")
+ val relations: Slot = Registry.slot(Types.Media, "relations")
+ val season: Slot = Registry.slot(Types.Media, "season")
+ val seasonYear: Slot = Registry.slot(Types.Media, "seasonYear")
+ val siteUrl: Slot = Registry.slot(Types.Media, "siteUrl")
+ val source_3f939b: Slot = Registry.slot(Types.Media, "source(version:3)")
+ val status: Slot = Registry.slot(Types.Media, "status")
+ val status_98c3c3: Slot = Registry.slot(Types.Media, "status(version:2)")
+ val title: Slot = Registry.slot(Types.Media, "title")
+ val type: Slot = Registry.slot(Types.Media, "type")
+ val volumes: Slot = Registry.slot(Types.Media, "volumes")
+ }
+ object MediaConnection {
+ val edges: Slot = Registry.slot(Types.MediaConnection, "edges")
+ }
+ object MediaCoverImage {
+ val color: Slot = Registry.slot(Types.MediaCoverImage, "color")
+ val large: Slot = Registry.slot(Types.MediaCoverImage, "large")
+ }
+ object MediaDataChangeNotification {
+ val __typename: Slot = Registry.slot(Types.MediaDataChangeNotification, "__typename")
+ val id: Slot = Registry.slot(Types.MediaDataChangeNotification, "id")
+ val mediaId: Slot = Registry.slot(Types.MediaDataChangeNotification, "mediaId")
+ val reason: Slot = Registry.slot(Types.MediaDataChangeNotification, "reason")
+ }
+ object MediaEdge {
+ val id: Slot = Registry.slot(Types.MediaEdge, "id")
+ val node: Slot = Registry.slot(Types.MediaEdge, "node")
+ val relationType_4caf07: Slot = Registry.slot(Types.MediaEdge, "relationType(version:2)")
+ }
+ object MediaList {
+ val advancedScores: Slot = Registry.slot(Types.MediaList, "advancedScores")
+ val completedAt: Slot = Registry.slot(Types.MediaList, "completedAt")
+ val customLists_3a6c27: Slot = Registry.slot(Types.MediaList, "customLists(asArray:true)")
+ val hiddenFromStatusLists: Slot = Registry.slot(Types.MediaList, "hiddenFromStatusLists")
+ val id: Slot = Registry.slot(Types.MediaList, "id")
+ val media: Slot = Registry.slot(Types.MediaList, "media")
+ val notes: Slot = Registry.slot(Types.MediaList, "notes")
+ val priority: Slot = Registry.slot(Types.MediaList, "priority")
+ val private: Slot = Registry.slot(Types.MediaList, "private")
+ val progress: Slot = Registry.slot(Types.MediaList, "progress")
+ val progressVolumes: Slot = Registry.slot(Types.MediaList, "progressVolumes")
+ val repeat: Slot = Registry.slot(Types.MediaList, "repeat")
+ val score: Slot = Registry.slot(Types.MediaList, "score")
+ val startedAt: Slot = Registry.slot(Types.MediaList, "startedAt")
+ val status: Slot = Registry.slot(Types.MediaList, "status")
+ val updatedAt: Slot = Registry.slot(Types.MediaList, "updatedAt")
+ }
+ object MediaListCollection {
+ val hasNextChunk: Slot = Registry.slot(Types.MediaListCollection, "hasNextChunk")
+ val lists: Slot = Registry.slot(Types.MediaListCollection, "lists")
+ }
+ object MediaListGroup {
+ val entries: Slot = Registry.slot(Types.MediaListGroup, "entries")
+ val isCustomList: Slot = Registry.slot(Types.MediaListGroup, "isCustomList")
+ val name: Slot = Registry.slot(Types.MediaListGroup, "name")
+ val status: Slot = Registry.slot(Types.MediaListGroup, "status")
+ }
+ object MediaListOptions {
+ val animeList: Slot = Registry.slot(Types.MediaListOptions, "animeList")
+ val scoreFormat: Slot = Registry.slot(Types.MediaListOptions, "scoreFormat")
+ }
+ object MediaListTypeOptions {
+ val advancedScoringEnabled: Slot = Registry.slot(Types.MediaListTypeOptions, "advancedScoringEnabled")
+ val customLists: Slot = Registry.slot(Types.MediaListTypeOptions, "customLists")
+ }
+ object MediaTitle {
+ val english: Slot = Registry.slot(Types.MediaTitle, "english")
+ val native: Slot = Registry.slot(Types.MediaTitle, "native")
+ val romaji: Slot = Registry.slot(Types.MediaTitle, "romaji")
+ val userPreferred: Slot = Registry.slot(Types.MediaTitle, "userPreferred")
+ }
+ object Mutation {
+ val DeleteMediaListEntry: Slot = Registry.slot(Types.Mutation, "DeleteMediaListEntry")
+ val SaveMediaListEntry: Slot = Registry.slot(Types.Mutation, "SaveMediaListEntry")
+ }
+ object NotificationUnion {
+ val __typename: Slot = Registry.slot(Types.NotificationUnion, "__typename")
+ val id: Slot = Registry.slot(Types.NotificationUnion, "id")
+ }
+ object Page {
+ val media_aca52b = DynamicKey(Types.Page, "media", listOf(KeyArgument("season", listOf(KeyPart.Variable("season"))), KeyArgument("seasonYear", listOf(KeyPart.Variable("seasonYear"))), KeyArgument("sort", listOf(KeyPart.Literal("[\"POPULARITY_DESC\"]"))), KeyArgument("type", listOf(KeyPart.Literal("\"ANIME\"")))))
+ val notifications: Slot = Registry.slot(Types.Page, "notifications")
+ val pageInfo: Slot = Registry.slot(Types.Page, "pageInfo")
+ val threadComments_88ffc8 = DynamicKey(Types.Page, "threadComments", listOf(KeyArgument("threadId", listOf(KeyPart.Variable("threadId")))))
+ }
+ object PageInfo {
+ val hasNextPage: Slot = Registry.slot(Types.PageInfo, "hasNextPage")
+ }
+ object Query {
+ val Media_976b29 = DynamicKey(Types.Query, "Media", listOf(KeyArgument("id", listOf(KeyPart.Variable("id")))))
+ val MediaList_8bfff7 = DynamicKey(Types.Query, "MediaList", listOf(KeyArgument("id", listOf(KeyPart.Variable("id")))))
+ val MediaListCollection_fc1216 = DynamicKey(Types.Query, "MediaListCollection", listOf(KeyArgument("chunk", listOf(KeyPart.Variable("chunk"))), KeyArgument("forceSingleCompletedList", listOf(KeyPart.Literal("true"))), KeyArgument("perChunk", listOf(KeyPart.Literal("500"))), KeyArgument("type", listOf(KeyPart.Variable("mediaType"))), KeyArgument("userId", listOf(KeyPart.Variable("userId")))))
+ val Page_839a80 = DynamicKey(Types.Query, "Page", listOf(KeyArgument("page", listOf(KeyPart.Variable("page"))), KeyArgument("perPage", listOf(KeyPart.Literal("25")))))
+ val Page_9d9873 = DynamicKey(Types.Query, "Page", listOf(KeyArgument("page", listOf(KeyPart.Variable("page"))), KeyArgument("perPage", listOf(KeyPart.Literal("48")))))
+ val Page_c5f40b: Slot = Registry.slot(Types.Query, "Page(page:1,perPage:25)")
+ val Viewer: Slot = Registry.slot(Types.Query, "Viewer")
+ }
+ object ThreadComment {
+ val childComments: Slot = Registry.slot(Types.ThreadComment, "childComments")
+ val comment: Slot = Registry.slot(Types.ThreadComment, "comment")
+ val id: Slot = Registry.slot(Types.ThreadComment, "id")
+ }
+ object ThreadCommentReplyNotification {
+ val __typename: Slot = Registry.slot(Types.ThreadCommentReplyNotification, "__typename")
+ val commentId: Slot = Registry.slot(Types.ThreadCommentReplyNotification, "commentId")
+ val id: Slot = Registry.slot(Types.ThreadCommentReplyNotification, "id")
+ }
+ object User {
+ val avatar: Slot = Registry.slot(Types.User, "avatar")
+ val id: Slot = Registry.slot(Types.User, "id")
+ val mediaListOptions: Slot = Registry.slot(Types.User, "mediaListOptions")
+ val name: Slot = Registry.slot(Types.User, "name")
+ val unreadNotificationCount: Slot = Registry.slot(Types.User, "unreadNotificationCount")
+ }
+ object UserAvatar {
+ val large: Slot = Registry.slot(Types.UserAvatar, "large")
+ }
+}
+
+/** The schema's enum `MediaFormat`. A value this build does not know reads as `Undeclared`, with its text. */
+sealed interface MediaFormat : GeneratedEnum {
+ data object TV : MediaFormat { override val scalarText: String get() = "TV" }
+ data object TV_SHORT : MediaFormat { override val scalarText: String get() = "TV_SHORT" }
+ data object MOVIE : MediaFormat { override val scalarText: String get() = "MOVIE" }
+ data object SPECIAL : MediaFormat { override val scalarText: String get() = "SPECIAL" }
+ data object OVA : MediaFormat { override val scalarText: String get() = "OVA" }
+ data object ONA : MediaFormat { override val scalarText: String get() = "ONA" }
+ data object MUSIC : MediaFormat { override val scalarText: String get() = "MUSIC" }
+ data object MANGA : MediaFormat { override val scalarText: String get() = "MANGA" }
+ data object NOVEL : MediaFormat { override val scalarText: String get() = "NOVEL" }
+ data object ONE_SHOT : MediaFormat { override val scalarText: String get() = "ONE_SHOT" }
+ data class Undeclared(override val scalarText: String) : MediaFormat
+
+ companion object {
+ /** The value `text` names, or `Undeclared` with it. */
+ fun of(text: String): MediaFormat = when (text) {
+ "TV" -> TV
+ "TV_SHORT" -> TV_SHORT
+ "MOVIE" -> MOVIE
+ "SPECIAL" -> SPECIAL
+ "OVA" -> OVA
+ "ONA" -> ONA
+ "MUSIC" -> MUSIC
+ "MANGA" -> MANGA
+ "NOVEL" -> NOVEL
+ "ONE_SHOT" -> ONE_SHOT
+ else -> Undeclared(text)
+ }
+ }
+}
+
+/** The schema's enum `MediaListStatus`. A value this build does not know reads as `Undeclared`, with its text. */
+sealed interface MediaListStatus : GeneratedEnum {
+ data object CURRENT : MediaListStatus { override val scalarText: String get() = "CURRENT" }
+ data object PLANNING : MediaListStatus { override val scalarText: String get() = "PLANNING" }
+ data object COMPLETED : MediaListStatus { override val scalarText: String get() = "COMPLETED" }
+ data object DROPPED : MediaListStatus { override val scalarText: String get() = "DROPPED" }
+ data object PAUSED : MediaListStatus { override val scalarText: String get() = "PAUSED" }
+ data object REPEATING : MediaListStatus { override val scalarText: String get() = "REPEATING" }
+ data class Undeclared(override val scalarText: String) : MediaListStatus
+
+ companion object {
+ /** The value `text` names, or `Undeclared` with it. */
+ fun of(text: String): MediaListStatus = when (text) {
+ "CURRENT" -> CURRENT
+ "PLANNING" -> PLANNING
+ "COMPLETED" -> COMPLETED
+ "DROPPED" -> DROPPED
+ "PAUSED" -> PAUSED
+ "REPEATING" -> REPEATING
+ else -> Undeclared(text)
+ }
+ }
+}
+
+/** The schema's enum `MediaRelation`. A value this build does not know reads as `Undeclared`, with its text. */
+sealed interface MediaRelation : GeneratedEnum {
+ data object ADAPTATION : MediaRelation { override val scalarText: String get() = "ADAPTATION" }
+ data object PREQUEL : MediaRelation { override val scalarText: String get() = "PREQUEL" }
+ data object SEQUEL : MediaRelation { override val scalarText: String get() = "SEQUEL" }
+ data object PARENT : MediaRelation { override val scalarText: String get() = "PARENT" }
+ data object SIDE_STORY : MediaRelation { override val scalarText: String get() = "SIDE_STORY" }
+ data object CHARACTER : MediaRelation { override val scalarText: String get() = "CHARACTER" }
+ data object SUMMARY : MediaRelation { override val scalarText: String get() = "SUMMARY" }
+ data object ALTERNATIVE : MediaRelation { override val scalarText: String get() = "ALTERNATIVE" }
+ data object SPIN_OFF : MediaRelation { override val scalarText: String get() = "SPIN_OFF" }
+ data object OTHER : MediaRelation { override val scalarText: String get() = "OTHER" }
+ data object SOURCE : MediaRelation { override val scalarText: String get() = "SOURCE" }
+ data object COMPILATION : MediaRelation { override val scalarText: String get() = "COMPILATION" }
+ data object CONTAINS : MediaRelation { override val scalarText: String get() = "CONTAINS" }
+ data object SAME_UNIVERSE : MediaRelation { override val scalarText: String get() = "SAME_UNIVERSE" }
+ data class Undeclared(override val scalarText: String) : MediaRelation
+
+ companion object {
+ /** The value `text` names, or `Undeclared` with it. */
+ fun of(text: String): MediaRelation = when (text) {
+ "ADAPTATION" -> ADAPTATION
+ "PREQUEL" -> PREQUEL
+ "SEQUEL" -> SEQUEL
+ "PARENT" -> PARENT
+ "SIDE_STORY" -> SIDE_STORY
+ "CHARACTER" -> CHARACTER
+ "SUMMARY" -> SUMMARY
+ "ALTERNATIVE" -> ALTERNATIVE
+ "SPIN_OFF" -> SPIN_OFF
+ "OTHER" -> OTHER
+ "SOURCE" -> SOURCE
+ "COMPILATION" -> COMPILATION
+ "CONTAINS" -> CONTAINS
+ "SAME_UNIVERSE" -> SAME_UNIVERSE
+ else -> Undeclared(text)
+ }
+ }
+}
+
+/** The schema's enum `MediaSeason`. A value this build does not know reads as `Undeclared`, with its text. */
+sealed interface MediaSeason : GeneratedEnum {
+ data object WINTER : MediaSeason { override val scalarText: String get() = "WINTER" }
+ data object SPRING : MediaSeason { override val scalarText: String get() = "SPRING" }
+ data object SUMMER : MediaSeason { override val scalarText: String get() = "SUMMER" }
+ data object FALL : MediaSeason { override val scalarText: String get() = "FALL" }
+ data class Undeclared(override val scalarText: String) : MediaSeason
+
+ companion object {
+ /** The value `text` names, or `Undeclared` with it. */
+ fun of(text: String): MediaSeason = when (text) {
+ "WINTER" -> WINTER
+ "SPRING" -> SPRING
+ "SUMMER" -> SUMMER
+ "FALL" -> FALL
+ else -> Undeclared(text)
+ }
+ }
+}
+
+/** The schema's enum `MediaSource`. A value this build does not know reads as `Undeclared`, with its text. */
+sealed interface MediaSource : GeneratedEnum {
+ data object ORIGINAL : MediaSource { override val scalarText: String get() = "ORIGINAL" }
+ data object MANGA : MediaSource { override val scalarText: String get() = "MANGA" }
+ data object LIGHT_NOVEL : MediaSource { override val scalarText: String get() = "LIGHT_NOVEL" }
+ data object VISUAL_NOVEL : MediaSource { override val scalarText: String get() = "VISUAL_NOVEL" }
+ data object VIDEO_GAME : MediaSource { override val scalarText: String get() = "VIDEO_GAME" }
+ data object OTHER : MediaSource { override val scalarText: String get() = "OTHER" }
+ data object NOVEL : MediaSource { override val scalarText: String get() = "NOVEL" }
+ data object DOUJINSHI : MediaSource { override val scalarText: String get() = "DOUJINSHI" }
+ data object ANIME : MediaSource { override val scalarText: String get() = "ANIME" }
+ data object WEB_NOVEL : MediaSource { override val scalarText: String get() = "WEB_NOVEL" }
+ data object LIVE_ACTION : MediaSource { override val scalarText: String get() = "LIVE_ACTION" }
+ data object GAME : MediaSource { override val scalarText: String get() = "GAME" }
+ data object COMIC : MediaSource { override val scalarText: String get() = "COMIC" }
+ data object MULTIMEDIA_PROJECT : MediaSource { override val scalarText: String get() = "MULTIMEDIA_PROJECT" }
+ data object PICTURE_BOOK : MediaSource { override val scalarText: String get() = "PICTURE_BOOK" }
+ data class Undeclared(override val scalarText: String) : MediaSource
+
+ companion object {
+ /** The value `text` names, or `Undeclared` with it. */
+ fun of(text: String): MediaSource = when (text) {
+ "ORIGINAL" -> ORIGINAL
+ "MANGA" -> MANGA
+ "LIGHT_NOVEL" -> LIGHT_NOVEL
+ "VISUAL_NOVEL" -> VISUAL_NOVEL
+ "VIDEO_GAME" -> VIDEO_GAME
+ "OTHER" -> OTHER
+ "NOVEL" -> NOVEL
+ "DOUJINSHI" -> DOUJINSHI
+ "ANIME" -> ANIME
+ "WEB_NOVEL" -> WEB_NOVEL
+ "LIVE_ACTION" -> LIVE_ACTION
+ "GAME" -> GAME
+ "COMIC" -> COMIC
+ "MULTIMEDIA_PROJECT" -> MULTIMEDIA_PROJECT
+ "PICTURE_BOOK" -> PICTURE_BOOK
+ else -> Undeclared(text)
+ }
+ }
+}
+
+/** The schema's enum `MediaStatus`. A value this build does not know reads as `Undeclared`, with its text. */
+sealed interface MediaStatus : GeneratedEnum {
+ data object FINISHED : MediaStatus { override val scalarText: String get() = "FINISHED" }
+ data object RELEASING : MediaStatus { override val scalarText: String get() = "RELEASING" }
+ data object NOT_YET_RELEASED : MediaStatus { override val scalarText: String get() = "NOT_YET_RELEASED" }
+ data object CANCELLED : MediaStatus { override val scalarText: String get() = "CANCELLED" }
+ data object HIATUS : MediaStatus { override val scalarText: String get() = "HIATUS" }
+ data class Undeclared(override val scalarText: String) : MediaStatus
+
+ companion object {
+ /** The value `text` names, or `Undeclared` with it. */
+ fun of(text: String): MediaStatus = when (text) {
+ "FINISHED" -> FINISHED
+ "RELEASING" -> RELEASING
+ "NOT_YET_RELEASED" -> NOT_YET_RELEASED
+ "CANCELLED" -> CANCELLED
+ "HIATUS" -> HIATUS
+ else -> Undeclared(text)
+ }
+ }
+}
+
+/** The schema's enum `MediaType`. A value this build does not know reads as `Undeclared`, with its text. */
+sealed interface MediaType : GeneratedEnum {
+ data object ANIME : MediaType { override val scalarText: String get() = "ANIME" }
+ data object MANGA : MediaType { override val scalarText: String get() = "MANGA" }
+ data class Undeclared(override val scalarText: String) : MediaType
+
+ companion object {
+ /** The value `text` names, or `Undeclared` with it. */
+ fun of(text: String): MediaType = when (text) {
+ "ANIME" -> ANIME
+ "MANGA" -> MANGA
+ else -> Undeclared(text)
+ }
+ }
+}
+
+/** The schema's enum `ScoreFormat`. A value this build does not know reads as `Undeclared`, with its text. */
+sealed interface ScoreFormat : GeneratedEnum {
+ data object POINT_100 : ScoreFormat { override val scalarText: String get() = "POINT_100" }
+ data object POINT_10_DECIMAL : ScoreFormat { override val scalarText: String get() = "POINT_10_DECIMAL" }
+ data object POINT_10 : ScoreFormat { override val scalarText: String get() = "POINT_10" }
+ data object POINT_5 : ScoreFormat { override val scalarText: String get() = "POINT_5" }
+ data object POINT_3 : ScoreFormat { override val scalarText: String get() = "POINT_3" }
+ data class Undeclared(override val scalarText: String) : ScoreFormat
+
+ companion object {
+ /** The value `text` names, or `Undeclared` with it. */
+ fun of(text: String): ScoreFormat = when (text) {
+ "POINT_100" -> POINT_100
+ "POINT_10_DECIMAL" -> POINT_10_DECIMAL
+ "POINT_10" -> POINT_10
+ "POINT_5" -> POINT_5
+ "POINT_3" -> POINT_3
+ else -> Undeclared(text)
+ }
+ }
+}
diff --git a/compiler/src/tests/goldens-anilist/AniListDocuments.baton.swift b/compiler/src/tests/goldens-anilist/AniListDocuments.baton.swift
new file mode 100644
index 00000000..bdc05e54
--- /dev/null
+++ b/compiler/src/tests/goldens-anilist/AniListDocuments.baton.swift
@@ -0,0 +1,665 @@
+// Generated by batonc. Do not edit.
+import Foundation
+@_spi(Generated) import Baton
+
+/// Lens for `fragment EntryRow_mediaList on MediaList`.
+nonisolated public struct EntryRow_mediaList: Baton.Lens {
+ @_spi(Generated) public let anchor: Baton.Anchor
+ @_spi(Generated) public init(anchor: Baton.Anchor) { self.anchor = anchor }
+ @MainActor public var id: Int { anchor.requiredInt(Slots.MediaList.id) }
+ @MainActor public var status: MediaListStatus? { anchor.enumValue(Slots.MediaList.status) }
+ @MainActor public var progress: Int? { anchor.int(Slots.MediaList.progress) }
+ @MainActor public var progressVolumes: Int? { anchor.int(Slots.MediaList.progressVolumes) }
+ @MainActor public var score: Double? { anchor.double(Slots.MediaList.score) }
+ @MainActor public var `repeat`: Int? { anchor.int(Slots.MediaList.`repeat`) }
+ @MainActor public var priority: Int? { anchor.int(Slots.MediaList.priority) }
+ @MainActor public var notes: String? { anchor.string(Slots.MediaList.notes) }
+ @MainActor public var `private`: Bool? { anchor.bool(Slots.MediaList.`private`) }
+ @MainActor public var hiddenFromStatusLists: Bool? { anchor.bool(Slots.MediaList.hiddenFromStatusLists) }
+ @MainActor public var customLists: String? { anchor.string(Slots.MediaList.customLists_3a6c27) }
+ @MainActor public var startedAt: StartedAt? { anchor.linked(Slots.MediaList.startedAt).map(StartedAt.init(anchor:)) }
+ @MainActor public var completedAt: CompletedAt? { anchor.linked(Slots.MediaList.completedAt).map(CompletedAt.init(anchor:)) }
+ @MainActor public var updatedAt: Int? { anchor.int(Slots.MediaList.updatedAt) }
+ @MainActor public var media: Media? { anchor.linked(Slots.MediaList.media).map(Media.init(anchor:)) }
+
+ nonisolated public struct StartedAt: Baton.Lens {
+ @_spi(Generated) public let anchor: Baton.Anchor
+ @_spi(Generated) public init(anchor: Baton.Anchor) { self.anchor = anchor }
+ @MainActor public var year: Int? { anchor.int(Slots.FuzzyDate.year) }
+ @MainActor public var month: Int? { anchor.int(Slots.FuzzyDate.month) }
+ @MainActor public var day: Int? { anchor.int(Slots.FuzzyDate.day) }
+ }
+
+ nonisolated public struct CompletedAt: Baton.Lens {
+ @_spi(Generated) public let anchor: Baton.Anchor
+ @_spi(Generated) public init(anchor: Baton.Anchor) { self.anchor = anchor }
+ @MainActor public var year: Int? { anchor.int(Slots.FuzzyDate.year) }
+ @MainActor public var month: Int? { anchor.int(Slots.FuzzyDate.month) }
+ @MainActor public var day: Int? { anchor.int(Slots.FuzzyDate.day) }
+ }
+
+ nonisolated public struct Media: Baton.Lens {
+ @_spi(Generated) public let anchor: Baton.Anchor
+ @_spi(Generated) public init(anchor: Baton.Anchor) { self.anchor = anchor }
+ @MainActor public var id: Int { anchor.requiredInt(Slots.Media.id) }
+ @MainActor public var mediaCard: MediaCard_media { .init(anchor: anchor.entering()) }
+ }
+}
+
+/// Lens for `fragment MediaCard_media on Media`.
+nonisolated public struct MediaCard_media: Baton.Lens {
+ @_spi(Generated) public let anchor: Baton.Anchor
+ @_spi(Generated) public init(anchor: Baton.Anchor) { self.anchor = anchor }
+ @MainActor public var id: Int { anchor.requiredInt(Slots.Media.id) }
+ @MainActor public var idMal: Int? { anchor.int(Slots.Media.idMal) }
+ @MainActor public var type: MediaType? { anchor.enumValue(Slots.Media.type) }
+ @MainActor public var format: MediaFormat? { anchor.enumValue(Slots.Media.format) }
+ @MainActor public var status: MediaStatus? { anchor.enumValue(Slots.Media.status_98c3c3) }
+ @MainActor public var episodes: Int? { anchor.int(Slots.Media.episodes) }
+ @MainActor public var chapters: Int? { anchor.int(Slots.Media.chapters) }
+ @MainActor public var volumes: Int? { anchor.int(Slots.Media.volumes) }
+ @MainActor public var duration: Int? { anchor.int(Slots.Media.duration) }
+ @MainActor public var season: MediaSeason? { anchor.enumValue(Slots.Media.season) }
+ @MainActor public var seasonYear: Int? { anchor.int(Slots.Media.seasonYear) }
+ @MainActor public var countryOfOrigin: String? { anchor.string(Slots.Media.countryOfOrigin) }
+ @MainActor public var isAdult: Bool? { anchor.bool(Slots.Media.isAdult) }
+ @MainActor public var siteUrl: String? { anchor.string(Slots.Media.siteUrl) }
+ @MainActor public var title: Title? { anchor.linked(Slots.Media.title).map(Title.init(anchor:)) }
+ @MainActor public var coverImage: CoverImage? { anchor.linked(Slots.Media.coverImage).map(CoverImage.init(anchor:)) }
+ @MainActor public var nextAiringEpisode: NextAiringEpisode? { anchor.linked(Slots.Media.nextAiringEpisode).map(NextAiringEpisode.init(anchor:)) }
+
+ nonisolated public struct Title: Baton.Lens {
+ @_spi(Generated) public let anchor: Baton.Anchor
+ @_spi(Generated) public init(anchor: Baton.Anchor) { self.anchor = anchor }
+ @MainActor public var romaji: String? { anchor.string(Slots.MediaTitle.romaji) }
+ @MainActor public var english: String? { anchor.string(Slots.MediaTitle.english) }
+ @MainActor public var native: String? { anchor.string(Slots.MediaTitle.native) }
+ @MainActor public var userPreferred: String? { anchor.string(Slots.MediaTitle.userPreferred) }
+ }
+
+ nonisolated public struct CoverImage: Baton.Lens {
+ @_spi(Generated) public let anchor: Baton.Anchor
+ @_spi(Generated) public init(anchor: Baton.Anchor) { self.anchor = anchor }
+ @MainActor public var large: String? { anchor.string(Slots.MediaCoverImage.large) }
+ @MainActor public var color: String? { anchor.string(Slots.MediaCoverImage.color) }
+ }
+
+ nonisolated public struct NextAiringEpisode: Baton.Lens {
+ @_spi(Generated) public let anchor: Baton.Anchor
+ @_spi(Generated) public init(anchor: Baton.Anchor) { self.anchor = anchor }
+ @MainActor public var id: Int { anchor.requiredInt(Slots.AiringSchedule.id) }
+ @MainActor public var episode: Int { anchor.requiredInt(Slots.AiringSchedule.episode) }
+ @MainActor public var airingAt: Int { anchor.requiredInt(Slots.AiringSchedule.airingAt) }
+ }
+}
+
+/// Operation value for `query EntryQuery`.
+nonisolated public struct EntryQuery: Baton.Query {
+ public var id: Int
+ @_spi(Generated) public var resolution: Baton.Resolution> = .unresolved
+
+ public init(id: Int) {
+ self.id = id
+ }
+
+ public static let name = "EntryQuery"
+ public static let document: Baton.Document = .text(#"query EntryQuery($id:Int!){MediaList(id:$id){id,...EntryRow_mediaList}}fragment EntryRow_mediaList on MediaList{id,status,progress,progressVolumes,score,repeat,priority,notes,private,hiddenFromStatusLists,customLists(asArray:true),startedAt{year,month,day},completedAt{year,month,day},updatedAt,media{id,...MediaCard_media}}fragment MediaCard_media on Media{id,idMal,type,format,status(version:2),episodes,chapters,volumes,duration,season,seasonYear,countryOfOrigin,isAdult,siteUrl,title{romaji,english,native,userPreferred},coverImage{large,color},nextAiringEpisode{id,episode,airingAt}}"#)
+
+ public var variables: Baton.Variables {
+ Baton.Variables(["id": Baton.Variable(self.id)])
+ }
+
+ public static func == (lhs: Self, rhs: Self) -> Bool {
+ lhs.id == rhs.id
+ }
+
+ public func hash(into hasher: inout Hasher) {
+ hasher.combine(self.id)
+ }
+
+ @_spi(Generated) public static let plan = Baton.Plan(root: selection0)
+ private static let selection0: Baton.Selection = Baton.Selection(type: Types.Query, key: [], abstract: false, fields: [
+ .linked("MediaList", key: .dynamic(Slots.Query.MediaList_8bfff7), plural: false, lookup: Baton.Lookup(type: Types.MediaList, key: [.variable("id")]), selection: selection1),
+ ])
+ private static let selection1: Baton.Selection = Baton.Selection(type: Types.MediaList, key: ["id"], abstract: false, fields: [
+ .scalar("id", key: .fixed(Slots.MediaList.id), kind: .int, list: false),
+ .scalar("status", key: .fixed(Slots.MediaList.status), kind: .string, list: false),
+ .scalar("progress", key: .fixed(Slots.MediaList.progress), kind: .int, list: false),
+ .scalar("progressVolumes", key: .fixed(Slots.MediaList.progressVolumes), kind: .int, list: false),
+ .scalar("score", key: .fixed(Slots.MediaList.score), kind: .double, list: false),
+ .scalar("repeat", key: .fixed(Slots.MediaList.`repeat`), kind: .int, list: false),
+ .scalar("priority", key: .fixed(Slots.MediaList.priority), kind: .int, list: false),
+ .scalar("notes", key: .fixed(Slots.MediaList.notes), kind: .string, list: false),
+ .scalar("private", key: .fixed(Slots.MediaList.`private`), kind: .bool, list: false),
+ .scalar("hiddenFromStatusLists", key: .fixed(Slots.MediaList.hiddenFromStatusLists), kind: .bool, list: false),
+ .scalar("customLists", key: .fixed(Slots.MediaList.customLists_3a6c27), kind: .custom, list: false),
+ .linked("startedAt", key: .fixed(Slots.MediaList.startedAt), plural: false, selection: selection6),
+ .linked("completedAt", key: .fixed(Slots.MediaList.completedAt), plural: false, selection: selection6),
+ .scalar("updatedAt", key: .fixed(Slots.MediaList.updatedAt), kind: .int, list: false),
+ .linked("media", key: .fixed(Slots.MediaList.media), plural: false, selection: selection2),
+ ])
+ private static let selection2: Baton.Selection = Baton.Selection(type: Types.Media, key: ["id"], abstract: false, fields: [
+ .scalar("id", key: .fixed(Slots.Media.id), kind: .int, list: false),
+ .scalar("idMal", key: .fixed(Slots.Media.idMal), kind: .int, list: false),
+ .scalar("type", key: .fixed(Slots.Media.type), kind: .string, list: false),
+ .scalar("format", key: .fixed(Slots.Media.format), kind: .string, list: false),
+ .scalar("status", key: .fixed(Slots.Media.status_98c3c3), kind: .string, list: false),
+ .scalar("episodes", key: .fixed(Slots.Media.episodes), kind: .int, list: false),
+ .scalar("chapters", key: .fixed(Slots.Media.chapters), kind: .int, list: false),
+ .scalar("volumes", key: .fixed(Slots.Media.volumes), kind: .int, list: false),
+ .scalar("duration", key: .fixed(Slots.Media.duration), kind: .int, list: false),
+ .scalar("season", key: .fixed(Slots.Media.season), kind: .string, list: false),
+ .scalar("seasonYear", key: .fixed(Slots.Media.seasonYear), kind: .int, list: false),
+ .scalar("countryOfOrigin", key: .fixed(Slots.Media.countryOfOrigin), kind: .custom, list: false),
+ .scalar("isAdult", key: .fixed(Slots.Media.isAdult), kind: .bool, list: false),
+ .scalar("siteUrl", key: .fixed(Slots.Media.siteUrl), kind: .string, list: false),
+ .linked("title", key: .fixed(Slots.Media.title), plural: false, selection: selection5),
+ .linked("coverImage", key: .fixed(Slots.Media.coverImage), plural: false, selection: selection4),
+ .linked("nextAiringEpisode", key: .fixed(Slots.Media.nextAiringEpisode), plural: false, selection: selection3),
+ ])
+ private static let selection3: Baton.Selection = Baton.Selection(type: Types.AiringSchedule, key: ["id"], abstract: false, fields: [
+ .scalar("id", key: .fixed(Slots.AiringSchedule.id), kind: .int, list: false),
+ .scalar("episode", key: .fixed(Slots.AiringSchedule.episode), kind: .int, list: false),
+ .scalar("airingAt", key: .fixed(Slots.AiringSchedule.airingAt), kind: .int, list: false),
+ ])
+ private static let selection4: Baton.Selection = Baton.Selection(type: Types.MediaCoverImage, key: [], abstract: false, fields: [
+ .scalar("large", key: .fixed(Slots.MediaCoverImage.large), kind: .string, list: false),
+ .scalar("color", key: .fixed(Slots.MediaCoverImage.color), kind: .string, list: false),
+ ])
+ private static let selection5: Baton.Selection = Baton.Selection(type: Types.MediaTitle, key: [], abstract: false, fields: [
+ .scalar("romaji", key: .fixed(Slots.MediaTitle.romaji), kind: .string, list: false),
+ .scalar("english", key: .fixed(Slots.MediaTitle.english), kind: .string, list: false),
+ .scalar("native", key: .fixed(Slots.MediaTitle.native), kind: .string, list: false),
+ .scalar("userPreferred", key: .fixed(Slots.MediaTitle.userPreferred), kind: .string, list: false),
+ ])
+ private static let selection6: Baton.Selection = Baton.Selection(type: Types.FuzzyDate, key: [], abstract: false, fields: [
+ .scalar("year", key: .fixed(Slots.FuzzyDate.year), kind: .int, list: false),
+ .scalar("month", key: .fixed(Slots.FuzzyDate.month), kind: .int, list: false),
+ .scalar("day", key: .fixed(Slots.FuzzyDate.day), kind: .int, list: false),
+ ])
+
+ nonisolated public struct Data: Baton.Lens {
+ @_spi(Generated) public let anchor: Baton.Anchor
+ @_spi(Generated) public init(anchor: Baton.Anchor) { self.anchor = anchor }
+ @MainActor public var MediaList: MediaList2? { anchor.linked(anchor.owner.slot(Slots.Query.MediaList_8bfff7)).map(MediaList2.init(anchor:)) }
+
+ nonisolated public struct MediaList2: Baton.Lens {
+ @_spi(Generated) public let anchor: Baton.Anchor
+ @_spi(Generated) public init(anchor: Baton.Anchor) { self.anchor = anchor }
+ @MainActor public var id: Int { anchor.requiredInt(Slots.MediaList.id) }
+ @MainActor public var entryRow: EntryRow_mediaList { .init(anchor: anchor.entering()) }
+ }
+ }
+}
+
+/// Operation value for `query ListQuery`.
+nonisolated public struct ListQuery: Baton.Query {
+ public var userId: Int
+ public var mediaType: MediaType
+ public var chunk: Int
+ @_spi(Generated) public var resolution: Baton.Resolution> = .unresolved
+
+ public init(userId: Int, mediaType: MediaType, chunk: Int) {
+ self.userId = userId
+ self.mediaType = mediaType
+ self.chunk = chunk
+ }
+
+ public static let name = "ListQuery"
+ public static let document: Baton.Document = .text(#"query ListQuery($userId:Int!,$mediaType:MediaType!,$chunk:Int!){MediaListCollection(userId:$userId,type:$mediaType,chunk:$chunk,perChunk:500,forceSingleCompletedList:true){hasNextChunk,lists{name,isCustomList,status,entries{id,...EntryRow_mediaList}}}}fragment EntryRow_mediaList on MediaList{id,status,progress,progressVolumes,score,repeat,priority,notes,private,hiddenFromStatusLists,customLists(asArray:true),startedAt{year,month,day},completedAt{year,month,day},updatedAt,media{id,...MediaCard_media}}fragment MediaCard_media on Media{id,idMal,type,format,status(version:2),episodes,chapters,volumes,duration,season,seasonYear,countryOfOrigin,isAdult,siteUrl,title{romaji,english,native,userPreferred},coverImage{large,color},nextAiringEpisode{id,episode,airingAt}}"#)
+
+ public var variables: Baton.Variables {
+ Baton.Variables(["userId": Baton.Variable(self.userId), "mediaType": Baton.Variable(self.mediaType), "chunk": Baton.Variable(self.chunk)])
+ }
+
+ public static func == (lhs: Self, rhs: Self) -> Bool {
+ lhs.userId == rhs.userId && lhs.mediaType == rhs.mediaType && lhs.chunk == rhs.chunk
+ }
+
+ public func hash(into hasher: inout Hasher) {
+ hasher.combine(self.userId)
+ hasher.combine(self.mediaType)
+ hasher.combine(self.chunk)
+ }
+
+ @_spi(Generated) public static let plan = Baton.Plan(root: selection0)
+ private static let selection0: Baton.Selection = Baton.Selection(type: Types.Query, key: [], abstract: false, fields: [
+ .linked("MediaListCollection", key: .dynamic(Slots.Query.MediaListCollection_fc1216), plural: false, selection: selection1),
+ ])
+ private static let selection1: Baton.Selection = Baton.Selection(type: Types.MediaListCollection, key: [], abstract: false, fields: [
+ .scalar("hasNextChunk", key: .fixed(Slots.MediaListCollection.hasNextChunk), kind: .bool, list: false),
+ .linked("lists", key: .fixed(Slots.MediaListCollection.lists), plural: true, selection: selection2),
+ ])
+ private static let selection2: Baton.Selection = Baton.Selection(type: Types.MediaListGroup, key: [], abstract: false, fields: [
+ .scalar("name", key: .fixed(Slots.MediaListGroup.name), kind: .string, list: false),
+ .scalar("isCustomList", key: .fixed(Slots.MediaListGroup.isCustomList), kind: .bool, list: false),
+ .scalar("status", key: .fixed(Slots.MediaListGroup.status), kind: .string, list: false),
+ .linked("entries", key: .fixed(Slots.MediaListGroup.entries), plural: true, selection: selection3),
+ ])
+ private static let selection3: Baton.Selection = Baton.Selection(type: Types.MediaList, key: ["id"], abstract: false, fields: [
+ .scalar("id", key: .fixed(Slots.MediaList.id), kind: .int, list: false),
+ .scalar("status", key: .fixed(Slots.MediaList.status), kind: .string, list: false),
+ .scalar("progress", key: .fixed(Slots.MediaList.progress), kind: .int, list: false),
+ .scalar("progressVolumes", key: .fixed(Slots.MediaList.progressVolumes), kind: .int, list: false),
+ .scalar("score", key: .fixed(Slots.MediaList.score), kind: .double, list: false),
+ .scalar("repeat", key: .fixed(Slots.MediaList.`repeat`), kind: .int, list: false),
+ .scalar("priority", key: .fixed(Slots.MediaList.priority), kind: .int, list: false),
+ .scalar("notes", key: .fixed(Slots.MediaList.notes), kind: .string, list: false),
+ .scalar("private", key: .fixed(Slots.MediaList.`private`), kind: .bool, list: false),
+ .scalar("hiddenFromStatusLists", key: .fixed(Slots.MediaList.hiddenFromStatusLists), kind: .bool, list: false),
+ .scalar("customLists", key: .fixed(Slots.MediaList.customLists_3a6c27), kind: .custom, list: false),
+ .linked("startedAt", key: .fixed(Slots.MediaList.startedAt), plural: false, selection: selection8),
+ .linked("completedAt", key: .fixed(Slots.MediaList.completedAt), plural: false, selection: selection8),
+ .scalar("updatedAt", key: .fixed(Slots.MediaList.updatedAt), kind: .int, list: false),
+ .linked("media", key: .fixed(Slots.MediaList.media), plural: false, selection: selection4),
+ ])
+ private static let selection4: Baton.Selection = Baton.Selection(type: Types.Media, key: ["id"], abstract: false, fields: [
+ .scalar("id", key: .fixed(Slots.Media.id), kind: .int, list: false),
+ .scalar("idMal", key: .fixed(Slots.Media.idMal), kind: .int, list: false),
+ .scalar("type", key: .fixed(Slots.Media.type), kind: .string, list: false),
+ .scalar("format", key: .fixed(Slots.Media.format), kind: .string, list: false),
+ .scalar("status", key: .fixed(Slots.Media.status_98c3c3), kind: .string, list: false),
+ .scalar("episodes", key: .fixed(Slots.Media.episodes), kind: .int, list: false),
+ .scalar("chapters", key: .fixed(Slots.Media.chapters), kind: .int, list: false),
+ .scalar("volumes", key: .fixed(Slots.Media.volumes), kind: .int, list: false),
+ .scalar("duration", key: .fixed(Slots.Media.duration), kind: .int, list: false),
+ .scalar("season", key: .fixed(Slots.Media.season), kind: .string, list: false),
+ .scalar("seasonYear", key: .fixed(Slots.Media.seasonYear), kind: .int, list: false),
+ .scalar("countryOfOrigin", key: .fixed(Slots.Media.countryOfOrigin), kind: .custom, list: false),
+ .scalar("isAdult", key: .fixed(Slots.Media.isAdult), kind: .bool, list: false),
+ .scalar("siteUrl", key: .fixed(Slots.Media.siteUrl), kind: .string, list: false),
+ .linked("title", key: .fixed(Slots.Media.title), plural: false, selection: selection7),
+ .linked("coverImage", key: .fixed(Slots.Media.coverImage), plural: false, selection: selection6),
+ .linked("nextAiringEpisode", key: .fixed(Slots.Media.nextAiringEpisode), plural: false, selection: selection5),
+ ])
+ private static let selection5: Baton.Selection = Baton.Selection(type: Types.AiringSchedule, key: ["id"], abstract: false, fields: [
+ .scalar("id", key: .fixed(Slots.AiringSchedule.id), kind: .int, list: false),
+ .scalar("episode", key: .fixed(Slots.AiringSchedule.episode), kind: .int, list: false),
+ .scalar("airingAt", key: .fixed(Slots.AiringSchedule.airingAt), kind: .int, list: false),
+ ])
+ private static let selection6: Baton.Selection = Baton.Selection(type: Types.MediaCoverImage, key: [], abstract: false, fields: [
+ .scalar("large", key: .fixed(Slots.MediaCoverImage.large), kind: .string, list: false),
+ .scalar("color", key: .fixed(Slots.MediaCoverImage.color), kind: .string, list: false),
+ ])
+ private static let selection7: Baton.Selection = Baton.Selection(type: Types.MediaTitle, key: [], abstract: false, fields: [
+ .scalar("romaji", key: .fixed(Slots.MediaTitle.romaji), kind: .string, list: false),
+ .scalar("english", key: .fixed(Slots.MediaTitle.english), kind: .string, list: false),
+ .scalar("native", key: .fixed(Slots.MediaTitle.native), kind: .string, list: false),
+ .scalar("userPreferred", key: .fixed(Slots.MediaTitle.userPreferred), kind: .string, list: false),
+ ])
+ private static let selection8: Baton.Selection = Baton.Selection(type: Types.FuzzyDate, key: [], abstract: false, fields: [
+ .scalar("year", key: .fixed(Slots.FuzzyDate.year), kind: .int, list: false),
+ .scalar("month", key: .fixed(Slots.FuzzyDate.month), kind: .int, list: false),
+ .scalar("day", key: .fixed(Slots.FuzzyDate.day), kind: .int, list: false),
+ ])
+
+ nonisolated public struct Data: Baton.Lens {
+ @_spi(Generated) public let anchor: Baton.Anchor
+ @_spi(Generated) public init(anchor: Baton.Anchor) { self.anchor = anchor }
+ @MainActor public var MediaListCollection: MediaListCollection2? { anchor.linked(anchor.owner.slot(Slots.Query.MediaListCollection_fc1216)).map(MediaListCollection2.init(anchor:)) }
+
+ nonisolated public struct MediaListCollection2: Baton.Lens {
+ @_spi(Generated) public let anchor: Baton.Anchor
+ @_spi(Generated) public init(anchor: Baton.Anchor) { self.anchor = anchor }
+ @MainActor public var hasNextChunk: Bool? { anchor.bool(Slots.MediaListCollection.hasNextChunk) }
+ @MainActor public var lists: Baton.List? { anchor.list(Slots.MediaListCollection.lists) }
+
+ nonisolated public struct Lists: Baton.Lens {
+ @_spi(Generated) public let anchor: Baton.Anchor
+ @_spi(Generated) public init(anchor: Baton.Anchor) { self.anchor = anchor }
+ @MainActor public var name: String? { anchor.string(Slots.MediaListGroup.name) }
+ @MainActor public var isCustomList: Bool? { anchor.bool(Slots.MediaListGroup.isCustomList) }
+ @MainActor public var status: MediaListStatus? { anchor.enumValue(Slots.MediaListGroup.status) }
+ @MainActor public var entries: Baton.List? { anchor.list(Slots.MediaListGroup.entries) }
+
+ nonisolated public struct Entries: Baton.Lens {
+ @_spi(Generated) public let anchor: Baton.Anchor
+ @_spi(Generated) public init(anchor: Baton.Anchor) { self.anchor = anchor }
+ @MainActor public var id: Int { anchor.requiredInt(Slots.MediaList.id) }
+ @MainActor public var entryRow: EntryRow_mediaList { .init(anchor: anchor.entering()) }
+ }
+ }
+ }
+ }
+}
+
+/// Operation value for `mutation SaveEntryMutation`.
+nonisolated public struct SaveEntryMutation: Baton.Mutation {
+ public var id: Int?
+ public var progress: Int?
+
+ public init(id: Int? = nil, progress: Int? = nil) {
+ self.id = id
+ self.progress = progress
+ }
+
+ public static let name = "SaveEntryMutation"
+ public static let document: Baton.Document = .text(#"mutation SaveEntryMutation($id:Int,$progress:Int){SaveMediaListEntry(id:$id,progress:$progress){id,...EntryRow_mediaList}}fragment EntryRow_mediaList on MediaList{id,status,progress,progressVolumes,score,repeat,priority,notes,private,hiddenFromStatusLists,customLists(asArray:true),startedAt{year,month,day},completedAt{year,month,day},updatedAt,media{id,...MediaCard_media}}fragment MediaCard_media on Media{id,idMal,type,format,status(version:2),episodes,chapters,volumes,duration,season,seasonYear,countryOfOrigin,isAdult,siteUrl,title{romaji,english,native,userPreferred},coverImage{large,color},nextAiringEpisode{id,episode,airingAt}}"#)
+
+ public var variables: Baton.Variables {
+ var values: [String: Baton.Variable] = [:]
+ if self.id != nil { values["id"] = Baton.Variable(self.id) }
+ if self.progress != nil { values["progress"] = Baton.Variable(self.progress) }
+ return Baton.Variables(values)
+ }
+
+ public static func == (lhs: Self, rhs: Self) -> Bool {
+ lhs.id == rhs.id && lhs.progress == rhs.progress
+ }
+
+ public func hash(into hasher: inout Hasher) {
+ hasher.combine(self.id)
+ hasher.combine(self.progress)
+ }
+
+ @_spi(Generated) public static let plan = Baton.Plan(root: selection0)
+ private static let selection0: Baton.Selection = Baton.Selection(type: Types.Mutation, key: [], abstract: false, fields: [
+ .linked("SaveMediaListEntry", key: .fixed(Slots.Mutation.SaveMediaListEntry), plural: false, selection: selection1),
+ ])
+ private static let selection1: Baton.Selection = Baton.Selection(type: Types.MediaList, key: ["id"], abstract: false, fields: [
+ .scalar("id", key: .fixed(Slots.MediaList.id), kind: .int, list: false),
+ .scalar("status", key: .fixed(Slots.MediaList.status), kind: .string, list: false),
+ .scalar("progress", key: .fixed(Slots.MediaList.progress), kind: .int, list: false),
+ .scalar("progressVolumes", key: .fixed(Slots.MediaList.progressVolumes), kind: .int, list: false),
+ .scalar("score", key: .fixed(Slots.MediaList.score), kind: .double, list: false),
+ .scalar("repeat", key: .fixed(Slots.MediaList.`repeat`), kind: .int, list: false),
+ .scalar("priority", key: .fixed(Slots.MediaList.priority), kind: .int, list: false),
+ .scalar("notes", key: .fixed(Slots.MediaList.notes), kind: .string, list: false),
+ .scalar("private", key: .fixed(Slots.MediaList.`private`), kind: .bool, list: false),
+ .scalar("hiddenFromStatusLists", key: .fixed(Slots.MediaList.hiddenFromStatusLists), kind: .bool, list: false),
+ .scalar("customLists", key: .fixed(Slots.MediaList.customLists_3a6c27), kind: .custom, list: false),
+ .linked("startedAt", key: .fixed(Slots.MediaList.startedAt), plural: false, selection: selection6),
+ .linked("completedAt", key: .fixed(Slots.MediaList.completedAt), plural: false, selection: selection6),
+ .scalar("updatedAt", key: .fixed(Slots.MediaList.updatedAt), kind: .int, list: false),
+ .linked("media", key: .fixed(Slots.MediaList.media), plural: false, selection: selection2),
+ ])
+ private static let selection2: Baton.Selection = Baton.Selection(type: Types.Media, key: ["id"], abstract: false, fields: [
+ .scalar("id", key: .fixed(Slots.Media.id), kind: .int, list: false),
+ .scalar("idMal", key: .fixed(Slots.Media.idMal), kind: .int, list: false),
+ .scalar("type", key: .fixed(Slots.Media.type), kind: .string, list: false),
+ .scalar("format", key: .fixed(Slots.Media.format), kind: .string, list: false),
+ .scalar("status", key: .fixed(Slots.Media.status_98c3c3), kind: .string, list: false),
+ .scalar("episodes", key: .fixed(Slots.Media.episodes), kind: .int, list: false),
+ .scalar("chapters", key: .fixed(Slots.Media.chapters), kind: .int, list: false),
+ .scalar("volumes", key: .fixed(Slots.Media.volumes), kind: .int, list: false),
+ .scalar("duration", key: .fixed(Slots.Media.duration), kind: .int, list: false),
+ .scalar("season", key: .fixed(Slots.Media.season), kind: .string, list: false),
+ .scalar("seasonYear", key: .fixed(Slots.Media.seasonYear), kind: .int, list: false),
+ .scalar("countryOfOrigin", key: .fixed(Slots.Media.countryOfOrigin), kind: .custom, list: false),
+ .scalar("isAdult", key: .fixed(Slots.Media.isAdult), kind: .bool, list: false),
+ .scalar("siteUrl", key: .fixed(Slots.Media.siteUrl), kind: .string, list: false),
+ .linked("title", key: .fixed(Slots.Media.title), plural: false, selection: selection5),
+ .linked("coverImage", key: .fixed(Slots.Media.coverImage), plural: false, selection: selection4),
+ .linked("nextAiringEpisode", key: .fixed(Slots.Media.nextAiringEpisode), plural: false, selection: selection3),
+ ])
+ private static let selection3: Baton.Selection = Baton.Selection(type: Types.AiringSchedule, key: ["id"], abstract: false, fields: [
+ .scalar("id", key: .fixed(Slots.AiringSchedule.id), kind: .int, list: false),
+ .scalar("episode", key: .fixed(Slots.AiringSchedule.episode), kind: .int, list: false),
+ .scalar("airingAt", key: .fixed(Slots.AiringSchedule.airingAt), kind: .int, list: false),
+ ])
+ private static let selection4: Baton.Selection = Baton.Selection(type: Types.MediaCoverImage, key: [], abstract: false, fields: [
+ .scalar("large", key: .fixed(Slots.MediaCoverImage.large), kind: .string, list: false),
+ .scalar("color", key: .fixed(Slots.MediaCoverImage.color), kind: .string, list: false),
+ ])
+ private static let selection5: Baton.Selection = Baton.Selection(type: Types.MediaTitle, key: [], abstract: false, fields: [
+ .scalar("romaji", key: .fixed(Slots.MediaTitle.romaji), kind: .string, list: false),
+ .scalar("english", key: .fixed(Slots.MediaTitle.english), kind: .string, list: false),
+ .scalar("native", key: .fixed(Slots.MediaTitle.native), kind: .string, list: false),
+ .scalar("userPreferred", key: .fixed(Slots.MediaTitle.userPreferred), kind: .string, list: false),
+ ])
+ private static let selection6: Baton.Selection = Baton.Selection(type: Types.FuzzyDate, key: [], abstract: false, fields: [
+ .scalar("year", key: .fixed(Slots.FuzzyDate.year), kind: .int, list: false),
+ .scalar("month", key: .fixed(Slots.FuzzyDate.month), kind: .int, list: false),
+ .scalar("day", key: .fixed(Slots.FuzzyDate.day), kind: .int, list: false),
+ ])
+
+ nonisolated public struct Data: Baton.Lens {
+ @_spi(Generated) public let anchor: Baton.Anchor
+ @_spi(Generated) public init(anchor: Baton.Anchor) { self.anchor = anchor }
+ @MainActor public var SaveMediaListEntry: SaveMediaListEntry2? { anchor.linked(Slots.Mutation.SaveMediaListEntry).map(SaveMediaListEntry2.init(anchor:)) }
+
+ nonisolated public struct SaveMediaListEntry2: Baton.Lens {
+ @_spi(Generated) public let anchor: Baton.Anchor
+ @_spi(Generated) public init(anchor: Baton.Anchor) { self.anchor = anchor }
+ @MainActor public var id: Int { anchor.requiredInt(Slots.MediaList.id) }
+ @MainActor public var entryRow: EntryRow_mediaList { .init(anchor: anchor.entering()) }
+ }
+ }
+
+ public typealias Action = Baton.MutationAction
+
+ /// A partial response to show before the server answers; absent fields leave the store untouched.
+ nonisolated public struct OptimisticResponse: Sendable {
+ public var SaveMediaListEntry: SaveMediaListEntry2?
+ public init(SaveMediaListEntry: SaveMediaListEntry2? = nil) {
+ self.SaveMediaListEntry = SaveMediaListEntry
+ }
+ @_spi(Generated) public var variable: Baton.Variable {
+ var fields: [String: Baton.Variable] = [:]
+ if let SaveMediaListEntry { fields["SaveMediaListEntry"] = SaveMediaListEntry.variable }
+ return .object(fields)
+ }
+ /// The response this builder describes, as the bytes the door takes.
+ public var payload: Baton.Payload { .init(data: variable) }
+
+ /// A partial response to show before the server answers; absent fields leave the store untouched.
+ nonisolated public struct SaveMediaListEntry2: Sendable {
+ public var id: Int?
+ public var status: MediaListStatus?
+ public var progress: Int?
+ public var progressVolumes: Int?
+ public var score: Double?
+ public var `repeat`: Int?
+ public var priority: Int?
+ public var notes: String?
+ public var `private`: Bool?
+ public var hiddenFromStatusLists: Bool?
+ public var customLists: String?
+ public var startedAt: StartedAt?
+ public var completedAt: CompletedAt?
+ public var updatedAt: Int?
+ public var media: Media?
+ public init(id: Int? = nil, status: MediaListStatus? = nil, progress: Int? = nil, progressVolumes: Int? = nil, score: Double? = nil, `repeat`: Int? = nil, priority: Int? = nil, notes: String? = nil, `private`: Bool? = nil, hiddenFromStatusLists: Bool? = nil, customLists: String? = nil, startedAt: StartedAt? = nil, completedAt: CompletedAt? = nil, updatedAt: Int? = nil, media: Media? = nil) {
+ self.id = id
+ self.status = status
+ self.progress = progress
+ self.progressVolumes = progressVolumes
+ self.score = score
+ self.`repeat` = `repeat`
+ self.priority = priority
+ self.notes = notes
+ self.`private` = `private`
+ self.hiddenFromStatusLists = hiddenFromStatusLists
+ self.customLists = customLists
+ self.startedAt = startedAt
+ self.completedAt = completedAt
+ self.updatedAt = updatedAt
+ self.media = media
+ }
+ @_spi(Generated) public var variable: Baton.Variable {
+ var fields: [String: Baton.Variable] = [:]
+ if let id { fields["id"] = .init(id) }
+ if let status { fields["status"] = .init(status) }
+ if let progress { fields["progress"] = .init(progress) }
+ if let progressVolumes { fields["progressVolumes"] = .init(progressVolumes) }
+ if let score { fields["score"] = .init(score) }
+ if let `repeat` { fields["repeat"] = .init(`repeat`) }
+ if let priority { fields["priority"] = .init(priority) }
+ if let notes { fields["notes"] = .init(notes) }
+ if let `private` { fields["private"] = .init(`private`) }
+ if let hiddenFromStatusLists { fields["hiddenFromStatusLists"] = .init(hiddenFromStatusLists) }
+ if let customLists { fields["customLists"] = .init(customLists) }
+ if let startedAt { fields["startedAt"] = startedAt.variable }
+ if let completedAt { fields["completedAt"] = completedAt.variable }
+ if let updatedAt { fields["updatedAt"] = .init(updatedAt) }
+ if let media { fields["media"] = media.variable }
+ return .object(fields)
+ }
+
+ /// A partial response to show before the server answers; absent fields leave the store untouched.
+ nonisolated public struct StartedAt: Sendable {
+ public var year: Int?
+ public var month: Int?
+ public var day: Int?
+ public init(year: Int? = nil, month: Int? = nil, day: Int? = nil) {
+ self.year = year
+ self.month = month
+ self.day = day
+ }
+ @_spi(Generated) public var variable: Baton.Variable {
+ var fields: [String: Baton.Variable] = [:]
+ if let year { fields["year"] = .init(year) }
+ if let month { fields["month"] = .init(month) }
+ if let day { fields["day"] = .init(day) }
+ return .object(fields)
+ }
+ }
+
+ /// A partial response to show before the server answers; absent fields leave the store untouched.
+ nonisolated public struct CompletedAt: Sendable {
+ public var year: Int?
+ public var month: Int?
+ public var day: Int?
+ public init(year: Int? = nil, month: Int? = nil, day: Int? = nil) {
+ self.year = year
+ self.month = month
+ self.day = day
+ }
+ @_spi(Generated) public var variable: Baton.Variable {
+ var fields: [String: Baton.Variable] = [:]
+ if let year { fields["year"] = .init(year) }
+ if let month { fields["month"] = .init(month) }
+ if let day { fields["day"] = .init(day) }
+ return .object(fields)
+ }
+ }
+
+ /// A partial response to show before the server answers; absent fields leave the store untouched.
+ nonisolated public struct Media: Sendable {
+ public var id: Int?
+ public var idMal: Int?
+ public var type: MediaType?
+ public var format: MediaFormat?
+ public var status: MediaStatus?
+ public var episodes: Int?
+ public var chapters: Int?
+ public var volumes: Int?
+ public var duration: Int?
+ public var season: MediaSeason?
+ public var seasonYear: Int?
+ public var countryOfOrigin: String?
+ public var isAdult: Bool?
+ public var siteUrl: String?
+ public var title: Title?
+ public var coverImage: CoverImage?
+ public var nextAiringEpisode: NextAiringEpisode?
+ public init(id: Int? = nil, idMal: Int? = nil, type: MediaType? = nil, format: MediaFormat? = nil, status: MediaStatus? = nil, episodes: Int? = nil, chapters: Int? = nil, volumes: Int? = nil, duration: Int? = nil, season: MediaSeason? = nil, seasonYear: Int? = nil, countryOfOrigin: String? = nil, isAdult: Bool? = nil, siteUrl: String? = nil, title: Title? = nil, coverImage: CoverImage? = nil, nextAiringEpisode: NextAiringEpisode? = nil) {
+ self.id = id
+ self.idMal = idMal
+ self.type = type
+ self.format = format
+ self.status = status
+ self.episodes = episodes
+ self.chapters = chapters
+ self.volumes = volumes
+ self.duration = duration
+ self.season = season
+ self.seasonYear = seasonYear
+ self.countryOfOrigin = countryOfOrigin
+ self.isAdult = isAdult
+ self.siteUrl = siteUrl
+ self.title = title
+ self.coverImage = coverImage
+ self.nextAiringEpisode = nextAiringEpisode
+ }
+ @_spi(Generated) public var variable: Baton.Variable {
+ var fields: [String: Baton.Variable] = [:]
+ if let id { fields["id"] = .init(id) }
+ if let idMal { fields["idMal"] = .init(idMal) }
+ if let type { fields["type"] = .init(type) }
+ if let format { fields["format"] = .init(format) }
+ if let status { fields["status"] = .init(status) }
+ if let episodes { fields["episodes"] = .init(episodes) }
+ if let chapters { fields["chapters"] = .init(chapters) }
+ if let volumes { fields["volumes"] = .init(volumes) }
+ if let duration { fields["duration"] = .init(duration) }
+ if let season { fields["season"] = .init(season) }
+ if let seasonYear { fields["seasonYear"] = .init(seasonYear) }
+ if let countryOfOrigin { fields["countryOfOrigin"] = .init(countryOfOrigin) }
+ if let isAdult { fields["isAdult"] = .init(isAdult) }
+ if let siteUrl { fields["siteUrl"] = .init(siteUrl) }
+ if let title { fields["title"] = title.variable }
+ if let coverImage { fields["coverImage"] = coverImage.variable }
+ if let nextAiringEpisode { fields["nextAiringEpisode"] = nextAiringEpisode.variable }
+ return .object(fields)
+ }
+
+ /// A partial response to show before the server answers; absent fields leave the store untouched.
+ nonisolated public struct Title: Sendable {
+ public var romaji: String?
+ public var english: String?
+ public var native: String?
+ public var userPreferred: String?
+ public init(romaji: String? = nil, english: String? = nil, native: String? = nil, userPreferred: String? = nil) {
+ self.romaji = romaji
+ self.english = english
+ self.native = native
+ self.userPreferred = userPreferred
+ }
+ @_spi(Generated) public var variable: Baton.Variable {
+ var fields: [String: Baton.Variable] = [:]
+ if let romaji { fields["romaji"] = .init(romaji) }
+ if let english { fields["english"] = .init(english) }
+ if let native { fields["native"] = .init(native) }
+ if let userPreferred { fields["userPreferred"] = .init(userPreferred) }
+ return .object(fields)
+ }
+ }
+
+ /// A partial response to show before the server answers; absent fields leave the store untouched.
+ nonisolated public struct CoverImage: Sendable {
+ public var large: String?
+ public var color: String?
+ public init(large: String? = nil, color: String? = nil) {
+ self.large = large
+ self.color = color
+ }
+ @_spi(Generated) public var variable: Baton.Variable {
+ var fields: [String: Baton.Variable] = [:]
+ if let large { fields["large"] = .init(large) }
+ if let color { fields["color"] = .init(color) }
+ return .object(fields)
+ }
+ }
+
+ /// A partial response to show before the server answers; absent fields leave the store untouched.
+ nonisolated public struct NextAiringEpisode: Sendable {
+ public var id: Int?
+ public var episode: Int?
+ public var airingAt: Int?
+ public init(id: Int? = nil, episode: Int? = nil, airingAt: Int? = nil) {
+ self.id = id
+ self.episode = episode
+ self.airingAt = airingAt
+ }
+ @_spi(Generated) public var variable: Baton.Variable {
+ var fields: [String: Baton.Variable] = [:]
+ if let id { fields["id"] = .init(id) }
+ if let episode { fields["episode"] = .init(episode) }
+ if let airingAt { fields["airingAt"] = .init(airingAt) }
+ return .object(fields)
+ }
+ }
+ }
+ }
+ }
+}
+
+extension SaveEntryMutation.Action {
+ /// Commits the mutation; the optimistic response, if any, shows at once and rebases until the server answers.
+ @MainActor @discardableResult
+ public func callAsFunction(id: Int? = nil, progress: Int? = nil, optimistic: Op.OptimisticResponse? = nil) async throws -> Op.Data {
+ try await self.commit(.init(id: id, progress: progress), optimistic: optimistic?.payload)
+ }
+}
+
diff --git a/compiler/src/tests/goldens-anilist/AniListShapes.baton.swift b/compiler/src/tests/goldens-anilist/AniListShapes.baton.swift
new file mode 100644
index 00000000..d7ac31b5
--- /dev/null
+++ b/compiler/src/tests/goldens-anilist/AniListShapes.baton.swift
@@ -0,0 +1,674 @@
+// Generated by batonc. Do not edit.
+import Foundation
+@_spi(Generated) import Baton
+
+/// Operation value for `mutation DeleteEntryMutation`.
+nonisolated public struct DeleteEntryMutation: Baton.Mutation {
+ public var id: Int
+
+ public init(id: Int) {
+ self.id = id
+ }
+
+ public static let name = "DeleteEntryMutation"
+ public static let document: Baton.Document = .text(#"mutation DeleteEntryMutation($id:Int!){DeleteMediaListEntry(id:$id){deleted}}"#)
+
+ public var variables: Baton.Variables {
+ Baton.Variables(["id": Baton.Variable(self.id)])
+ }
+
+ public static func == (lhs: Self, rhs: Self) -> Bool {
+ lhs.id == rhs.id
+ }
+
+ public func hash(into hasher: inout Hasher) {
+ hasher.combine(self.id)
+ }
+
+ @_spi(Generated) public static let plan = Baton.Plan(root: selection0, deletions: [Baton.Deletion(type: Types.MediaList, variable: "id")])
+ private static let selection0: Baton.Selection = Baton.Selection(type: Types.Mutation, key: [], abstract: false, fields: [
+ .linked("DeleteMediaListEntry", key: .fixed(Slots.Mutation.DeleteMediaListEntry), plural: false, selection: selection1),
+ ])
+ private static let selection1: Baton.Selection = Baton.Selection(type: Types.Deleted, key: [], abstract: false, fields: [
+ .scalar("deleted", key: .fixed(Slots.Deleted.deleted), kind: .bool, list: false),
+ ])
+
+ nonisolated public struct Data: Baton.Lens {
+ @_spi(Generated) public let anchor: Baton.Anchor
+ @_spi(Generated) public init(anchor: Baton.Anchor) { self.anchor = anchor }
+ @MainActor public var DeleteMediaListEntry: DeleteMediaListEntry2? { anchor.linked(Slots.Mutation.DeleteMediaListEntry).map(DeleteMediaListEntry2.init(anchor:)) }
+
+ nonisolated public struct DeleteMediaListEntry2: Baton.Lens {
+ @_spi(Generated) public let anchor: Baton.Anchor
+ @_spi(Generated) public init(anchor: Baton.Anchor) { self.anchor = anchor }
+ @MainActor public var deleted: Bool? { anchor.bool(Slots.Deleted.deleted) }
+ }
+ }
+
+ public typealias Action = Baton.MutationAction
+
+ /// A partial response to show before the server answers; absent fields leave the store untouched.
+ nonisolated public struct OptimisticResponse: Sendable {
+ public var DeleteMediaListEntry: DeleteMediaListEntry2?
+ public init(DeleteMediaListEntry: DeleteMediaListEntry2? = nil) {
+ self.DeleteMediaListEntry = DeleteMediaListEntry
+ }
+ @_spi(Generated) public var variable: Baton.Variable {
+ var fields: [String: Baton.Variable] = [:]
+ if let DeleteMediaListEntry { fields["DeleteMediaListEntry"] = DeleteMediaListEntry.variable }
+ return .object(fields)
+ }
+ /// The response this builder describes, as the bytes the door takes.
+ public var payload: Baton.Payload { .init(data: variable) }
+
+ /// A partial response to show before the server answers; absent fields leave the store untouched.
+ nonisolated public struct DeleteMediaListEntry2: Sendable {
+ public var deleted: Bool?
+ public init(deleted: Bool? = nil) {
+ self.deleted = deleted
+ }
+ @_spi(Generated) public var variable: Baton.Variable {
+ var fields: [String: Baton.Variable] = [:]
+ if let deleted { fields["deleted"] = .init(deleted) }
+ return .object(fields)
+ }
+ }
+ }
+}
+
+extension DeleteEntryMutation.Action {
+ /// Commits the mutation; the optimistic response, if any, shows at once and rebases until the server answers.
+ @MainActor @discardableResult
+ public func callAsFunction(id: Int, optimistic: Op.OptimisticResponse? = nil) async throws -> Op.Data {
+ try await self.commit(.init(id: id), optimistic: optimistic?.payload)
+ }
+}
+
+/// Operation value for `query EntryScoresQuery`.
+nonisolated public struct EntryScoresQuery: Baton.Query {
+ public var id: Int
+ @_spi(Generated) public var resolution: Baton.Resolution> = .unresolved
+
+ public init(id: Int) {
+ self.id = id
+ }
+
+ public static let name = "EntryScoresQuery"
+ public static let document: Baton.Document = .text(#"query EntryScoresQuery($id:Int!){MediaList(id:$id){id,score,advancedScores,customLists(asArray:true)}}"#)
+
+ public var variables: Baton.Variables {
+ Baton.Variables(["id": Baton.Variable(self.id)])
+ }
+
+ public static func == (lhs: Self, rhs: Self) -> Bool {
+ lhs.id == rhs.id
+ }
+
+ public func hash(into hasher: inout Hasher) {
+ hasher.combine(self.id)
+ }
+
+ @_spi(Generated) public static let plan = Baton.Plan(root: selection0)
+ private static let selection0: Baton.Selection = Baton.Selection(type: Types.Query, key: [], abstract: false, fields: [
+ .linked("MediaList", key: .dynamic(Slots.Query.MediaList_8bfff7), plural: false, lookup: Baton.Lookup(type: Types.MediaList, key: [.variable("id")]), selection: selection1),
+ ])
+ private static let selection1: Baton.Selection = Baton.Selection(type: Types.MediaList, key: ["id"], abstract: false, fields: [
+ .scalar("id", key: .fixed(Slots.MediaList.id), kind: .int, list: false),
+ .scalar("score", key: .fixed(Slots.MediaList.score), kind: .double, list: false),
+ .scalar("advancedScores", key: .fixed(Slots.MediaList.advancedScores), kind: .custom, list: false),
+ .scalar("customLists", key: .fixed(Slots.MediaList.customLists_3a6c27), kind: .custom, list: false),
+ ])
+
+ nonisolated public struct Data: Baton.Lens {
+ @_spi(Generated) public let anchor: Baton.Anchor
+ @_spi(Generated) public init(anchor: Baton.Anchor) { self.anchor = anchor }
+ @MainActor public var MediaList: MediaList2? { anchor.linked(anchor.owner.slot(Slots.Query.MediaList_8bfff7)).map(MediaList2.init(anchor:)) }
+
+ nonisolated public struct MediaList2: Baton.Lens {
+ @_spi(Generated) public let anchor: Baton.Anchor
+ @_spi(Generated) public init(anchor: Baton.Anchor) { self.anchor = anchor }
+ @MainActor public var id: Int { anchor.requiredInt(Slots.MediaList.id) }
+ @MainActor public var score: Double? { anchor.double(Slots.MediaList.score) }
+ @MainActor public var advancedScores: String? { anchor.string(Slots.MediaList.advancedScores) }
+ @MainActor public var customLists: String? { anchor.string(Slots.MediaList.customLists_3a6c27) }
+ }
+ }
+}
+
+/// Operation value for `query MediaQuery`.
+nonisolated public struct MediaQuery: Baton.Query {
+ public var id: Int
+ @_spi(Generated) public var resolution: Baton.Resolution> = .unresolved
+
+ public init(id: Int) {
+ self.id = id
+ }
+
+ public static let name = "MediaQuery"
+ public static let document: Baton.Document = .text(#"query MediaQuery($id:Int!){Media(id:$id){id,...MediaCard_media,statusV1:status,source(version:3),relations{edges{id,relationType(version:2),node{id,title{romaji}}}}}}fragment MediaCard_media on Media{id,idMal,type,format,status(version:2),episodes,chapters,volumes,duration,season,seasonYear,countryOfOrigin,isAdult,siteUrl,title{romaji,english,native,userPreferred},coverImage{large,color},nextAiringEpisode{id,episode,airingAt}}"#)
+
+ public var variables: Baton.Variables {
+ Baton.Variables(["id": Baton.Variable(self.id)])
+ }
+
+ public static func == (lhs: Self, rhs: Self) -> Bool {
+ lhs.id == rhs.id
+ }
+
+ public func hash(into hasher: inout Hasher) {
+ hasher.combine(self.id)
+ }
+
+ @_spi(Generated) public static let plan = Baton.Plan(root: selection0)
+ private static let selection0: Baton.Selection = Baton.Selection(type: Types.Query, key: [], abstract: false, fields: [
+ .linked("Media", key: .dynamic(Slots.Query.Media_976b29), plural: false, lookup: Baton.Lookup(type: Types.Media, key: [.variable("id")]), selection: selection1),
+ ])
+ private static let selection1: Baton.Selection = Baton.Selection(type: Types.Media, key: ["id"], abstract: false, fields: [
+ .scalar("id", key: .fixed(Slots.Media.id), kind: .int, list: false),
+ .scalar("idMal", key: .fixed(Slots.Media.idMal), kind: .int, list: false),
+ .scalar("type", key: .fixed(Slots.Media.type), kind: .string, list: false),
+ .scalar("format", key: .fixed(Slots.Media.format), kind: .string, list: false),
+ .scalar("status", key: .fixed(Slots.Media.status_98c3c3), kind: .string, list: false),
+ .scalar("episodes", key: .fixed(Slots.Media.episodes), kind: .int, list: false),
+ .scalar("chapters", key: .fixed(Slots.Media.chapters), kind: .int, list: false),
+ .scalar("volumes", key: .fixed(Slots.Media.volumes), kind: .int, list: false),
+ .scalar("duration", key: .fixed(Slots.Media.duration), kind: .int, list: false),
+ .scalar("season", key: .fixed(Slots.Media.season), kind: .string, list: false),
+ .scalar("seasonYear", key: .fixed(Slots.Media.seasonYear), kind: .int, list: false),
+ .scalar("countryOfOrigin", key: .fixed(Slots.Media.countryOfOrigin), kind: .custom, list: false),
+ .scalar("isAdult", key: .fixed(Slots.Media.isAdult), kind: .bool, list: false),
+ .scalar("siteUrl", key: .fixed(Slots.Media.siteUrl), kind: .string, list: false),
+ .linked("title", key: .fixed(Slots.Media.title), plural: false, selection: selection8),
+ .linked("coverImage", key: .fixed(Slots.Media.coverImage), plural: false, selection: selection7),
+ .linked("nextAiringEpisode", key: .fixed(Slots.Media.nextAiringEpisode), plural: false, selection: selection6),
+ .scalar("statusV1", key: .fixed(Slots.Media.status), kind: .string, list: false),
+ .scalar("source", key: .fixed(Slots.Media.source_3f939b), kind: .string, list: false),
+ .linked("relations", key: .fixed(Slots.Media.relations), plural: false, selection: selection2),
+ ])
+ private static let selection2: Baton.Selection = Baton.Selection(type: Types.MediaConnection, key: [], abstract: false, fields: [
+ .linked("edges", key: .fixed(Slots.MediaConnection.edges), plural: true, selection: selection3),
+ ])
+ private static let selection3: Baton.Selection = Baton.Selection(type: Types.MediaEdge, key: ["id"], abstract: false, fields: [
+ .scalar("id", key: .fixed(Slots.MediaEdge.id), kind: .int, list: false),
+ .scalar("relationType", key: .fixed(Slots.MediaEdge.relationType_4caf07), kind: .string, list: false),
+ .linked("node", key: .fixed(Slots.MediaEdge.node), plural: false, selection: selection4),
+ ])
+ private static let selection4: Baton.Selection = Baton.Selection(type: Types.Media, key: ["id"], abstract: false, fields: [
+ .scalar("id", key: .fixed(Slots.Media.id), kind: .int, list: false),
+ .linked("title", key: .fixed(Slots.Media.title), plural: false, selection: selection5),
+ ])
+ private static let selection5: Baton.Selection = Baton.Selection(type: Types.MediaTitle, key: [], abstract: false, fields: [
+ .scalar("romaji", key: .fixed(Slots.MediaTitle.romaji), kind: .string, list: false),
+ ])
+ private static let selection6: Baton.Selection = Baton.Selection(type: Types.AiringSchedule, key: ["id"], abstract: false, fields: [
+ .scalar("id", key: .fixed(Slots.AiringSchedule.id), kind: .int, list: false),
+ .scalar("episode", key: .fixed(Slots.AiringSchedule.episode), kind: .int, list: false),
+ .scalar("airingAt", key: .fixed(Slots.AiringSchedule.airingAt), kind: .int, list: false),
+ ])
+ private static let selection7: Baton.Selection = Baton.Selection(type: Types.MediaCoverImage, key: [], abstract: false, fields: [
+ .scalar("large", key: .fixed(Slots.MediaCoverImage.large), kind: .string, list: false),
+ .scalar("color", key: .fixed(Slots.MediaCoverImage.color), kind: .string, list: false),
+ ])
+ private static let selection8: Baton.Selection = Baton.Selection(type: Types.MediaTitle, key: [], abstract: false, fields: [
+ .scalar("romaji", key: .fixed(Slots.MediaTitle.romaji), kind: .string, list: false),
+ .scalar("english", key: .fixed(Slots.MediaTitle.english), kind: .string, list: false),
+ .scalar("native", key: .fixed(Slots.MediaTitle.native), kind: .string, list: false),
+ .scalar("userPreferred", key: .fixed(Slots.MediaTitle.userPreferred), kind: .string, list: false),
+ ])
+
+ nonisolated public struct Data: Baton.Lens {
+ @_spi(Generated) public let anchor: Baton.Anchor
+ @_spi(Generated) public init(anchor: Baton.Anchor) { self.anchor = anchor }
+ @MainActor public var Media: Media2? { anchor.linked(anchor.owner.slot(Slots.Query.Media_976b29)).map(Media2.init(anchor:)) }
+
+ nonisolated public struct Media2: Baton.Lens {
+ @_spi(Generated) public let anchor: Baton.Anchor
+ @_spi(Generated) public init(anchor: Baton.Anchor) { self.anchor = anchor }
+ @MainActor public var id: Int { anchor.requiredInt(Slots.Media.id) }
+ @MainActor public var mediaCard: MediaCard_media { .init(anchor: anchor.entering()) }
+ @MainActor public var statusV1: MediaStatus? { anchor.enumValue(Slots.Media.status) }
+ @MainActor public var source: MediaSource? { anchor.enumValue(Slots.Media.source_3f939b) }
+ @MainActor public var relations: Relations? { anchor.linked(Slots.Media.relations).map(Relations.init(anchor:)) }
+
+ nonisolated public struct Relations: Baton.Lens {
+ @_spi(Generated) public let anchor: Baton.Anchor
+ @_spi(Generated) public init(anchor: Baton.Anchor) { self.anchor = anchor }
+ @MainActor public var edges: Baton.List? { anchor.list(Slots.MediaConnection.edges) }
+
+ nonisolated public struct Edges: Baton.Lens {
+ @_spi(Generated) public let anchor: Baton.Anchor
+ @_spi(Generated) public init(anchor: Baton.Anchor) { self.anchor = anchor }
+ @MainActor public var id: Int? { anchor.int(Slots.MediaEdge.id) }
+ @MainActor public var relationType: MediaRelation? { anchor.enumValue(Slots.MediaEdge.relationType_4caf07) }
+ @MainActor public var node: Node? { anchor.linked(Slots.MediaEdge.node).map(Node.init(anchor:)) }
+
+ nonisolated public struct Node: Baton.Lens {
+ @_spi(Generated) public let anchor: Baton.Anchor
+ @_spi(Generated) public init(anchor: Baton.Anchor) { self.anchor = anchor }
+ @MainActor public var id: Int { anchor.requiredInt(Slots.Media.id) }
+ @MainActor public var title: Title? { anchor.linked(Slots.Media.title).map(Title.init(anchor:)) }
+
+ nonisolated public struct Title: Baton.Lens {
+ @_spi(Generated) public let anchor: Baton.Anchor
+ @_spi(Generated) public init(anchor: Baton.Anchor) { self.anchor = anchor }
+ @MainActor public var romaji: String? { anchor.string(Slots.MediaTitle.romaji) }
+ }
+ }
+ }
+ }
+ }
+ }
+}
+
+/// Operation value for `query NotificationsQuery`.
+nonisolated public struct NotificationsQuery: Baton.Query {
+ public var page: Int
+ @_spi(Generated) public var resolution: Baton.Resolution> = .unresolved
+
+ public init(page: Int) {
+ self.page = page
+ }
+
+ public static let name = "NotificationsQuery"
+ public static let document: Baton.Document = .text(#"query NotificationsQuery($page:Int!){Page(page:$page,perPage:25){notifications{__typename,...on AiringNotification{id,episode,contexts,media{id,title{romaji}}},...on FollowingNotification{id,user{id,name}},...on ActivityLikeNotification{id,activityId,user{id,name}},...on ThreadCommentReplyNotification{id,commentId},...on MediaDataChangeNotification{id,mediaId,reason},...on ActivityMentionNotification{id},...on ActivityMessageNotification{id},...on ActivityReplyLikeNotification{id},...on ActivityReplyNotification{id},...on ActivityReplySubscribedNotification{id},...on CharacterSubmissionUpdateNotification{id},...on MediaDeletionNotification{id},...on MediaMergeNotification{id},...on MediaSubmissionUpdateNotification{id},...on RelatedMediaAdditionNotification{id},...on StaffSubmissionUpdateNotification{id},...on ThreadCommentLikeNotification{id},...on ThreadCommentMentionNotification{id},...on ThreadCommentSubscribedNotification{id},...on ThreadLikeNotification{id}}}}"#)
+
+ public var variables: Baton.Variables {
+ Baton.Variables(["page": Baton.Variable(self.page)])
+ }
+
+ public static func == (lhs: Self, rhs: Self) -> Bool {
+ lhs.page == rhs.page
+ }
+
+ public func hash(into hasher: inout Hasher) {
+ hasher.combine(self.page)
+ }
+
+ @_spi(Generated) public static let plan = Baton.Plan(root: selection0)
+ private static let selection0: Baton.Selection = Baton.Selection(type: Types.Query, key: [], abstract: false, fields: [
+ .linked("Page", key: .dynamic(Slots.Query.Page_839a80), plural: false, selection: selection1),
+ ])
+ private static let selection1: Baton.Selection = Baton.Selection(type: Types.Page, key: [], abstract: false, fields: [
+ .linked("notifications", key: .fixed(Slots.Page.notifications), plural: true, selection: selection2),
+ ])
+ private static let selection2: Baton.Selection = Baton.Selection(type: Types.NotificationUnion, key: ["id"], abstract: true, variants: [
+ .init(types: [Types.ActivityLikeNotification], key: ["id"], fields: [
+ .scalar("__typename", key: .fixed(Slots.ActivityLikeNotification.__typename), kind: .string, list: false),
+ .scalar("id", key: .fixed(Slots.ActivityLikeNotification.id), kind: .int, list: false),
+ .scalar("activityId", key: .fixed(Slots.ActivityLikeNotification.activityId), kind: .int, list: false),
+ .linked("user", key: .fixed(Slots.ActivityLikeNotification.user), plural: false, selection: selection5),
+ ]),
+ .init(types: [Types.ActivityMentionNotification, Types.ActivityMessageNotification, Types.ActivityReplyLikeNotification, Types.ActivityReplyNotification, Types.ActivityReplySubscribedNotification, Types.CharacterSubmissionUpdateNotification, Types.MediaDeletionNotification, Types.MediaMergeNotification, Types.MediaSubmissionUpdateNotification, Types.RelatedMediaAdditionNotification, Types.StaffSubmissionUpdateNotification, Types.ThreadCommentLikeNotification, Types.ThreadCommentMentionNotification, Types.ThreadCommentSubscribedNotification, Types.ThreadLikeNotification], key: ["id"], fields: [
+ .scalar("__typename", key: .fixed(Slots.NotificationUnion.__typename), kind: .string, list: false),
+ .scalar("id", key: .fixed(Slots.NotificationUnion.id), kind: .int, list: false),
+ ]),
+ .init(types: [Types.AiringNotification], key: ["id"], fields: [
+ .scalar("__typename", key: .fixed(Slots.AiringNotification.__typename), kind: .string, list: false),
+ .scalar("id", key: .fixed(Slots.AiringNotification.id), kind: .int, list: false),
+ .scalar("episode", key: .fixed(Slots.AiringNotification.episode), kind: .int, list: false),
+ .scalar("contexts", key: .fixed(Slots.AiringNotification.contexts), kind: .string, list: true),
+ .linked("media", key: .fixed(Slots.AiringNotification.media), plural: false, selection: selection3),
+ ]),
+ .init(types: [Types.FollowingNotification], key: ["id"], fields: [
+ .scalar("__typename", key: .fixed(Slots.FollowingNotification.__typename), kind: .string, list: false),
+ .scalar("id", key: .fixed(Slots.FollowingNotification.id), kind: .int, list: false),
+ .linked("user", key: .fixed(Slots.FollowingNotification.user), plural: false, selection: selection5),
+ ]),
+ .init(types: [Types.MediaDataChangeNotification], key: ["id"], fields: [
+ .scalar("__typename", key: .fixed(Slots.MediaDataChangeNotification.__typename), kind: .string, list: false),
+ .scalar("id", key: .fixed(Slots.MediaDataChangeNotification.id), kind: .int, list: false),
+ .scalar("mediaId", key: .fixed(Slots.MediaDataChangeNotification.mediaId), kind: .int, list: false),
+ .scalar("reason", key: .fixed(Slots.MediaDataChangeNotification.reason), kind: .string, list: false),
+ ]),
+ .init(types: [Types.ThreadCommentReplyNotification], key: ["id"], fields: [
+ .scalar("__typename", key: .fixed(Slots.ThreadCommentReplyNotification.__typename), kind: .string, list: false),
+ .scalar("id", key: .fixed(Slots.ThreadCommentReplyNotification.id), kind: .int, list: false),
+ .scalar("commentId", key: .fixed(Slots.ThreadCommentReplyNotification.commentId), kind: .int, list: false),
+ ]),
+ .init(types: nil, fields: [
+ .scalar("__typename", key: .fixed(Slots.NotificationUnion.__typename), kind: .string, list: false),
+ ]),
+ ])
+ private static let selection3: Baton.Selection = Baton.Selection(type: Types.Media, key: ["id"], abstract: false, fields: [
+ .scalar("id", key: .fixed(Slots.Media.id), kind: .int, list: false),
+ .linked("title", key: .fixed(Slots.Media.title), plural: false, selection: selection4),
+ ])
+ private static let selection4: Baton.Selection = Baton.Selection(type: Types.MediaTitle, key: [], abstract: false, fields: [
+ .scalar("romaji", key: .fixed(Slots.MediaTitle.romaji), kind: .string, list: false),
+ ])
+ private static let selection5: Baton.Selection = Baton.Selection(type: Types.User, key: ["id"], abstract: false, fields: [
+ .scalar("id", key: .fixed(Slots.User.id), kind: .int, list: false),
+ .scalar("name", key: .fixed(Slots.User.name), kind: .string, list: false),
+ ])
+
+ nonisolated public struct Data: Baton.Lens {
+ @_spi(Generated) public let anchor: Baton.Anchor
+ @_spi(Generated) public init(anchor: Baton.Anchor) { self.anchor = anchor }
+ @MainActor public var Page: Page2? { anchor.linked(anchor.owner.slot(Slots.Query.Page_839a80)).map(Page2.init(anchor:)) }
+
+ nonisolated public struct Page2: Baton.Lens {
+ @_spi(Generated) public let anchor: Baton.Anchor
+ @_spi(Generated) public init(anchor: Baton.Anchor) { self.anchor = anchor }
+ @MainActor public var notifications: Baton.List? { anchor.list(Slots.Page.notifications) }
+
+ nonisolated public struct Notifications: Baton.Lens {
+ @_spi(Generated) public let anchor: Baton.Anchor
+ @_spi(Generated) public init(anchor: Baton.Anchor) { self.anchor = anchor }
+ @MainActor public var asAiringNotification: AsAiringNotification? { anchor.record.is(Types.AiringNotification) ? AsAiringNotification(anchor: anchor) : nil }
+ @MainActor public var asFollowingNotification: AsFollowingNotification? { anchor.record.is(Types.FollowingNotification) ? AsFollowingNotification(anchor: anchor) : nil }
+ @MainActor public var asActivityLikeNotification: AsActivityLikeNotification? { anchor.record.is(Types.ActivityLikeNotification) ? AsActivityLikeNotification(anchor: anchor) : nil }
+ @MainActor public var asThreadCommentReplyNotification: AsThreadCommentReplyNotification? { anchor.record.is(Types.ThreadCommentReplyNotification) ? AsThreadCommentReplyNotification(anchor: anchor) : nil }
+ @MainActor public var asMediaDataChangeNotification: AsMediaDataChangeNotification? { anchor.record.is(Types.MediaDataChangeNotification) ? AsMediaDataChangeNotification(anchor: anchor) : nil }
+
+ nonisolated public struct AsAiringNotification: Baton.Lens {
+ @_spi(Generated) public let anchor: Baton.Anchor
+ @_spi(Generated) public init(anchor: Baton.Anchor) { self.anchor = anchor }
+ @MainActor public var id: Int { anchor.requiredInt(Slots.AiringNotification.id) }
+ @MainActor public var episode: Int { anchor.requiredInt(Slots.AiringNotification.episode) }
+ @MainActor public var contexts: [String?]? { anchor.nullableStrings(Slots.AiringNotification.contexts) }
+ @MainActor public var media: Media? { anchor.linked(Slots.AiringNotification.media).map(Media.init(anchor:)) }
+
+ nonisolated public struct Media: Baton.Lens {
+ @_spi(Generated) public let anchor: Baton.Anchor
+ @_spi(Generated) public init(anchor: Baton.Anchor) { self.anchor = anchor }
+ @MainActor public var id: Int { anchor.requiredInt(Slots.Media.id) }
+ @MainActor public var title: Title? { anchor.linked(Slots.Media.title).map(Title.init(anchor:)) }
+
+ nonisolated public struct Title: Baton.Lens {
+ @_spi(Generated) public let anchor: Baton.Anchor
+ @_spi(Generated) public init(anchor: Baton.Anchor) { self.anchor = anchor }
+ @MainActor public var romaji: String? { anchor.string(Slots.MediaTitle.romaji) }
+ }
+ }
+ }
+
+ nonisolated public struct AsFollowingNotification: Baton.Lens {
+ @_spi(Generated) public let anchor: Baton.Anchor
+ @_spi(Generated) public init(anchor: Baton.Anchor) { self.anchor = anchor }
+ @MainActor public var id: Int { anchor.requiredInt(Slots.FollowingNotification.id) }
+ @MainActor public var user: User? { anchor.linked(Slots.FollowingNotification.user).map(User.init(anchor:)) }
+
+ nonisolated public struct User: Baton.Lens {
+ @_spi(Generated) public let anchor: Baton.Anchor
+ @_spi(Generated) public init(anchor: Baton.Anchor) { self.anchor = anchor }
+ @MainActor public var id: Int { anchor.requiredInt(Slots.User.id) }
+ @MainActor public var name: String { anchor.requiredString(Slots.User.name) }
+ }
+ }
+
+ nonisolated public struct AsActivityLikeNotification: Baton.Lens {
+ @_spi(Generated) public let anchor: Baton.Anchor
+ @_spi(Generated) public init(anchor: Baton.Anchor) { self.anchor = anchor }
+ @MainActor public var id: Int { anchor.requiredInt(Slots.ActivityLikeNotification.id) }
+ @MainActor public var activityId: Int { anchor.requiredInt(Slots.ActivityLikeNotification.activityId) }
+ @MainActor public var user: User? { anchor.linked(Slots.ActivityLikeNotification.user).map(User.init(anchor:)) }
+
+ nonisolated public struct User: Baton.Lens {
+ @_spi(Generated) public let anchor: Baton.Anchor
+ @_spi(Generated) public init(anchor: Baton.Anchor) { self.anchor = anchor }
+ @MainActor public var id: Int { anchor.requiredInt(Slots.User.id) }
+ @MainActor public var name: String { anchor.requiredString(Slots.User.name) }
+ }
+ }
+
+ nonisolated public struct AsThreadCommentReplyNotification: Baton.Lens {
+ @_spi(Generated) public let anchor: Baton.Anchor
+ @_spi(Generated) public init(anchor: Baton.Anchor) { self.anchor = anchor }
+ @MainActor public var id: Int { anchor.requiredInt(Slots.ThreadCommentReplyNotification.id) }
+ @MainActor public var commentId: Int { anchor.requiredInt(Slots.ThreadCommentReplyNotification.commentId) }
+ }
+
+ nonisolated public struct AsMediaDataChangeNotification: Baton.Lens {
+ @_spi(Generated) public let anchor: Baton.Anchor
+ @_spi(Generated) public init(anchor: Baton.Anchor) { self.anchor = anchor }
+ @MainActor public var id: Int { anchor.requiredInt(Slots.MediaDataChangeNotification.id) }
+ @MainActor public var mediaId: Int { anchor.requiredInt(Slots.MediaDataChangeNotification.mediaId) }
+ @MainActor public var reason: String? { anchor.string(Slots.MediaDataChangeNotification.reason) }
+ }
+ }
+ }
+ }
+}
+
+/// Operation value for `query SeasonQuery`.
+nonisolated public struct SeasonQuery: Baton.Query {
+ public var season: MediaSeason
+ public var seasonYear: Int
+ public var page: Int
+ @_spi(Generated) public var resolution: Baton.Resolution> = .unresolved
+
+ public init(season: MediaSeason, seasonYear: Int, page: Int) {
+ self.season = season
+ self.seasonYear = seasonYear
+ self.page = page
+ }
+
+ public static let name = "SeasonQuery"
+ public static let document: Baton.Document = .text(#"query SeasonQuery($season:MediaSeason!,$seasonYear:Int!,$page:Int!){Page(page:$page,perPage:48){pageInfo{hasNextPage},media(season:$season,seasonYear:$seasonYear,type:ANIME,sort:[POPULARITY_DESC]){id,...MediaCard_media}}}fragment MediaCard_media on Media{id,idMal,type,format,status(version:2),episodes,chapters,volumes,duration,season,seasonYear,countryOfOrigin,isAdult,siteUrl,title{romaji,english,native,userPreferred},coverImage{large,color},nextAiringEpisode{id,episode,airingAt}}"#)
+
+ public var variables: Baton.Variables {
+ Baton.Variables(["season": Baton.Variable(self.season), "seasonYear": Baton.Variable(self.seasonYear), "page": Baton.Variable(self.page)])
+ }
+
+ public static func == (lhs: Self, rhs: Self) -> Bool {
+ lhs.season == rhs.season && lhs.seasonYear == rhs.seasonYear && lhs.page == rhs.page
+ }
+
+ public func hash(into hasher: inout Hasher) {
+ hasher.combine(self.season)
+ hasher.combine(self.seasonYear)
+ hasher.combine(self.page)
+ }
+
+ @_spi(Generated) public static let plan = Baton.Plan(root: selection0)
+ private static let selection0: Baton.Selection = Baton.Selection(type: Types.Query, key: [], abstract: false, fields: [
+ .linked("Page", key: .dynamic(Slots.Query.Page_9d9873), plural: false, selection: selection1),
+ ])
+ private static let selection1: Baton.Selection = Baton.Selection(type: Types.Page, key: [], abstract: false, fields: [
+ .linked("pageInfo", key: .fixed(Slots.Page.pageInfo), plural: false, selection: selection6),
+ .linked("media", key: .dynamic(Slots.Page.media_aca52b), plural: true, selection: selection2),
+ ])
+ private static let selection2: Baton.Selection = Baton.Selection(type: Types.Media, key: ["id"], abstract: false, fields: [
+ .scalar("id", key: .fixed(Slots.Media.id), kind: .int, list: false),
+ .scalar("idMal", key: .fixed(Slots.Media.idMal), kind: .int, list: false),
+ .scalar("type", key: .fixed(Slots.Media.type), kind: .string, list: false),
+ .scalar("format", key: .fixed(Slots.Media.format), kind: .string, list: false),
+ .scalar("status", key: .fixed(Slots.Media.status_98c3c3), kind: .string, list: false),
+ .scalar("episodes", key: .fixed(Slots.Media.episodes), kind: .int, list: false),
+ .scalar("chapters", key: .fixed(Slots.Media.chapters), kind: .int, list: false),
+ .scalar("volumes", key: .fixed(Slots.Media.volumes), kind: .int, list: false),
+ .scalar("duration", key: .fixed(Slots.Media.duration), kind: .int, list: false),
+ .scalar("season", key: .fixed(Slots.Media.season), kind: .string, list: false),
+ .scalar("seasonYear", key: .fixed(Slots.Media.seasonYear), kind: .int, list: false),
+ .scalar("countryOfOrigin", key: .fixed(Slots.Media.countryOfOrigin), kind: .custom, list: false),
+ .scalar("isAdult", key: .fixed(Slots.Media.isAdult), kind: .bool, list: false),
+ .scalar("siteUrl", key: .fixed(Slots.Media.siteUrl), kind: .string, list: false),
+ .linked("title", key: .fixed(Slots.Media.title), plural: false, selection: selection5),
+ .linked("coverImage", key: .fixed(Slots.Media.coverImage), plural: false, selection: selection4),
+ .linked("nextAiringEpisode", key: .fixed(Slots.Media.nextAiringEpisode), plural: false, selection: selection3),
+ ])
+ private static let selection3: Baton.Selection = Baton.Selection(type: Types.AiringSchedule, key: ["id"], abstract: false, fields: [
+ .scalar("id", key: .fixed(Slots.AiringSchedule.id), kind: .int, list: false),
+ .scalar("episode", key: .fixed(Slots.AiringSchedule.episode), kind: .int, list: false),
+ .scalar("airingAt", key: .fixed(Slots.AiringSchedule.airingAt), kind: .int, list: false),
+ ])
+ private static let selection4: Baton.Selection = Baton.Selection(type: Types.MediaCoverImage, key: [], abstract: false, fields: [
+ .scalar("large", key: .fixed(Slots.MediaCoverImage.large), kind: .string, list: false),
+ .scalar("color", key: .fixed(Slots.MediaCoverImage.color), kind: .string, list: false),
+ ])
+ private static let selection5: Baton.Selection = Baton.Selection(type: Types.MediaTitle, key: [], abstract: false, fields: [
+ .scalar("romaji", key: .fixed(Slots.MediaTitle.romaji), kind: .string, list: false),
+ .scalar("english", key: .fixed(Slots.MediaTitle.english), kind: .string, list: false),
+ .scalar("native", key: .fixed(Slots.MediaTitle.native), kind: .string, list: false),
+ .scalar("userPreferred", key: .fixed(Slots.MediaTitle.userPreferred), kind: .string, list: false),
+ ])
+ private static let selection6: Baton.Selection = Baton.Selection(type: Types.PageInfo, key: [], abstract: false, fields: [
+ .scalar("hasNextPage", key: .fixed(Slots.PageInfo.hasNextPage), kind: .bool, list: false),
+ ])
+
+ nonisolated public struct Data: Baton.Lens {
+ @_spi(Generated) public let anchor: Baton.Anchor
+ @_spi(Generated) public init(anchor: Baton.Anchor) { self.anchor = anchor }
+ @MainActor public var Page: Page2? { anchor.linked(anchor.owner.slot(Slots.Query.Page_9d9873)).map(Page2.init(anchor:)) }
+
+ nonisolated public struct Page2: Baton.Lens {
+ @_spi(Generated) public let anchor: Baton.Anchor
+ @_spi(Generated) public init(anchor: Baton.Anchor) { self.anchor = anchor }
+ @MainActor public var pageInfo: PageInfo? { anchor.linked(Slots.Page.pageInfo).map(PageInfo.init(anchor:)) }
+ @MainActor public var media: Baton.List? { anchor.list(anchor.owner.slot(Slots.Page.media_aca52b)) }
+
+ nonisolated public struct PageInfo: Baton.Lens {
+ @_spi(Generated) public let anchor: Baton.Anchor
+ @_spi(Generated) public init(anchor: Baton.Anchor) { self.anchor = anchor }
+ @MainActor public var hasNextPage: Bool? { anchor.bool(Slots.PageInfo.hasNextPage) }
+ }
+
+ nonisolated public struct Media: Baton.Lens {
+ @_spi(Generated) public let anchor: Baton.Anchor
+ @_spi(Generated) public init(anchor: Baton.Anchor) { self.anchor = anchor }
+ @MainActor public var id: Int { anchor.requiredInt(Slots.Media.id) }
+ @MainActor public var mediaCard: MediaCard_media { .init(anchor: anchor.entering()) }
+ }
+ }
+ }
+}
+
+/// Operation value for `query ThreadCommentsQuery`.
+nonisolated public struct ThreadCommentsQuery: Baton.Query {
+ public var threadId: Int
+ @_spi(Generated) public var resolution: Baton.Resolution> = .unresolved
+
+ public init(threadId: Int) {
+ self.threadId = threadId
+ }
+
+ public static let name = "ThreadCommentsQuery"
+ public static let document: Baton.Document = .text(#"query ThreadCommentsQuery($threadId:Int!){Page(page:1,perPage:25){threadComments(threadId:$threadId){id,comment,childComments}}}"#)
+
+ public var variables: Baton.Variables {
+ Baton.Variables(["threadId": Baton.Variable(self.threadId)])
+ }
+
+ public static func == (lhs: Self, rhs: Self) -> Bool {
+ lhs.threadId == rhs.threadId
+ }
+
+ public func hash(into hasher: inout Hasher) {
+ hasher.combine(self.threadId)
+ }
+
+ @_spi(Generated) public static let plan = Baton.Plan(root: selection0)
+ private static let selection0: Baton.Selection = Baton.Selection(type: Types.Query, key: [], abstract: false, fields: [
+ .linked("Page", key: .fixed(Slots.Query.Page_c5f40b), plural: false, selection: selection1),
+ ])
+ private static let selection1: Baton.Selection = Baton.Selection(type: Types.Page, key: [], abstract: false, fields: [
+ .linked("threadComments", key: .dynamic(Slots.Page.threadComments_88ffc8), plural: true, selection: selection2),
+ ])
+ private static let selection2: Baton.Selection = Baton.Selection(type: Types.ThreadComment, key: ["id"], abstract: false, fields: [
+ .scalar("id", key: .fixed(Slots.ThreadComment.id), kind: .int, list: false),
+ .scalar("comment", key: .fixed(Slots.ThreadComment.comment), kind: .string, list: false),
+ .scalar("childComments", key: .fixed(Slots.ThreadComment.childComments), kind: .custom, list: false),
+ ])
+
+ nonisolated public struct Data: Baton.Lens {
+ @_spi(Generated) public let anchor: Baton.Anchor
+ @_spi(Generated) public init(anchor: Baton.Anchor) { self.anchor = anchor }
+ @MainActor public var Page: Page2? { anchor.linked(Slots.Query.Page_c5f40b).map(Page2.init(anchor:)) }
+
+ nonisolated public struct Page2: Baton.Lens {
+ @_spi(Generated) public let anchor: Baton.Anchor
+ @_spi(Generated) public init(anchor: Baton.Anchor) { self.anchor = anchor }
+ @MainActor public var threadComments: Baton.List? { anchor.list(anchor.owner.slot(Slots.Page.threadComments_88ffc8)) }
+
+ nonisolated public struct ThreadComments: Baton.Lens {
+ @_spi(Generated) public let anchor: Baton.Anchor
+ @_spi(Generated) public init(anchor: Baton.Anchor) { self.anchor = anchor }
+ @MainActor public var id: Int { anchor.requiredInt(Slots.ThreadComment.id) }
+ @MainActor public var comment: String? { anchor.string(Slots.ThreadComment.comment) }
+ @MainActor public var childComments: String? { anchor.string(Slots.ThreadComment.childComments) }
+ }
+ }
+ }
+}
+
+/// Operation value for `query ViewerQuery`.
+nonisolated public struct ViewerQuery: Baton.Query {
+ @_spi(Generated) public var resolution: Baton.Resolution> = .unresolved
+
+ public init() {
+ }
+
+ public static let name = "ViewerQuery"
+ public static let document: Baton.Document = .text(#"query ViewerQuery{Viewer{id,name,avatar{large},unreadNotificationCount,mediaListOptions{scoreFormat,animeList{customLists,advancedScoringEnabled}}}}"#)
+
+ public var variables: Baton.Variables {
+ Baton.Variables([:])
+ }
+
+ public static func == (lhs: Self, rhs: Self) -> Bool {
+ true
+ }
+
+ public func hash(into hasher: inout Hasher) {
+ }
+
+ @_spi(Generated) public static let plan = Baton.Plan(root: selection0)
+ private static let selection0: Baton.Selection = Baton.Selection(type: Types.Query, key: [], abstract: false, fields: [
+ .linked("Viewer", key: .fixed(Slots.Query.Viewer), plural: false, selection: selection1),
+ ])
+ private static let selection1: Baton.Selection = Baton.Selection(type: Types.User, key: ["id"], abstract: false, fields: [
+ .scalar("id", key: .fixed(Slots.User.id), kind: .int, list: false),
+ .scalar("name", key: .fixed(Slots.User.name), kind: .string, list: false),
+ .linked("avatar", key: .fixed(Slots.User.avatar), plural: false, selection: selection4),
+ .scalar("unreadNotificationCount", key: .fixed(Slots.User.unreadNotificationCount), kind: .int, list: false),
+ .linked("mediaListOptions", key: .fixed(Slots.User.mediaListOptions), plural: false, selection: selection2),
+ ])
+ private static let selection2: Baton.Selection = Baton.Selection(type: Types.MediaListOptions, key: [], abstract: false, fields: [
+ .scalar("scoreFormat", key: .fixed(Slots.MediaListOptions.scoreFormat), kind: .string, list: false),
+ .linked("animeList", key: .fixed(Slots.MediaListOptions.animeList), plural: false, selection: selection3),
+ ])
+ private static let selection3: Baton.Selection = Baton.Selection(type: Types.MediaListTypeOptions, key: [], abstract: false, fields: [
+ .scalar("customLists", key: .fixed(Slots.MediaListTypeOptions.customLists), kind: .string, list: true),
+ .scalar("advancedScoringEnabled", key: .fixed(Slots.MediaListTypeOptions.advancedScoringEnabled), kind: .bool, list: false),
+ ])
+ private static let selection4: Baton.Selection = Baton.Selection(type: Types.UserAvatar, key: [], abstract: false, fields: [
+ .scalar("large", key: .fixed(Slots.UserAvatar.large), kind: .string, list: false),
+ ])
+
+ nonisolated public struct Data: Baton.Lens {
+ @_spi(Generated) public let anchor: Baton.Anchor
+ @_spi(Generated) public init(anchor: Baton.Anchor) { self.anchor = anchor }
+ @MainActor public var Viewer: Viewer2? { anchor.linked(Slots.Query.Viewer).map(Viewer2.init(anchor:)) }
+
+ nonisolated public struct Viewer2: Baton.Lens {
+ @_spi(Generated) public let anchor: Baton.Anchor
+ @_spi(Generated) public init(anchor: Baton.Anchor) { self.anchor = anchor }
+ @MainActor public var id: Int { anchor.requiredInt(Slots.User.id) }
+ @MainActor public var name: String { anchor.requiredString(Slots.User.name) }
+ @MainActor public var avatar: Avatar? { anchor.linked(Slots.User.avatar).map(Avatar.init(anchor:)) }
+ @MainActor public var unreadNotificationCount: Int? { anchor.int(Slots.User.unreadNotificationCount) }
+ @MainActor public var mediaListOptions: MediaListOptions? { anchor.linked(Slots.User.mediaListOptions).map(MediaListOptions.init(anchor:)) }
+
+ nonisolated public struct Avatar: Baton.Lens {
+ @_spi(Generated) public let anchor: Baton.Anchor
+ @_spi(Generated) public init(anchor: Baton.Anchor) { self.anchor = anchor }
+ @MainActor public var large: String? { anchor.string(Slots.UserAvatar.large) }
+ }
+
+ nonisolated public struct MediaListOptions: Baton.Lens {
+ @_spi(Generated) public let anchor: Baton.Anchor
+ @_spi(Generated) public init(anchor: Baton.Anchor) { self.anchor = anchor }
+ @MainActor public var scoreFormat: ScoreFormat? { anchor.enumValue(Slots.MediaListOptions.scoreFormat) }
+ @MainActor public var animeList: AnimeList? { anchor.linked(Slots.MediaListOptions.animeList).map(AnimeList.init(anchor:)) }
+
+ nonisolated public struct AnimeList: Baton.Lens {
+ @_spi(Generated) public let anchor: Baton.Anchor
+ @_spi(Generated) public init(anchor: Baton.Anchor) { self.anchor = anchor }
+ @MainActor public var customLists: [String?]? { anchor.nullableStrings(Slots.MediaListTypeOptions.customLists) }
+ @MainActor public var advancedScoringEnabled: Bool? { anchor.bool(Slots.MediaListTypeOptions.advancedScoringEnabled) }
+ }
+ }
+ }
+ }
+}
+
diff --git a/compiler/src/tests/goldens-anilist/Baton.baton.swift b/compiler/src/tests/goldens-anilist/Baton.baton.swift
new file mode 100644
index 00000000..f9f137ff
--- /dev/null
+++ b/compiler/src/tests/goldens-anilist/Baton.baton.swift
@@ -0,0 +1,536 @@
+// Generated by batonc. Do not edit.
+import Foundation
+@_spi(Generated) import Baton
+
+/// Interned schema types used by this module's documents.
+nonisolated enum Types {
+ /// The schema's digest: pass it as the image's `version`, so an image
+ /// written under another schema starts again.
+ static let schemaDigest = "64c79d9bee49eec0fb16214f1f7b77c0"
+ /// The format of this generated code, which the runtime that reads it
+ /// declares; a runtime of another format fails to compile this line.
+ static let format = Baton.Format20.self
+ static let ActivityLikeNotification = Baton.Registry.type("ActivityLikeNotification")
+ static let ActivityMentionNotification = Baton.Registry.type("ActivityMentionNotification")
+ static let ActivityMessageNotification = Baton.Registry.type("ActivityMessageNotification")
+ static let ActivityReplyLikeNotification = Baton.Registry.type("ActivityReplyLikeNotification")
+ static let ActivityReplyNotification = Baton.Registry.type("ActivityReplyNotification")
+ static let ActivityReplySubscribedNotification = Baton.Registry.type("ActivityReplySubscribedNotification")
+ static let AiringNotification = Baton.Registry.type("AiringNotification")
+ static let AiringSchedule = Baton.Registry.type("AiringSchedule")
+ static let CharacterSubmissionUpdateNotification = Baton.Registry.type("CharacterSubmissionUpdateNotification")
+ static let Deleted = Baton.Registry.type("Deleted")
+ static let FollowingNotification = Baton.Registry.type("FollowingNotification")
+ static let FuzzyDate = Baton.Registry.type("FuzzyDate")
+ static let Media = Baton.Registry.type("Media")
+ static let MediaConnection = Baton.Registry.type("MediaConnection")
+ static let MediaCoverImage = Baton.Registry.type("MediaCoverImage")
+ static let MediaDataChangeNotification = Baton.Registry.type("MediaDataChangeNotification")
+ static let MediaDeletionNotification = Baton.Registry.type("MediaDeletionNotification")
+ static let MediaEdge = Baton.Registry.type("MediaEdge")
+ static let MediaList = Baton.Registry.type("MediaList")
+ static let MediaListCollection = Baton.Registry.type("MediaListCollection")
+ static let MediaListGroup = Baton.Registry.type("MediaListGroup")
+ static let MediaListOptions = Baton.Registry.type("MediaListOptions")
+ static let MediaListTypeOptions = Baton.Registry.type("MediaListTypeOptions")
+ static let MediaMergeNotification = Baton.Registry.type("MediaMergeNotification")
+ static let MediaSubmissionUpdateNotification = Baton.Registry.type("MediaSubmissionUpdateNotification")
+ static let MediaTitle = Baton.Registry.type("MediaTitle")
+ static let Mutation = Baton.Registry.type("Mutation")
+ static let NotificationUnion = Baton.Registry.type("NotificationUnion")
+ static let Page = Baton.Registry.type("Page")
+ static let PageInfo = Baton.Registry.type("PageInfo")
+ static let Query = Baton.Registry.type("Query")
+ static let RelatedMediaAdditionNotification = Baton.Registry.type("RelatedMediaAdditionNotification")
+ static let StaffSubmissionUpdateNotification = Baton.Registry.type("StaffSubmissionUpdateNotification")
+ static let ThreadComment = Baton.Registry.type("ThreadComment")
+ static let ThreadCommentLikeNotification = Baton.Registry.type("ThreadCommentLikeNotification")
+ static let ThreadCommentMentionNotification = Baton.Registry.type("ThreadCommentMentionNotification")
+ static let ThreadCommentReplyNotification = Baton.Registry.type("ThreadCommentReplyNotification")
+ static let ThreadCommentSubscribedNotification = Baton.Registry.type("ThreadCommentSubscribedNotification")
+ static let ThreadLikeNotification = Baton.Registry.type("ThreadLikeNotification")
+ static let User = Baton.Registry.type("User")
+ static let UserAvatar = Baton.Registry.type("UserAvatar")
+}
+
+/// Interned storage keys used by this module's documents.
+nonisolated enum Slots {
+ nonisolated enum ActivityLikeNotification {
+ static let __typename = Baton.Registry.slot(Types.ActivityLikeNotification, "__typename")
+ static let activityId = Baton.Registry.slot(Types.ActivityLikeNotification, "activityId")
+ static let id = Baton.Registry.slot(Types.ActivityLikeNotification, "id")
+ static let user = Baton.Registry.slot(Types.ActivityLikeNotification, "user")
+ }
+ nonisolated enum AiringNotification {
+ static let __typename = Baton.Registry.slot(Types.AiringNotification, "__typename")
+ static let contexts = Baton.Registry.slot(Types.AiringNotification, "contexts")
+ static let episode = Baton.Registry.slot(Types.AiringNotification, "episode")
+ static let id = Baton.Registry.slot(Types.AiringNotification, "id")
+ static let media = Baton.Registry.slot(Types.AiringNotification, "media")
+ }
+ nonisolated enum AiringSchedule {
+ static let airingAt = Baton.Registry.slot(Types.AiringSchedule, "airingAt")
+ static let episode = Baton.Registry.slot(Types.AiringSchedule, "episode")
+ static let id = Baton.Registry.slot(Types.AiringSchedule, "id")
+ }
+ nonisolated enum Deleted {
+ static let deleted = Baton.Registry.slot(Types.Deleted, "deleted")
+ }
+ nonisolated enum FollowingNotification {
+ static let __typename = Baton.Registry.slot(Types.FollowingNotification, "__typename")
+ static let id = Baton.Registry.slot(Types.FollowingNotification, "id")
+ static let user = Baton.Registry.slot(Types.FollowingNotification, "user")
+ }
+ nonisolated enum FuzzyDate {
+ static let day = Baton.Registry.slot(Types.FuzzyDate, "day")
+ static let month = Baton.Registry.slot(Types.FuzzyDate, "month")
+ static let year = Baton.Registry.slot(Types.FuzzyDate, "year")
+ }
+ nonisolated enum Media {
+ static let chapters = Baton.Registry.slot(Types.Media, "chapters")
+ static let countryOfOrigin = Baton.Registry.slot(Types.Media, "countryOfOrigin")
+ static let coverImage = Baton.Registry.slot(Types.Media, "coverImage")
+ static let duration = Baton.Registry.slot(Types.Media, "duration")
+ static let episodes = Baton.Registry.slot(Types.Media, "episodes")
+ static let format = Baton.Registry.slot(Types.Media, "format")
+ static let id = Baton.Registry.slot(Types.Media, "id")
+ static let idMal = Baton.Registry.slot(Types.Media, "idMal")
+ static let isAdult = Baton.Registry.slot(Types.Media, "isAdult")
+ static let nextAiringEpisode = Baton.Registry.slot(Types.Media, "nextAiringEpisode")
+ static let relations = Baton.Registry.slot(Types.Media, "relations")
+ static let season = Baton.Registry.slot(Types.Media, "season")
+ static let seasonYear = Baton.Registry.slot(Types.Media, "seasonYear")
+ static let siteUrl = Baton.Registry.slot(Types.Media, "siteUrl")
+ static let source_3f939b = Baton.Registry.slot(Types.Media, "source(version:3)")
+ static let status = Baton.Registry.slot(Types.Media, "status")
+ static let status_98c3c3 = Baton.Registry.slot(Types.Media, "status(version:2)")
+ static let title = Baton.Registry.slot(Types.Media, "title")
+ static let type = Baton.Registry.slot(Types.Media, "type")
+ static let volumes = Baton.Registry.slot(Types.Media, "volumes")
+ }
+ nonisolated enum MediaConnection {
+ static let edges = Baton.Registry.slot(Types.MediaConnection, "edges")
+ }
+ nonisolated enum MediaCoverImage {
+ static let color = Baton.Registry.slot(Types.MediaCoverImage, "color")
+ static let large = Baton.Registry.slot(Types.MediaCoverImage, "large")
+ }
+ nonisolated enum MediaDataChangeNotification {
+ static let __typename = Baton.Registry.slot(Types.MediaDataChangeNotification, "__typename")
+ static let id = Baton.Registry.slot(Types.MediaDataChangeNotification, "id")
+ static let mediaId = Baton.Registry.slot(Types.MediaDataChangeNotification, "mediaId")
+ static let reason = Baton.Registry.slot(Types.MediaDataChangeNotification, "reason")
+ }
+ nonisolated enum MediaEdge {
+ static let id = Baton.Registry.slot(Types.MediaEdge, "id")
+ static let node = Baton.Registry.slot(Types.MediaEdge, "node")
+ static let relationType_4caf07 = Baton.Registry.slot(Types.MediaEdge, "relationType(version:2)")
+ }
+ nonisolated enum MediaList {
+ static let advancedScores = Baton.Registry.slot(Types.MediaList, "advancedScores")
+ static let completedAt = Baton.Registry.slot(Types.MediaList, "completedAt")
+ static let customLists_3a6c27 = Baton.Registry.slot(Types.MediaList, "customLists(asArray:true)")
+ static let hiddenFromStatusLists = Baton.Registry.slot(Types.MediaList, "hiddenFromStatusLists")
+ static let id = Baton.Registry.slot(Types.MediaList, "id")
+ static let media = Baton.Registry.slot(Types.MediaList, "media")
+ static let notes = Baton.Registry.slot(Types.MediaList, "notes")
+ static let priority = Baton.Registry.slot(Types.MediaList, "priority")
+ static let `private` = Baton.Registry.slot(Types.MediaList, "private")
+ static let progress = Baton.Registry.slot(Types.MediaList, "progress")
+ static let progressVolumes = Baton.Registry.slot(Types.MediaList, "progressVolumes")
+ static let `repeat` = Baton.Registry.slot(Types.MediaList, "repeat")
+ static let score = Baton.Registry.slot(Types.MediaList, "score")
+ static let startedAt = Baton.Registry.slot(Types.MediaList, "startedAt")
+ static let status = Baton.Registry.slot(Types.MediaList, "status")
+ static let updatedAt = Baton.Registry.slot(Types.MediaList, "updatedAt")
+ }
+ nonisolated enum MediaListCollection {
+ static let hasNextChunk = Baton.Registry.slot(Types.MediaListCollection, "hasNextChunk")
+ static let lists = Baton.Registry.slot(Types.MediaListCollection, "lists")
+ }
+ nonisolated enum MediaListGroup {
+ static let entries = Baton.Registry.slot(Types.MediaListGroup, "entries")
+ static let isCustomList = Baton.Registry.slot(Types.MediaListGroup, "isCustomList")
+ static let name = Baton.Registry.slot(Types.MediaListGroup, "name")
+ static let status = Baton.Registry.slot(Types.MediaListGroup, "status")
+ }
+ nonisolated enum MediaListOptions {
+ static let animeList = Baton.Registry.slot(Types.MediaListOptions, "animeList")
+ static let scoreFormat = Baton.Registry.slot(Types.MediaListOptions, "scoreFormat")
+ }
+ nonisolated enum MediaListTypeOptions {
+ static let advancedScoringEnabled = Baton.Registry.slot(Types.MediaListTypeOptions, "advancedScoringEnabled")
+ static let customLists = Baton.Registry.slot(Types.MediaListTypeOptions, "customLists")
+ }
+ nonisolated enum MediaTitle {
+ static let english = Baton.Registry.slot(Types.MediaTitle, "english")
+ static let native = Baton.Registry.slot(Types.MediaTitle, "native")
+ static let romaji = Baton.Registry.slot(Types.MediaTitle, "romaji")
+ static let userPreferred = Baton.Registry.slot(Types.MediaTitle, "userPreferred")
+ }
+ nonisolated enum Mutation {
+ static let DeleteMediaListEntry = Baton.Registry.slot(Types.Mutation, "DeleteMediaListEntry")
+ static let SaveMediaListEntry = Baton.Registry.slot(Types.Mutation, "SaveMediaListEntry")
+ }
+ nonisolated enum NotificationUnion {
+ static let __typename = Baton.Registry.slot(Types.NotificationUnion, "__typename")
+ static let id = Baton.Registry.slot(Types.NotificationUnion, "id")
+ }
+ nonisolated enum Page {
+ static let media_aca52b = Baton.DynamicKey(Types.Page, "media", [Baton.KeyArgument("season", [.variable("season")]), Baton.KeyArgument("seasonYear", [.variable("seasonYear")]), Baton.KeyArgument("sort", [.literal("[\"POPULARITY_DESC\"]")]), Baton.KeyArgument("type", [.literal("\"ANIME\"")])])
+ static let notifications = Baton.Registry.slot(Types.Page, "notifications")
+ static let pageInfo = Baton.Registry.slot(Types.Page, "pageInfo")
+ static let threadComments_88ffc8 = Baton.DynamicKey(Types.Page, "threadComments", [Baton.KeyArgument("threadId", [.variable("threadId")])])
+ }
+ nonisolated enum PageInfo {
+ static let hasNextPage = Baton.Registry.slot(Types.PageInfo, "hasNextPage")
+ }
+ nonisolated enum Query {
+ static let Media_976b29 = Baton.DynamicKey(Types.Query, "Media", [Baton.KeyArgument("id", [.variable("id")])])
+ static let MediaList_8bfff7 = Baton.DynamicKey(Types.Query, "MediaList", [Baton.KeyArgument("id", [.variable("id")])])
+ static let MediaListCollection_fc1216 = Baton.DynamicKey(Types.Query, "MediaListCollection", [Baton.KeyArgument("chunk", [.variable("chunk")]), Baton.KeyArgument("forceSingleCompletedList", [.literal("true")]), Baton.KeyArgument("perChunk", [.literal("500")]), Baton.KeyArgument("type", [.variable("mediaType")]), Baton.KeyArgument("userId", [.variable("userId")])])
+ static let Page_839a80 = Baton.DynamicKey(Types.Query, "Page", [Baton.KeyArgument("page", [.variable("page")]), Baton.KeyArgument("perPage", [.literal("25")])])
+ static let Page_9d9873 = Baton.DynamicKey(Types.Query, "Page", [Baton.KeyArgument("page", [.variable("page")]), Baton.KeyArgument("perPage", [.literal("48")])])
+ static let Page_c5f40b = Baton.Registry.slot(Types.Query, "Page(page:1,perPage:25)")
+ static let Viewer = Baton.Registry.slot(Types.Query, "Viewer")
+ }
+ nonisolated enum ThreadComment {
+ static let childComments = Baton.Registry.slot(Types.ThreadComment, "childComments")
+ static let comment = Baton.Registry.slot(Types.ThreadComment, "comment")
+ static let id = Baton.Registry.slot(Types.ThreadComment, "id")
+ }
+ nonisolated enum ThreadCommentReplyNotification {
+ static let __typename = Baton.Registry.slot(Types.ThreadCommentReplyNotification, "__typename")
+ static let commentId = Baton.Registry.slot(Types.ThreadCommentReplyNotification, "commentId")
+ static let id = Baton.Registry.slot(Types.ThreadCommentReplyNotification, "id")
+ }
+ nonisolated enum User {
+ static let avatar = Baton.Registry.slot(Types.User, "avatar")
+ static let id = Baton.Registry.slot(Types.User, "id")
+ static let mediaListOptions = Baton.Registry.slot(Types.User, "mediaListOptions")
+ static let name = Baton.Registry.slot(Types.User, "name")
+ static let unreadNotificationCount = Baton.Registry.slot(Types.User, "unreadNotificationCount")
+ }
+ nonisolated enum UserAvatar {
+ static let large = Baton.Registry.slot(Types.UserAvatar, "large")
+ }
+}
+
+/// The schema's enum `MediaFormat`. A value this build does not know reads as `unknown`, with its text.
+nonisolated public enum MediaFormat: Baton.GeneratedEnum {
+ case TV
+ case TV_SHORT
+ case MOVIE
+ case SPECIAL
+ case OVA
+ case ONA
+ case MUSIC
+ case MANGA
+ case NOVEL
+ case ONE_SHOT
+ case unknown(String)
+
+ public init(enumText: String) {
+ self = switch enumText {
+ case "TV": .TV
+ case "TV_SHORT": .TV_SHORT
+ case "MOVIE": .MOVIE
+ case "SPECIAL": .SPECIAL
+ case "OVA": .OVA
+ case "ONA": .ONA
+ case "MUSIC": .MUSIC
+ case "MANGA": .MANGA
+ case "NOVEL": .NOVEL
+ case "ONE_SHOT": .ONE_SHOT
+ default: .unknown(enumText)
+ }
+ }
+
+ public var scalarText: String {
+ switch self {
+ case .TV: "TV"
+ case .TV_SHORT: "TV_SHORT"
+ case .MOVIE: "MOVIE"
+ case .SPECIAL: "SPECIAL"
+ case .OVA: "OVA"
+ case .ONA: "ONA"
+ case .MUSIC: "MUSIC"
+ case .MANGA: "MANGA"
+ case .NOVEL: "NOVEL"
+ case .ONE_SHOT: "ONE_SHOT"
+ case .unknown(let text): text
+ }
+ }
+}
+
+/// The schema's enum `MediaListStatus`. A value this build does not know reads as `unknown`, with its text.
+nonisolated public enum MediaListStatus: Baton.GeneratedEnum {
+ case CURRENT
+ case PLANNING
+ case COMPLETED
+ case DROPPED
+ case PAUSED
+ case REPEATING
+ case unknown(String)
+
+ public init(enumText: String) {
+ self = switch enumText {
+ case "CURRENT": .CURRENT
+ case "PLANNING": .PLANNING
+ case "COMPLETED": .COMPLETED
+ case "DROPPED": .DROPPED
+ case "PAUSED": .PAUSED
+ case "REPEATING": .REPEATING
+ default: .unknown(enumText)
+ }
+ }
+
+ public var scalarText: String {
+ switch self {
+ case .CURRENT: "CURRENT"
+ case .PLANNING: "PLANNING"
+ case .COMPLETED: "COMPLETED"
+ case .DROPPED: "DROPPED"
+ case .PAUSED: "PAUSED"
+ case .REPEATING: "REPEATING"
+ case .unknown(let text): text
+ }
+ }
+}
+
+/// The schema's enum `MediaRelation`. A value this build does not know reads as `unknown`, with its text.
+nonisolated public enum MediaRelation: Baton.GeneratedEnum {
+ case ADAPTATION
+ case PREQUEL
+ case SEQUEL
+ case PARENT
+ case SIDE_STORY
+ case CHARACTER
+ case SUMMARY
+ case ALTERNATIVE
+ case SPIN_OFF
+ case OTHER
+ case SOURCE
+ case COMPILATION
+ case CONTAINS
+ case SAME_UNIVERSE
+ case unknown(String)
+
+ public init(enumText: String) {
+ self = switch enumText {
+ case "ADAPTATION": .ADAPTATION
+ case "PREQUEL": .PREQUEL
+ case "SEQUEL": .SEQUEL
+ case "PARENT": .PARENT
+ case "SIDE_STORY": .SIDE_STORY
+ case "CHARACTER": .CHARACTER
+ case "SUMMARY": .SUMMARY
+ case "ALTERNATIVE": .ALTERNATIVE
+ case "SPIN_OFF": .SPIN_OFF
+ case "OTHER": .OTHER
+ case "SOURCE": .SOURCE
+ case "COMPILATION": .COMPILATION
+ case "CONTAINS": .CONTAINS
+ case "SAME_UNIVERSE": .SAME_UNIVERSE
+ default: .unknown(enumText)
+ }
+ }
+
+ public var scalarText: String {
+ switch self {
+ case .ADAPTATION: "ADAPTATION"
+ case .PREQUEL: "PREQUEL"
+ case .SEQUEL: "SEQUEL"
+ case .PARENT: "PARENT"
+ case .SIDE_STORY: "SIDE_STORY"
+ case .CHARACTER: "CHARACTER"
+ case .SUMMARY: "SUMMARY"
+ case .ALTERNATIVE: "ALTERNATIVE"
+ case .SPIN_OFF: "SPIN_OFF"
+ case .OTHER: "OTHER"
+ case .SOURCE: "SOURCE"
+ case .COMPILATION: "COMPILATION"
+ case .CONTAINS: "CONTAINS"
+ case .SAME_UNIVERSE: "SAME_UNIVERSE"
+ case .unknown(let text): text
+ }
+ }
+}
+
+/// The schema's enum `MediaSeason`. A value this build does not know reads as `unknown`, with its text.
+nonisolated public enum MediaSeason: Baton.GeneratedEnum {
+ case WINTER
+ case SPRING
+ case SUMMER
+ case FALL
+ case unknown(String)
+
+ public init(enumText: String) {
+ self = switch enumText {
+ case "WINTER": .WINTER
+ case "SPRING": .SPRING
+ case "SUMMER": .SUMMER
+ case "FALL": .FALL
+ default: .unknown(enumText)
+ }
+ }
+
+ public var scalarText: String {
+ switch self {
+ case .WINTER: "WINTER"
+ case .SPRING: "SPRING"
+ case .SUMMER: "SUMMER"
+ case .FALL: "FALL"
+ case .unknown(let text): text
+ }
+ }
+}
+
+/// The schema's enum `MediaSource`. A value this build does not know reads as `unknown`, with its text.
+nonisolated public enum MediaSource: Baton.GeneratedEnum {
+ case ORIGINAL
+ case MANGA
+ case LIGHT_NOVEL
+ case VISUAL_NOVEL
+ case VIDEO_GAME
+ case OTHER
+ case NOVEL
+ case DOUJINSHI
+ case ANIME
+ case WEB_NOVEL
+ case LIVE_ACTION
+ case GAME
+ case COMIC
+ case MULTIMEDIA_PROJECT
+ case PICTURE_BOOK
+ case unknown(String)
+
+ public init(enumText: String) {
+ self = switch enumText {
+ case "ORIGINAL": .ORIGINAL
+ case "MANGA": .MANGA
+ case "LIGHT_NOVEL": .LIGHT_NOVEL
+ case "VISUAL_NOVEL": .VISUAL_NOVEL
+ case "VIDEO_GAME": .VIDEO_GAME
+ case "OTHER": .OTHER
+ case "NOVEL": .NOVEL
+ case "DOUJINSHI": .DOUJINSHI
+ case "ANIME": .ANIME
+ case "WEB_NOVEL": .WEB_NOVEL
+ case "LIVE_ACTION": .LIVE_ACTION
+ case "GAME": .GAME
+ case "COMIC": .COMIC
+ case "MULTIMEDIA_PROJECT": .MULTIMEDIA_PROJECT
+ case "PICTURE_BOOK": .PICTURE_BOOK
+ default: .unknown(enumText)
+ }
+ }
+
+ public var scalarText: String {
+ switch self {
+ case .ORIGINAL: "ORIGINAL"
+ case .MANGA: "MANGA"
+ case .LIGHT_NOVEL: "LIGHT_NOVEL"
+ case .VISUAL_NOVEL: "VISUAL_NOVEL"
+ case .VIDEO_GAME: "VIDEO_GAME"
+ case .OTHER: "OTHER"
+ case .NOVEL: "NOVEL"
+ case .DOUJINSHI: "DOUJINSHI"
+ case .ANIME: "ANIME"
+ case .WEB_NOVEL: "WEB_NOVEL"
+ case .LIVE_ACTION: "LIVE_ACTION"
+ case .GAME: "GAME"
+ case .COMIC: "COMIC"
+ case .MULTIMEDIA_PROJECT: "MULTIMEDIA_PROJECT"
+ case .PICTURE_BOOK: "PICTURE_BOOK"
+ case .unknown(let text): text
+ }
+ }
+}
+
+/// The schema's enum `MediaStatus`. A value this build does not know reads as `unknown`, with its text.
+nonisolated public enum MediaStatus: Baton.GeneratedEnum {
+ case FINISHED
+ case RELEASING
+ case NOT_YET_RELEASED
+ case CANCELLED
+ case HIATUS
+ case unknown(String)
+
+ public init(enumText: String) {
+ self = switch enumText {
+ case "FINISHED": .FINISHED
+ case "RELEASING": .RELEASING
+ case "NOT_YET_RELEASED": .NOT_YET_RELEASED
+ case "CANCELLED": .CANCELLED
+ case "HIATUS": .HIATUS
+ default: .unknown(enumText)
+ }
+ }
+
+ public var scalarText: String {
+ switch self {
+ case .FINISHED: "FINISHED"
+ case .RELEASING: "RELEASING"
+ case .NOT_YET_RELEASED: "NOT_YET_RELEASED"
+ case .CANCELLED: "CANCELLED"
+ case .HIATUS: "HIATUS"
+ case .unknown(let text): text
+ }
+ }
+}
+
+/// The schema's enum `MediaType`. A value this build does not know reads as `unknown`, with its text.
+nonisolated public enum MediaType: Baton.GeneratedEnum {
+ case ANIME
+ case MANGA
+ case unknown(String)
+
+ public init(enumText: String) {
+ self = switch enumText {
+ case "ANIME": .ANIME
+ case "MANGA": .MANGA
+ default: .unknown(enumText)
+ }
+ }
+
+ public var scalarText: String {
+ switch self {
+ case .ANIME: "ANIME"
+ case .MANGA: "MANGA"
+ case .unknown(let text): text
+ }
+ }
+}
+
+/// The schema's enum `ScoreFormat`. A value this build does not know reads as `unknown`, with its text.
+nonisolated public enum ScoreFormat: Baton.GeneratedEnum {
+ case POINT_100
+ case POINT_10_DECIMAL
+ case POINT_10
+ case POINT_5
+ case POINT_3
+ case unknown(String)
+
+ public init(enumText: String) {
+ self = switch enumText {
+ case "POINT_100": .POINT_100
+ case "POINT_10_DECIMAL": .POINT_10_DECIMAL
+ case "POINT_10": .POINT_10
+ case "POINT_5": .POINT_5
+ case "POINT_3": .POINT_3
+ default: .unknown(enumText)
+ }
+ }
+
+ public var scalarText: String {
+ switch self {
+ case .POINT_100: "POINT_100"
+ case .POINT_10_DECIMAL: "POINT_10_DECIMAL"
+ case .POINT_10: "POINT_10"
+ case .POINT_5: "POINT_5"
+ case .POINT_3: "POINT_3"
+ case .unknown(let text): text
+ }
+ }
+}
diff --git a/compiler/src/tests/goldens-kotlin/Baton.baton.kt b/compiler/src/tests/goldens-kotlin/Baton.baton.kt
index 0f65b9b8..712e89a7 100644
--- a/compiler/src/tests/goldens-kotlin/Baton.baton.kt
+++ b/compiler/src/tests/goldens-kotlin/Baton.baton.kt
@@ -23,22 +23,35 @@ import baton.Variables
/** Interned schema types used by this module's documents. */
object Types {
/** The schema's digest: pass it as the image's `version`, so an image written under another schema starts again. */
- val schemaDigest = "5beaef3e41ff4dcf1169e9ba839e88cc"
+ val schemaDigest = "05a112649a1212d03abe827e91364544"
/** The format of this generated code, which the runtime that reads it declares; a runtime of another format fails to compile this line. */
val format = baton.Format4
+ val ActivityLikeNotification: TypeID = Registry.type("ActivityLikeNotification")
+ val ActivityMentionNotification: TypeID = Registry.type("ActivityMentionNotification")
+ val ActivityMessageNotification: TypeID = Registry.type("ActivityMessageNotification")
+ val ActivityReplyLikeNotification: TypeID = Registry.type("ActivityReplyLikeNotification")
+ val ActivityReplyNotification: TypeID = Registry.type("ActivityReplyNotification")
+ val ActivityReplySubscribedNotification: TypeID = Registry.type("ActivityReplySubscribedNotification")
val AddNotePayload: TypeID = Registry.type("AddNotePayload")
+ val AiringNotification: TypeID = Registry.type("AiringNotification")
val Any: TypeID = Registry.type("Any")
val Asset: TypeID = Registry.type("Asset")
val Baton: TypeID = Registry.type("Baton")
val Character: TypeID = Registry.type("Character")
+ val CharacterSubmissionUpdateNotification: TypeID = Registry.type("CharacterSubmissionUpdateNotification")
val Characters: TypeID = Registry.type("Characters")
val Deleted: TypeID = Registry.type("Deleted")
val Draft: TypeID = Registry.type("Draft")
val Episode: TypeID = Registry.type("Episode")
val FavoritePayload: TypeID = Registry.type("FavoritePayload")
+ val FollowingNotification: TypeID = Registry.type("FollowingNotification")
val Info: TypeID = Registry.type("Info")
val ListsPayload: TypeID = Registry.type("ListsPayload")
val Location: TypeID = Registry.type("Location")
+ val MediaDataChangeNotification: TypeID = Registry.type("MediaDataChangeNotification")
+ val MediaDeletionNotification: TypeID = Registry.type("MediaDeletionNotification")
+ val MediaMergeNotification: TypeID = Registry.type("MediaMergeNotification")
+ val MediaSubmissionUpdateNotification: TypeID = Registry.type("MediaSubmissionUpdateNotification")
val Mutation: TypeID = Registry.type("Mutation")
val Named: TypeID = Registry.type("Named")
val Node: TypeID = Registry.type("Node")
@@ -46,17 +59,25 @@ object Types {
val NoteAddedPayload: TypeID = Registry.type("NoteAddedPayload")
val NoteConnection: TypeID = Registry.type("NoteConnection")
val NoteEdge: TypeID = Registry.type("NoteEdge")
+ val NotificationUnion: TypeID = Registry.type("NotificationUnion")
val PageInfo: TypeID = Registry.type("PageInfo")
val Protocol: TypeID = Registry.type("Protocol")
val Query: TypeID = Registry.type("Query")
val Quote: TypeID = Registry.type("Quote")
+ val RelatedMediaAdditionNotification: TypeID = Registry.type("RelatedMediaAdditionNotification")
val RemoveNotePayload: TypeID = Registry.type("RemoveNotePayload")
val SearchResult: TypeID = Registry.type("SearchResult")
val Secret: TypeID = Registry.type("Secret", transient = true)
val Set: TypeID = Registry.type("Set")
val Spelled: TypeID = Registry.type("Spelled")
val Spelling: TypeID = Registry.type("Spelling")
+ val StaffSubmissionUpdateNotification: TypeID = Registry.type("StaffSubmissionUpdateNotification")
val Subscription: TypeID = Registry.type("Subscription")
+ val ThreadCommentLikeNotification: TypeID = Registry.type("ThreadCommentLikeNotification")
+ val ThreadCommentMentionNotification: TypeID = Registry.type("ThreadCommentMentionNotification")
+ val ThreadCommentReplyNotification: TypeID = Registry.type("ThreadCommentReplyNotification")
+ val ThreadCommentSubscribedNotification: TypeID = Registry.type("ThreadCommentSubscribedNotification")
+ val ThreadLikeNotification: TypeID = Registry.type("ThreadLikeNotification")
val Tokenizer: TypeID = Registry.type("Tokenizer")
val Type: TypeID = Registry.type("Type")
val Types: TypeID = Registry.type("Types")
@@ -72,10 +93,39 @@ object Types {
/** Interned storage keys used by this module's documents. */
object Slots {
+ object ActivityLikeNotification {
+ val activityId: Slot = Registry.slot(Types.ActivityLikeNotification, "activityId")
+ val id: Slot = Registry.slot(Types.ActivityLikeNotification, "id")
+ }
+ object ActivityMentionNotification {
+ val activityId: Slot = Registry.slot(Types.ActivityMentionNotification, "activityId")
+ val id: Slot = Registry.slot(Types.ActivityMentionNotification, "id")
+ }
+ object ActivityMessageNotification {
+ val activityId: Slot = Registry.slot(Types.ActivityMessageNotification, "activityId")
+ val id: Slot = Registry.slot(Types.ActivityMessageNotification, "id")
+ }
+ object ActivityReplyLikeNotification {
+ val activityId: Slot = Registry.slot(Types.ActivityReplyLikeNotification, "activityId")
+ val id: Slot = Registry.slot(Types.ActivityReplyLikeNotification, "id")
+ }
+ object ActivityReplyNotification {
+ val activityId: Slot = Registry.slot(Types.ActivityReplyNotification, "activityId")
+ val id: Slot = Registry.slot(Types.ActivityReplyNotification, "id")
+ }
+ object ActivityReplySubscribedNotification {
+ val activityId: Slot = Registry.slot(Types.ActivityReplySubscribedNotification, "activityId")
+ val id: Slot = Registry.slot(Types.ActivityReplySubscribedNotification, "id")
+ }
object AddNotePayload {
val note: Slot = Registry.slot(Types.AddNotePayload, "note")
val noteEdge: Slot = Registry.slot(Types.AddNotePayload, "noteEdge")
}
+ object AiringNotification {
+ val __typename: Slot = Registry.slot(Types.AiringNotification, "__typename")
+ val episode: Slot = Registry.slot(Types.AiringNotification, "episode")
+ val id: Slot = Registry.slot(Types.AiringNotification, "id")
+ }
object Any {
val id: Slot = Registry.slot(Types.Any, "id")
val label: Slot = Registry.slot(Types.Any, "label")
@@ -135,6 +185,10 @@ object Slots {
val status: Slot = Registry.slot(Types.Character, "status")
val type: Slot = Registry.slot(Types.Character, "type")
}
+ object CharacterSubmissionUpdateNotification {
+ val id: Slot = Registry.slot(Types.CharacterSubmissionUpdateNotification, "id")
+ val status: Slot = Registry.slot(Types.CharacterSubmissionUpdateNotification, "status")
+ }
object Characters {
val info: Slot = Registry.slot(Types.Characters, "info")
val results: Slot = Registry.slot(Types.Characters, "results")
@@ -155,10 +209,17 @@ object Slots {
val episode: Slot = Registry.slot(Types.Episode, "episode")
val id: Slot = Registry.slot(Types.Episode, "id")
val name: Slot = Registry.slot(Types.Episode, "name")
+ val status: Slot = Registry.slot(Types.Episode, "status")
+ val status_98c3c3: Slot = Registry.slot(Types.Episode, "status(version:2)")
}
object FavoritePayload {
val character: Slot = Registry.slot(Types.FavoritePayload, "character")
}
+ object FollowingNotification {
+ val __typename: Slot = Registry.slot(Types.FollowingNotification, "__typename")
+ val id: Slot = Registry.slot(Types.FollowingNotification, "id")
+ val userId: Slot = Registry.slot(Types.FollowingNotification, "userId")
+ }
object Info {
val count: Slot = Registry.slot(Types.Info, "count")
val next: Slot = Registry.slot(Types.Info, "next")
@@ -182,6 +243,25 @@ object Slots {
val name: Slot = Registry.slot(Types.Location, "name")
val type: Slot = Registry.slot(Types.Location, "type")
}
+ object MediaDataChangeNotification {
+ val __typename: Slot = Registry.slot(Types.MediaDataChangeNotification, "__typename")
+ val id: Slot = Registry.slot(Types.MediaDataChangeNotification, "id")
+ val reason: Slot = Registry.slot(Types.MediaDataChangeNotification, "reason")
+ }
+ object MediaDeletionNotification {
+ val __typename: Slot = Registry.slot(Types.MediaDeletionNotification, "__typename")
+ val deletedMediaTitle: Slot = Registry.slot(Types.MediaDeletionNotification, "deletedMediaTitle")
+ val id: Slot = Registry.slot(Types.MediaDeletionNotification, "id")
+ }
+ object MediaMergeNotification {
+ val __typename: Slot = Registry.slot(Types.MediaMergeNotification, "__typename")
+ val deletedMediaTitles: Slot = Registry.slot(Types.MediaMergeNotification, "deletedMediaTitles")
+ val id: Slot = Registry.slot(Types.MediaMergeNotification, "id")
+ }
+ object MediaSubmissionUpdateNotification {
+ val id: Slot = Registry.slot(Types.MediaSubmissionUpdateNotification, "id")
+ val status: Slot = Registry.slot(Types.MediaSubmissionUpdateNotification, "status")
+ }
object Mutation {
val addNote: Slot = Registry.slot(Types.Mutation, "addNote")
val discardAsset: Slot = Registry.slot(Types.Mutation, "discardAsset")
@@ -224,6 +304,13 @@ object Slots {
val cursor: Slot = Registry.slot(Types.NoteEdge, "cursor")
val node: Slot = Registry.slot(Types.NoteEdge, "node")
}
+ object NotificationUnion {
+ val __typename: Slot = Registry.slot(Types.NotificationUnion, "__typename")
+ val activityId: Slot = Registry.slot(Types.NotificationUnion, "activityId")
+ val commentId: Slot = Registry.slot(Types.NotificationUnion, "commentId")
+ val id: Slot = Registry.slot(Types.NotificationUnion, "id")
+ val status: Slot = Registry.slot(Types.NotificationUnion, "status")
+ }
object PageInfo {
val endCursor: Slot = Registry.slot(Types.PageInfo, "endCursor")
val hasNextPage: Slot = Registry.slot(Types.PageInfo, "hasNextPage")
@@ -235,6 +322,10 @@ object Slots {
val label: Slot = Registry.slot(Types.Protocol, "label")
}
object Query {
+ val Episode_9e33c8 = DynamicKey(Types.Query, "Episode", listOf(KeyArgument("id", listOf(KeyPart.Variable("id")))))
+ val GenreCollection: Slot = Registry.slot(Types.Query, "GenreCollection")
+ val Notification: Slot = Registry.slot(Types.Query, "Notification")
+ val Viewer: Slot = Registry.slot(Types.Query, "Viewer")
val __TestRootNotes_notes_connection: Slot = Registry.slot(Types.Query, "__TestRootNotes_notes_connection")
val asset_9e39ed = DynamicKey(Types.Query, "asset", listOf(KeyArgument("uuid", listOf(KeyPart.Variable("uuid")))))
val assets: Slot = Registry.slot(Types.Query, "assets")
@@ -258,6 +349,7 @@ object Slots {
val charactersMatching_ca82bd = DynamicKey(Types.Query, "charactersMatching", listOf(KeyArgument("filters", listOf(KeyPart.Variable("filters")))))
val charactersWithStatus_deb51f = DynamicKey(Types.Query, "charactersWithStatus", listOf(KeyArgument("any", listOf(KeyPart.Variable("any"))), KeyArgument("status", listOf(KeyPart.Variable("status")))))
val drafts: Slot = Registry.clientSlot(Types.Query, "drafts")
+ val episode_7d0060 = DynamicKey(Types.Query, "episode", listOf(KeyArgument("id", listOf(KeyPart.Variable("id")))))
val namesake_9b6471 = DynamicKey(Types.Query, "namesake", listOf(KeyArgument("name", listOf(KeyPart.Variable("name")))))
val node_8f7d08 = DynamicKey(Types.Query, "node", listOf(KeyArgument("id", listOf(KeyPart.Variable("id")))))
val node_c27cc2: Slot = Registry.slot(Types.Query, "node(id:1)")
@@ -279,6 +371,11 @@ object Slots {
val quote: Slot = Registry.slot(Types.Quote, "quote")
val rate: Slot = Registry.slot(Types.Quote, "rate")
}
+ object RelatedMediaAdditionNotification {
+ val __typename: Slot = Registry.slot(Types.RelatedMediaAdditionNotification, "__typename")
+ val id: Slot = Registry.slot(Types.RelatedMediaAdditionNotification, "id")
+ val mediaId: Slot = Registry.slot(Types.RelatedMediaAdditionNotification, "mediaId")
+ }
object RemoveNotePayload {
val removedNoteId: Slot = Registry.slot(Types.RemoveNotePayload, "removedNoteId")
}
@@ -300,10 +397,35 @@ object Slots {
val id: Slot = Registry.slot(Types.Spelling, "id")
val label: Slot = Registry.slot(Types.Spelling, "label")
}
+ object StaffSubmissionUpdateNotification {
+ val id: Slot = Registry.slot(Types.StaffSubmissionUpdateNotification, "id")
+ val status: Slot = Registry.slot(Types.StaffSubmissionUpdateNotification, "status")
+ }
object Subscription {
val noteAdded_cab094: Slot = Registry.slot(Types.Subscription, "noteAdded(characterId:\"1\")")
val noteAdded_5f458b = DynamicKey(Types.Subscription, "noteAdded", listOf(KeyArgument("characterId", listOf(KeyPart.Variable("characterId")))))
}
+ object ThreadCommentLikeNotification {
+ val commentId: Slot = Registry.slot(Types.ThreadCommentLikeNotification, "commentId")
+ val id: Slot = Registry.slot(Types.ThreadCommentLikeNotification, "id")
+ }
+ object ThreadCommentMentionNotification {
+ val commentId: Slot = Registry.slot(Types.ThreadCommentMentionNotification, "commentId")
+ val id: Slot = Registry.slot(Types.ThreadCommentMentionNotification, "id")
+ }
+ object ThreadCommentReplyNotification {
+ val commentId: Slot = Registry.slot(Types.ThreadCommentReplyNotification, "commentId")
+ val id: Slot = Registry.slot(Types.ThreadCommentReplyNotification, "id")
+ }
+ object ThreadCommentSubscribedNotification {
+ val commentId: Slot = Registry.slot(Types.ThreadCommentSubscribedNotification, "commentId")
+ val id: Slot = Registry.slot(Types.ThreadCommentSubscribedNotification, "id")
+ }
+ object ThreadLikeNotification {
+ val __typename: Slot = Registry.slot(Types.ThreadLikeNotification, "__typename")
+ val id: Slot = Registry.slot(Types.ThreadLikeNotification, "id")
+ val threadId: Slot = Registry.slot(Types.ThreadLikeNotification, "threadId")
+ }
object Tokenizer {
val count: Slot = Registry.slot(Types.Tokenizer, "count")
val counts: Slot = Registry.slot(Types.Tokenizer, "counts")
@@ -329,6 +451,28 @@ object Slots {
}
}
+/** The schema's enum `EpisodeStatus`. A value this build does not know reads as `Undeclared`, with its text. */
+sealed interface EpisodeStatus : GeneratedEnum {
+ data object FINISHED : EpisodeStatus { override val scalarText: String get() = "FINISHED" }
+ data object RELEASING : EpisodeStatus { override val scalarText: String get() = "RELEASING" }
+ data object NOT_YET_RELEASED : EpisodeStatus { override val scalarText: String get() = "NOT_YET_RELEASED" }
+ data object CANCELLED : EpisodeStatus { override val scalarText: String get() = "CANCELLED" }
+ data object HIATUS : EpisodeStatus { override val scalarText: String get() = "HIATUS" }
+ data class Undeclared(override val scalarText: String) : EpisodeStatus
+
+ companion object {
+ /** The value `text` names, or `Undeclared` with it. */
+ fun of(text: String): EpisodeStatus = when (text) {
+ "FINISHED" -> FINISHED
+ "RELEASING" -> RELEASING
+ "NOT_YET_RELEASED" -> NOT_YET_RELEASED
+ "CANCELLED" -> CANCELLED
+ "HIATUS" -> HIATUS
+ else -> Undeclared(text)
+ }
+ }
+}
+
/** The schema's enum `Status`. A value this build does not know reads as `Undeclared`, with its text. */
sealed interface Status : GeneratedEnum {
data object ALIVE : Status { override val scalarText: String get() = "ALIVE" }
diff --git a/compiler/src/tests/goldens-kotlin/ConditionDocuments.baton.kt b/compiler/src/tests/goldens-kotlin/ConditionDocuments.baton.kt
index 60bacea4..d7fbe39c 100644
--- a/compiler/src/tests/goldens-kotlin/ConditionDocuments.baton.kt
+++ b/compiler/src/tests/goldens-kotlin/ConditionDocuments.baton.kt
@@ -371,6 +371,284 @@ private object `TestNodeFields-plan` {
}
}
+/** Operation value for `query TestNotifications`. */
+@Immutable
+class TestNotifications : QueryOperation {
+ override val variables: Variables
+ get() = Variables.none
+ override val type: OperationType get() = Companion
+
+ override fun equals(other: Any?): Boolean = other is TestNotifications
+ override fun hashCode(): Int = 0
+
+ companion object : QueryType {
+ override val name = "TestNotifications"
+ override val document: Document = Document.Text("query TestNotifications{Notification{__typename,...on AiringNotification{id,episode},...on FollowingNotification{id,userId},...on ActivityMessageNotification{id,activityId},...on ActivityMentionNotification{id,activityId},...on ActivityReplyNotification{id,activityId},...on ActivityReplySubscribedNotification{id,activityId},...on ActivityLikeNotification{id,activityId},...on ActivityReplyLikeNotification{id,activityId},...on ThreadCommentMentionNotification{id,commentId},...on ThreadCommentReplyNotification{id,commentId},...on ThreadCommentSubscribedNotification{id,commentId},...on ThreadCommentLikeNotification{id,commentId},...on ThreadLikeNotification{id,threadId},...on RelatedMediaAdditionNotification{id,mediaId},...on MediaDataChangeNotification{id,reason},...on MediaMergeNotification{id,deletedMediaTitles},...on MediaDeletionNotification{id,deletedMediaTitle},...on MediaSubmissionUpdateNotification{id,status},...on StaffSubmissionUpdateNotification{id,status},...on CharacterSubmissionUpdateNotification{id,status}}}")
+ override val kind = OperationKind.QUERY
+ override val plan: Plan by lazy { Plan(root = `TestNotifications-plan`.selection0, transient = Types.transient) }
+
+ override fun data(anchor: Anchor): Data = Data(anchor)
+ }
+
+ @Stable
+ class Data(override val anchor: Anchor) : Lens {
+ val Notification: List? get() = anchor.list(Slots.Query.Notification, ::Notification2)
+ override fun equals(other: Any?): Boolean = other is TestNotifications.Data && other.anchor == anchor
+ override fun hashCode(): Int = anchor.hashCode()
+
+ @Stable
+ class Notification2(override val anchor: Anchor) : Lens {
+ val asAiringNotification: AsAiringNotification? get() = if (anchor.record.type == Types.AiringNotification) AsAiringNotification(anchor) else null
+ val asFollowingNotification: AsFollowingNotification? get() = if (anchor.record.type == Types.FollowingNotification) AsFollowingNotification(anchor) else null
+ val asActivityMessageNotification: AsActivityMessageNotification? get() = if (anchor.record.type == Types.ActivityMessageNotification) AsActivityMessageNotification(anchor) else null
+ val asActivityMentionNotification: AsActivityMentionNotification? get() = if (anchor.record.type == Types.ActivityMentionNotification) AsActivityMentionNotification(anchor) else null
+ val asActivityReplyNotification: AsActivityReplyNotification? get() = if (anchor.record.type == Types.ActivityReplyNotification) AsActivityReplyNotification(anchor) else null
+ val asActivityReplySubscribedNotification: AsActivityReplySubscribedNotification? get() = if (anchor.record.type == Types.ActivityReplySubscribedNotification) AsActivityReplySubscribedNotification(anchor) else null
+ val asActivityLikeNotification: AsActivityLikeNotification? get() = if (anchor.record.type == Types.ActivityLikeNotification) AsActivityLikeNotification(anchor) else null
+ val asActivityReplyLikeNotification: AsActivityReplyLikeNotification? get() = if (anchor.record.type == Types.ActivityReplyLikeNotification) AsActivityReplyLikeNotification(anchor) else null
+ val asThreadCommentMentionNotification: AsThreadCommentMentionNotification? get() = if (anchor.record.type == Types.ThreadCommentMentionNotification) AsThreadCommentMentionNotification(anchor) else null
+ val asThreadCommentReplyNotification: AsThreadCommentReplyNotification? get() = if (anchor.record.type == Types.ThreadCommentReplyNotification) AsThreadCommentReplyNotification(anchor) else null
+ val asThreadCommentSubscribedNotification: AsThreadCommentSubscribedNotification? get() = if (anchor.record.type == Types.ThreadCommentSubscribedNotification) AsThreadCommentSubscribedNotification(anchor) else null
+ val asThreadCommentLikeNotification: AsThreadCommentLikeNotification? get() = if (anchor.record.type == Types.ThreadCommentLikeNotification) AsThreadCommentLikeNotification(anchor) else null
+ val asThreadLikeNotification: AsThreadLikeNotification? get() = if (anchor.record.type == Types.ThreadLikeNotification) AsThreadLikeNotification(anchor) else null
+ val asRelatedMediaAdditionNotification: AsRelatedMediaAdditionNotification? get() = if (anchor.record.type == Types.RelatedMediaAdditionNotification) AsRelatedMediaAdditionNotification(anchor) else null
+ val asMediaDataChangeNotification: AsMediaDataChangeNotification? get() = if (anchor.record.type == Types.MediaDataChangeNotification) AsMediaDataChangeNotification(anchor) else null
+ val asMediaMergeNotification: AsMediaMergeNotification? get() = if (anchor.record.type == Types.MediaMergeNotification) AsMediaMergeNotification(anchor) else null
+ val asMediaDeletionNotification: AsMediaDeletionNotification? get() = if (anchor.record.type == Types.MediaDeletionNotification) AsMediaDeletionNotification(anchor) else null
+ val asMediaSubmissionUpdateNotification: AsMediaSubmissionUpdateNotification? get() = if (anchor.record.type == Types.MediaSubmissionUpdateNotification) AsMediaSubmissionUpdateNotification(anchor) else null
+ val asStaffSubmissionUpdateNotification: AsStaffSubmissionUpdateNotification? get() = if (anchor.record.type == Types.StaffSubmissionUpdateNotification) AsStaffSubmissionUpdateNotification(anchor) else null
+ val asCharacterSubmissionUpdateNotification: AsCharacterSubmissionUpdateNotification? get() = if (anchor.record.type == Types.CharacterSubmissionUpdateNotification) AsCharacterSubmissionUpdateNotification(anchor) else null
+ override fun equals(other: Any?): Boolean = other is TestNotifications.Data.Notification2 && other.anchor == anchor
+ override fun hashCode(): Int = anchor.hashCode()
+
+ @Stable
+ class AsAiringNotification(override val anchor: Anchor) : Lens {
+ val id: String get() = anchor.requiredString(Slots.AiringNotification.id)
+ val episode: Int get() = anchor.requiredInt(Slots.AiringNotification.episode)
+ override fun equals(other: Any?): Boolean = other is TestNotifications.Data.Notification2.AsAiringNotification && other.anchor == anchor
+ override fun hashCode(): Int = anchor.hashCode()
+ }
+
+ @Stable
+ class AsFollowingNotification(override val anchor: Anchor) : Lens {
+ val id: String get() = anchor.requiredString(Slots.FollowingNotification.id)
+ val userId: String get() = anchor.requiredString(Slots.FollowingNotification.userId)
+ override fun equals(other: Any?): Boolean = other is TestNotifications.Data.Notification2.AsFollowingNotification && other.anchor == anchor
+ override fun hashCode(): Int = anchor.hashCode()
+ }
+
+ @Stable
+ class AsActivityMessageNotification(override val anchor: Anchor) : Lens {
+ val id: String get() = anchor.requiredString(Slots.ActivityMessageNotification.id)
+ val activityId: String get() = anchor.requiredString(Slots.ActivityMessageNotification.activityId)
+ override fun equals(other: Any?): Boolean = other is TestNotifications.Data.Notification2.AsActivityMessageNotification && other.anchor == anchor
+ override fun hashCode(): Int = anchor.hashCode()
+ }
+
+ @Stable
+ class AsActivityMentionNotification(override val anchor: Anchor) : Lens {
+ val id: String get() = anchor.requiredString(Slots.ActivityMentionNotification.id)
+ val activityId: String get() = anchor.requiredString(Slots.ActivityMentionNotification.activityId)
+ override fun equals(other: Any?): Boolean = other is TestNotifications.Data.Notification2.AsActivityMentionNotification && other.anchor == anchor
+ override fun hashCode(): Int = anchor.hashCode()
+ }
+
+ @Stable
+ class AsActivityReplyNotification(override val anchor: Anchor) : Lens {
+ val id: String get() = anchor.requiredString(Slots.ActivityReplyNotification.id)
+ val activityId: String get() = anchor.requiredString(Slots.ActivityReplyNotification.activityId)
+ override fun equals(other: Any?): Boolean = other is TestNotifications.Data.Notification2.AsActivityReplyNotification && other.anchor == anchor
+ override fun hashCode(): Int = anchor.hashCode()
+ }
+
+ @Stable
+ class AsActivityReplySubscribedNotification(override val anchor: Anchor) : Lens {
+ val id: String get() = anchor.requiredString(Slots.ActivityReplySubscribedNotification.id)
+ val activityId: String get() = anchor.requiredString(Slots.ActivityReplySubscribedNotification.activityId)
+ override fun equals(other: Any?): Boolean = other is TestNotifications.Data.Notification2.AsActivityReplySubscribedNotification && other.anchor == anchor
+ override fun hashCode(): Int = anchor.hashCode()
+ }
+
+ @Stable
+ class AsActivityLikeNotification(override val anchor: Anchor) : Lens {
+ val id: String get() = anchor.requiredString(Slots.ActivityLikeNotification.id)
+ val activityId: String get() = anchor.requiredString(Slots.ActivityLikeNotification.activityId)
+ override fun equals(other: Any?): Boolean = other is TestNotifications.Data.Notification2.AsActivityLikeNotification && other.anchor == anchor
+ override fun hashCode(): Int = anchor.hashCode()
+ }
+
+ @Stable
+ class AsActivityReplyLikeNotification(override val anchor: Anchor) : Lens {
+ val id: String get() = anchor.requiredString(Slots.ActivityReplyLikeNotification.id)
+ val activityId: String get() = anchor.requiredString(Slots.ActivityReplyLikeNotification.activityId)
+ override fun equals(other: Any?): Boolean = other is TestNotifications.Data.Notification2.AsActivityReplyLikeNotification && other.anchor == anchor
+ override fun hashCode(): Int = anchor.hashCode()
+ }
+
+ @Stable
+ class AsThreadCommentMentionNotification(override val anchor: Anchor) : Lens {
+ val id: String get() = anchor.requiredString(Slots.ThreadCommentMentionNotification.id)
+ val commentId: String get() = anchor.requiredString(Slots.ThreadCommentMentionNotification.commentId)
+ override fun equals(other: Any?): Boolean = other is TestNotifications.Data.Notification2.AsThreadCommentMentionNotification && other.anchor == anchor
+ override fun hashCode(): Int = anchor.hashCode()
+ }
+
+ @Stable
+ class AsThreadCommentReplyNotification(override val anchor: Anchor) : Lens {
+ val id: String get() = anchor.requiredString(Slots.ThreadCommentReplyNotification.id)
+ val commentId: String get() = anchor.requiredString(Slots.ThreadCommentReplyNotification.commentId)
+ override fun equals(other: Any?): Boolean = other is TestNotifications.Data.Notification2.AsThreadCommentReplyNotification && other.anchor == anchor
+ override fun hashCode(): Int = anchor.hashCode()
+ }
+
+ @Stable
+ class AsThreadCommentSubscribedNotification(override val anchor: Anchor) : Lens {
+ val id: String get() = anchor.requiredString(Slots.ThreadCommentSubscribedNotification.id)
+ val commentId: String get() = anchor.requiredString(Slots.ThreadCommentSubscribedNotification.commentId)
+ override fun equals(other: Any?): Boolean = other is TestNotifications.Data.Notification2.AsThreadCommentSubscribedNotification && other.anchor == anchor
+ override fun hashCode(): Int = anchor.hashCode()
+ }
+
+ @Stable
+ class AsThreadCommentLikeNotification(override val anchor: Anchor) : Lens {
+ val id: String get() = anchor.requiredString(Slots.ThreadCommentLikeNotification.id)
+ val commentId: String get() = anchor.requiredString(Slots.ThreadCommentLikeNotification.commentId)
+ override fun equals(other: Any?): Boolean = other is TestNotifications.Data.Notification2.AsThreadCommentLikeNotification && other.anchor == anchor
+ override fun hashCode(): Int = anchor.hashCode()
+ }
+
+ @Stable
+ class AsThreadLikeNotification(override val anchor: Anchor) : Lens {
+ val id: String get() = anchor.requiredString(Slots.ThreadLikeNotification.id)
+ val threadId: String get() = anchor.requiredString(Slots.ThreadLikeNotification.threadId)
+ override fun equals(other: Any?): Boolean = other is TestNotifications.Data.Notification2.AsThreadLikeNotification && other.anchor == anchor
+ override fun hashCode(): Int = anchor.hashCode()
+ }
+
+ @Stable
+ class AsRelatedMediaAdditionNotification(override val anchor: Anchor) : Lens {
+ val id: String get() = anchor.requiredString(Slots.RelatedMediaAdditionNotification.id)
+ val mediaId: String get() = anchor.requiredString(Slots.RelatedMediaAdditionNotification.mediaId)
+ override fun equals(other: Any?): Boolean = other is TestNotifications.Data.Notification2.AsRelatedMediaAdditionNotification && other.anchor == anchor
+ override fun hashCode(): Int = anchor.hashCode()
+ }
+
+ @Stable
+ class AsMediaDataChangeNotification(override val anchor: Anchor) : Lens {
+ val id: String get() = anchor.requiredString(Slots.MediaDataChangeNotification.id)
+ val reason: String? get() = anchor.string(Slots.MediaDataChangeNotification.reason)
+ override fun equals(other: Any?): Boolean = other is TestNotifications.Data.Notification2.AsMediaDataChangeNotification && other.anchor == anchor
+ override fun hashCode(): Int = anchor.hashCode()
+ }
+
+ @Stable
+ class AsMediaMergeNotification(override val anchor: Anchor) : Lens {
+ val id: String get() = anchor.requiredString(Slots.MediaMergeNotification.id)
+ val deletedMediaTitles: List? get() = anchor.nullableStrings(Slots.MediaMergeNotification.deletedMediaTitles)
+ override fun equals(other: Any?): Boolean = other is TestNotifications.Data.Notification2.AsMediaMergeNotification && other.anchor == anchor
+ override fun hashCode(): Int = anchor.hashCode()
+ }
+
+ @Stable
+ class AsMediaDeletionNotification(override val anchor: Anchor) : Lens {
+ val id: String get() = anchor.requiredString(Slots.MediaDeletionNotification.id)
+ val deletedMediaTitle: String? get() = anchor.string(Slots.MediaDeletionNotification.deletedMediaTitle)
+ override fun equals(other: Any?): Boolean = other is TestNotifications.Data.Notification2.AsMediaDeletionNotification && other.anchor == anchor
+ override fun hashCode(): Int = anchor.hashCode()
+ }
+
+ @Stable
+ class AsMediaSubmissionUpdateNotification(override val anchor: Anchor) : Lens {
+ val id: String get() = anchor.requiredString(Slots.MediaSubmissionUpdateNotification.id)
+ val status: String? get() = anchor.string(Slots.MediaSubmissionUpdateNotification.status)
+ override fun equals(other: Any?): Boolean = other is TestNotifications.Data.Notification2.AsMediaSubmissionUpdateNotification && other.anchor == anchor
+ override fun hashCode(): Int = anchor.hashCode()
+ }
+
+ @Stable
+ class AsStaffSubmissionUpdateNotification(override val anchor: Anchor) : Lens {
+ val id: String get() = anchor.requiredString(Slots.StaffSubmissionUpdateNotification.id)
+ val status: String? get() = anchor.string(Slots.StaffSubmissionUpdateNotification.status)
+ override fun equals(other: Any?): Boolean = other is TestNotifications.Data.Notification2.AsStaffSubmissionUpdateNotification && other.anchor == anchor
+ override fun hashCode(): Int = anchor.hashCode()
+ }
+
+ @Stable
+ class AsCharacterSubmissionUpdateNotification(override val anchor: Anchor) : Lens {
+ val id: String get() = anchor.requiredString(Slots.CharacterSubmissionUpdateNotification.id)
+ val status: String? get() = anchor.string(Slots.CharacterSubmissionUpdateNotification.status)
+ override fun equals(other: Any?): Boolean = other is TestNotifications.Data.Notification2.AsCharacterSubmissionUpdateNotification && other.anchor == anchor
+ override fun hashCode(): Int = anchor.hashCode()
+ }
+ }
+ }
+}
+
+private object `TestNotifications-plan` {
+ val selection0: Selection by lazy {
+ Selection(type = Types.Query, key = listOf(), isAbstract = false, fields = listOf(
+ PlanField.linked("Notification", key = StorageKey.Fixed(Slots.Query.Notification), plural = true, selection = selection1),
+ ))
+ }
+ val selection1: Selection by lazy {
+ Selection(type = Types.NotificationUnion, key = listOf("id"), isAbstract = true, variants = listOf(
+ Selection.Variant(types = listOf(Types.ActivityLikeNotification, Types.ActivityMentionNotification, Types.ActivityMessageNotification, Types.ActivityReplyLikeNotification, Types.ActivityReplyNotification, Types.ActivityReplySubscribedNotification), key = listOf("id"), fields = listOf(
+ PlanField.scalar("__typename", key = StorageKey.Fixed(Slots.NotificationUnion.__typename), kind = ScalarKind.STRING, list = false),
+ PlanField.scalar("id", key = StorageKey.Fixed(Slots.NotificationUnion.id), kind = ScalarKind.STRING, list = false),
+ PlanField.scalar("activityId", key = StorageKey.Fixed(Slots.NotificationUnion.activityId), kind = ScalarKind.STRING, list = false),
+ )),
+ Selection.Variant(types = listOf(Types.AiringNotification), key = listOf("id"), fields = listOf(
+ PlanField.scalar("__typename", key = StorageKey.Fixed(Slots.AiringNotification.__typename), kind = ScalarKind.STRING, list = false),
+ PlanField.scalar("id", key = StorageKey.Fixed(Slots.AiringNotification.id), kind = ScalarKind.STRING, list = false),
+ PlanField.scalar("episode", key = StorageKey.Fixed(Slots.AiringNotification.episode), kind = ScalarKind.INT, list = false),
+ )),
+ Selection.Variant(types = listOf(Types.CharacterSubmissionUpdateNotification, Types.MediaSubmissionUpdateNotification, Types.StaffSubmissionUpdateNotification), key = listOf("id"), fields = listOf(
+ PlanField.scalar("__typename", key = StorageKey.Fixed(Slots.NotificationUnion.__typename), kind = ScalarKind.STRING, list = false),
+ PlanField.scalar("id", key = StorageKey.Fixed(Slots.NotificationUnion.id), kind = ScalarKind.STRING, list = false),
+ PlanField.scalar("status", key = StorageKey.Fixed(Slots.NotificationUnion.status), kind = ScalarKind.STRING, list = false),
+ )),
+ Selection.Variant(types = listOf(Types.FollowingNotification), key = listOf("id"), fields = listOf(
+ PlanField.scalar("__typename", key = StorageKey.Fixed(Slots.FollowingNotification.__typename), kind = ScalarKind.STRING, list = false),
+ PlanField.scalar("id", key = StorageKey.Fixed(Slots.FollowingNotification.id), kind = ScalarKind.STRING, list = false),
+ PlanField.scalar("userId", key = StorageKey.Fixed(Slots.FollowingNotification.userId), kind = ScalarKind.STRING, list = false),
+ )),
+ Selection.Variant(types = listOf(Types.MediaDataChangeNotification), key = listOf("id"), fields = listOf(
+ PlanField.scalar("__typename", key = StorageKey.Fixed(Slots.MediaDataChangeNotification.__typename), kind = ScalarKind.STRING, list = false),
+ PlanField.scalar("id", key = StorageKey.Fixed(Slots.MediaDataChangeNotification.id), kind = ScalarKind.STRING, list = false),
+ PlanField.scalar("reason", key = StorageKey.Fixed(Slots.MediaDataChangeNotification.reason), kind = ScalarKind.STRING, list = false),
+ )),
+ Selection.Variant(types = listOf(Types.MediaDeletionNotification), key = listOf("id"), fields = listOf(
+ PlanField.scalar("__typename", key = StorageKey.Fixed(Slots.MediaDeletionNotification.__typename), kind = ScalarKind.STRING, list = false),
+ PlanField.scalar("id", key = StorageKey.Fixed(Slots.MediaDeletionNotification.id), kind = ScalarKind.STRING, list = false),
+ PlanField.scalar("deletedMediaTitle", key = StorageKey.Fixed(Slots.MediaDeletionNotification.deletedMediaTitle), kind = ScalarKind.STRING, list = false),
+ )),
+ Selection.Variant(types = listOf(Types.MediaMergeNotification), key = listOf("id"), fields = listOf(
+ PlanField.scalar("__typename", key = StorageKey.Fixed(Slots.MediaMergeNotification.__typename), kind = ScalarKind.STRING, list = false),
+ PlanField.scalar("id", key = StorageKey.Fixed(Slots.MediaMergeNotification.id), kind = ScalarKind.STRING, list = false),
+ PlanField.scalar("deletedMediaTitles", key = StorageKey.Fixed(Slots.MediaMergeNotification.deletedMediaTitles), kind = ScalarKind.STRING, list = true),
+ )),
+ Selection.Variant(types = listOf(Types.RelatedMediaAdditionNotification), key = listOf("id"), fields = listOf(
+ PlanField.scalar("__typename", key = StorageKey.Fixed(Slots.RelatedMediaAdditionNotification.__typename), kind = ScalarKind.STRING, list = false),
+ PlanField.scalar("id", key = StorageKey.Fixed(Slots.RelatedMediaAdditionNotification.id), kind = ScalarKind.STRING, list = false),
+ PlanField.scalar("mediaId", key = StorageKey.Fixed(Slots.RelatedMediaAdditionNotification.mediaId), kind = ScalarKind.STRING, list = false),
+ )),
+ Selection.Variant(types = listOf(Types.ThreadCommentLikeNotification, Types.ThreadCommentMentionNotification, Types.ThreadCommentReplyNotification, Types.ThreadCommentSubscribedNotification), key = listOf("id"), fields = listOf(
+ PlanField.scalar("__typename", key = StorageKey.Fixed(Slots.NotificationUnion.__typename), kind = ScalarKind.STRING, list = false),
+ PlanField.scalar("id", key = StorageKey.Fixed(Slots.NotificationUnion.id), kind = ScalarKind.STRING, list = false),
+ PlanField.scalar("commentId", key = StorageKey.Fixed(Slots.NotificationUnion.commentId), kind = ScalarKind.STRING, list = false),
+ )),
+ Selection.Variant(types = listOf(Types.ThreadLikeNotification), key = listOf("id"), fields = listOf(
+ PlanField.scalar("__typename", key = StorageKey.Fixed(Slots.ThreadLikeNotification.__typename), kind = ScalarKind.STRING, list = false),
+ PlanField.scalar("id", key = StorageKey.Fixed(Slots.ThreadLikeNotification.id), kind = ScalarKind.STRING, list = false),
+ PlanField.scalar("threadId", key = StorageKey.Fixed(Slots.ThreadLikeNotification.threadId), kind = ScalarKind.STRING, list = false),
+ )),
+ Selection.Variant(types = null, fields = listOf(
+ PlanField.scalar("__typename", key = StorageKey.Fixed(Slots.NotificationUnion.__typename), kind = ScalarKind.STRING, list = false),
+ )),
+ ))
+ }
+}
+
/** Operation value for `query TestStrictConditions`. */
@Immutable
class TestStrictConditions(val id: String, val withStatus: Boolean) : QueryOperation {
diff --git a/compiler/src/tests/goldens-kotlin/EnumDocuments.baton.kt b/compiler/src/tests/goldens-kotlin/EnumDocuments.baton.kt
index e8330dcc..7d03cecf 100644
--- a/compiler/src/tests/goldens-kotlin/EnumDocuments.baton.kt
+++ b/compiler/src/tests/goldens-kotlin/EnumDocuments.baton.kt
@@ -9,6 +9,7 @@ import baton.Anchor
import baton.Document
import baton.Generated
import baton.Lens
+import baton.Lookup
import baton.MutationAction
import baton.MutationOperation
import baton.MutationType
@@ -73,6 +74,57 @@ private object `TestCharactersWithStatus-plan` {
}
}
+/** Operation value for `query TestEpisodeStatus`. */
+@Immutable
+class TestEpisodeStatus(val id: String) : QueryOperation {
+ override val variables: Variables
+ get() = Variables.of("id" to Variable.of(id))
+ override val type: OperationType get() = Companion
+
+ override fun equals(other: Any?): Boolean = other is TestEpisodeStatus && other.id == id
+ override fun hashCode(): Int = listOf(id).hashCode()
+
+ companion object : QueryType {
+ override val name = "TestEpisodeStatus"
+ override val document: Document = Document.Text("query TestEpisodeStatus(\$id:ID!){episode(id:\$id){id,status,hiatus:status(version:2)}}")
+ override val kind = OperationKind.QUERY
+ override val plan: Plan by lazy { Plan(root = `TestEpisodeStatus-plan`.selection0, transient = Types.transient) }
+
+ override fun data(anchor: Anchor): Data = Data(anchor)
+ }
+
+ @Stable
+ class Data(override val anchor: Anchor) : Lens {
+ val episode: Episode? get() = anchor.linked(anchor.owner.slot(Slots.Query.episode_7d0060))?.let(::Episode)
+ override fun equals(other: Any?): Boolean = other is TestEpisodeStatus.Data && other.anchor == anchor
+ override fun hashCode(): Int = anchor.hashCode()
+
+ @Stable
+ class Episode(override val anchor: Anchor) : Lens {
+ val id: String? get() = anchor.string(Slots.Episode.id)
+ val status: EpisodeStatus? get() = anchor.enumValue(Slots.Episode.status, EpisodeStatus::of)
+ val hiatus: EpisodeStatus? get() = anchor.enumValue(Slots.Episode.status_98c3c3, EpisodeStatus::of)
+ override fun equals(other: Any?): Boolean = other is TestEpisodeStatus.Data.Episode && other.anchor == anchor
+ override fun hashCode(): Int = anchor.hashCode()
+ }
+ }
+}
+
+private object `TestEpisodeStatus-plan` {
+ val selection0: Selection by lazy {
+ Selection(type = Types.Query, key = listOf(), isAbstract = false, fields = listOf(
+ PlanField.linked("episode", key = StorageKey.Dynamic(Slots.Query.episode_7d0060), plural = false, lookup = Lookup(type = Types.Episode, key = listOf(Lookup.Key.Variable("id"))), selection = selection1),
+ ))
+ }
+ val selection1: Selection by lazy {
+ Selection(type = Types.Episode, key = listOf("id"), isAbstract = false, fields = listOf(
+ PlanField.scalar("id", key = StorageKey.Fixed(Slots.Episode.id), kind = ScalarKind.STRING, list = false),
+ PlanField.scalar("status", key = StorageKey.Fixed(Slots.Episode.status), kind = ScalarKind.STRING, list = false),
+ PlanField.scalar("hiatus", key = StorageKey.Fixed(Slots.Episode.status_98c3c3), kind = ScalarKind.STRING, list = false),
+ ))
+ }
+}
+
/** Operation value for `mutation TestSetStatuses`. */
@Immutable
class TestSetStatuses : MutationOperation {
diff --git a/compiler/src/tests/goldens-kotlin/NameDocuments.baton.kt b/compiler/src/tests/goldens-kotlin/NameDocuments.baton.kt
index 002eecf6..0017166d 100644
--- a/compiler/src/tests/goldens-kotlin/NameDocuments.baton.kt
+++ b/compiler/src/tests/goldens-kotlin/NameDocuments.baton.kt
@@ -19,8 +19,95 @@ import baton.QueryType
import baton.ScalarKind
import baton.Selection
import baton.StorageKey
+import baton.Variable
import baton.Variables
+/** Operation value for `query TestCapitalizedRoots`. */
+@Immutable
+class TestCapitalizedRoots(val id: String) : QueryOperation {
+ override val variables: Variables
+ get() = Variables.of("id" to Variable.of(id))
+ override val type: OperationType get() = Companion
+
+ override fun equals(other: Any?): Boolean = other is TestCapitalizedRoots && other.id == id
+ override fun hashCode(): Int = listOf(id).hashCode()
+
+ companion object : QueryType {
+ override val name = "TestCapitalizedRoots"
+ override val document: Document = Document.Text("query TestCapitalizedRoots(\$id:ID!){Episode(id:\$id){id,name},Viewer{id,name},GenreCollection,Notification{__typename,...on ActivityLikeNotification{id},...on ActivityMentionNotification{id},...on ActivityMessageNotification{id},...on ActivityReplyLikeNotification{id},...on ActivityReplyNotification{id},...on ActivityReplySubscribedNotification{id},...on AiringNotification{id},...on CharacterSubmissionUpdateNotification{id},...on FollowingNotification{id},...on MediaDataChangeNotification{id},...on MediaDeletionNotification{id},...on MediaMergeNotification{id},...on MediaSubmissionUpdateNotification{id},...on RelatedMediaAdditionNotification{id},...on StaffSubmissionUpdateNotification{id},...on ThreadCommentLikeNotification{id},...on ThreadCommentMentionNotification{id},...on ThreadCommentReplyNotification{id},...on ThreadCommentSubscribedNotification{id},...on ThreadLikeNotification{id}}}")
+ override val kind = OperationKind.QUERY
+ override val plan: Plan by lazy { Plan(root = `TestCapitalizedRoots-plan`.selection0, transient = Types.transient) }
+
+ override fun data(anchor: Anchor): Data = Data(anchor)
+ }
+
+ @Stable
+ class Data(override val anchor: Anchor) : Lens {
+ val Episode: Episode2? get() = anchor.linked(anchor.owner.slot(Slots.Query.Episode_9e33c8))?.let(::Episode2)
+ val Viewer: Viewer2? get() = anchor.linked(Slots.Query.Viewer)?.let(::Viewer2)
+ val GenreCollection: List? get() = anchor.nullableStrings(Slots.Query.GenreCollection)
+ val Notification: List? get() = anchor.list(Slots.Query.Notification, ::Notification2)
+ override fun equals(other: Any?): Boolean = other is TestCapitalizedRoots.Data && other.anchor == anchor
+ override fun hashCode(): Int = anchor.hashCode()
+
+ @Stable
+ class Episode2(override val anchor: Anchor) : Lens {
+ val id: String? get() = anchor.string(Slots.Episode.id)
+ val name: String? get() = anchor.string(Slots.Episode.name)
+ override fun equals(other: Any?): Boolean = other is TestCapitalizedRoots.Data.Episode2 && other.anchor == anchor
+ override fun hashCode(): Int = anchor.hashCode()
+ }
+
+ @Stable
+ class Viewer2(override val anchor: Anchor) : Lens {
+ val id: String? get() = anchor.string(Slots.Character.id)
+ val name: String? get() = anchor.string(Slots.Character.name)
+ override fun equals(other: Any?): Boolean = other is TestCapitalizedRoots.Data.Viewer2 && other.anchor == anchor
+ override fun hashCode(): Int = anchor.hashCode()
+ }
+
+ @Stable
+ class Notification2(override val anchor: Anchor) : Lens {
+ override fun equals(other: Any?): Boolean = other is TestCapitalizedRoots.Data.Notification2 && other.anchor == anchor
+ override fun hashCode(): Int = anchor.hashCode()
+ }
+ }
+}
+
+private object `TestCapitalizedRoots-plan` {
+ val selection0: Selection by lazy {
+ Selection(type = Types.Query, key = listOf(), isAbstract = false, fields = listOf(
+ PlanField.linked("Episode", key = StorageKey.Dynamic(Slots.Query.Episode_9e33c8), plural = false, selection = selection3),
+ PlanField.linked("Viewer", key = StorageKey.Fixed(Slots.Query.Viewer), plural = false, selection = selection2),
+ PlanField.scalar("GenreCollection", key = StorageKey.Fixed(Slots.Query.GenreCollection), kind = ScalarKind.STRING, list = true),
+ PlanField.linked("Notification", key = StorageKey.Fixed(Slots.Query.Notification), plural = true, selection = selection1),
+ ))
+ }
+ val selection1: Selection by lazy {
+ Selection(type = Types.NotificationUnion, key = listOf("id"), isAbstract = true, variants = listOf(
+ Selection.Variant(types = listOf(Types.ActivityLikeNotification, Types.ActivityMentionNotification, Types.ActivityMessageNotification, Types.ActivityReplyLikeNotification, Types.ActivityReplyNotification, Types.ActivityReplySubscribedNotification, Types.AiringNotification, Types.CharacterSubmissionUpdateNotification, Types.FollowingNotification, Types.MediaDataChangeNotification, Types.MediaDeletionNotification, Types.MediaMergeNotification, Types.MediaSubmissionUpdateNotification, Types.RelatedMediaAdditionNotification, Types.StaffSubmissionUpdateNotification, Types.ThreadCommentLikeNotification, Types.ThreadCommentMentionNotification, Types.ThreadCommentReplyNotification, Types.ThreadCommentSubscribedNotification, Types.ThreadLikeNotification), key = listOf("id"), fields = listOf(
+ PlanField.scalar("__typename", key = StorageKey.Fixed(Slots.NotificationUnion.__typename), kind = ScalarKind.STRING, list = false),
+ PlanField.scalar("id", key = StorageKey.Fixed(Slots.NotificationUnion.id), kind = ScalarKind.STRING, list = false),
+ )),
+ Selection.Variant(types = null, fields = listOf(
+ PlanField.scalar("__typename", key = StorageKey.Fixed(Slots.NotificationUnion.__typename), kind = ScalarKind.STRING, list = false),
+ )),
+ ))
+ }
+ val selection2: Selection by lazy {
+ Selection(type = Types.Character, key = listOf("id"), isAbstract = false, fields = listOf(
+ PlanField.scalar("id", key = StorageKey.Fixed(Slots.Character.id), kind = ScalarKind.STRING, list = false),
+ PlanField.scalar("name", key = StorageKey.Fixed(Slots.Character.name), kind = ScalarKind.STRING, list = false),
+ ))
+ }
+ val selection3: Selection by lazy {
+ Selection(type = Types.Episode, key = listOf("id"), isAbstract = false, fields = listOf(
+ PlanField.scalar("id", key = StorageKey.Fixed(Slots.Episode.id), kind = ScalarKind.STRING, list = false),
+ PlanField.scalar("name", key = StorageKey.Fixed(Slots.Episode.name), kind = ScalarKind.STRING, list = false),
+ ))
+ }
+}
+
/** Operation value for `query TestCaughtNames`. */
@Immutable
class TestCaughtNames : QueryOperation {
diff --git a/compiler/src/tests/goldens/Baton.baton.swift b/compiler/src/tests/goldens/Baton.baton.swift
index ea0bbdbe..bbaf9563 100644
--- a/compiler/src/tests/goldens/Baton.baton.swift
+++ b/compiler/src/tests/goldens/Baton.baton.swift
@@ -6,23 +6,36 @@ import Foundation
nonisolated enum Types {
/// The schema's digest: pass it as the image's `version`, so an image
/// written under another schema starts again.
- static let schemaDigest = "5beaef3e41ff4dcf1169e9ba839e88cc"
+ static let schemaDigest = "05a112649a1212d03abe827e91364544"
/// The format of this generated code, which the runtime that reads it
/// declares; a runtime of another format fails to compile this line.
static let format = Baton.Format20.self
+ static let ActivityLikeNotification = Baton.Registry.type("ActivityLikeNotification")
+ static let ActivityMentionNotification = Baton.Registry.type("ActivityMentionNotification")
+ static let ActivityMessageNotification = Baton.Registry.type("ActivityMessageNotification")
+ static let ActivityReplyLikeNotification = Baton.Registry.type("ActivityReplyLikeNotification")
+ static let ActivityReplyNotification = Baton.Registry.type("ActivityReplyNotification")
+ static let ActivityReplySubscribedNotification = Baton.Registry.type("ActivityReplySubscribedNotification")
static let AddNotePayload = Baton.Registry.type("AddNotePayload")
+ static let AiringNotification = Baton.Registry.type("AiringNotification")
static let Any_ = Baton.Registry.type("Any")
static let Asset = Baton.Registry.type("Asset")
static let Baton_ = Baton.Registry.type("Baton")
static let Character = Baton.Registry.type("Character")
+ static let CharacterSubmissionUpdateNotification = Baton.Registry.type("CharacterSubmissionUpdateNotification")
static let Characters = Baton.Registry.type("Characters")
static let Deleted = Baton.Registry.type("Deleted")
static let Draft = Baton.Registry.type("Draft")
static let Episode = Baton.Registry.type("Episode")
static let FavoritePayload = Baton.Registry.type("FavoritePayload")
+ static let FollowingNotification = Baton.Registry.type("FollowingNotification")
static let Info = Baton.Registry.type("Info")
static let ListsPayload = Baton.Registry.type("ListsPayload")
static let Location = Baton.Registry.type("Location")
+ static let MediaDataChangeNotification = Baton.Registry.type("MediaDataChangeNotification")
+ static let MediaDeletionNotification = Baton.Registry.type("MediaDeletionNotification")
+ static let MediaMergeNotification = Baton.Registry.type("MediaMergeNotification")
+ static let MediaSubmissionUpdateNotification = Baton.Registry.type("MediaSubmissionUpdateNotification")
static let Mutation = Baton.Registry.type("Mutation")
static let Named = Baton.Registry.type("Named")
static let Node = Baton.Registry.type("Node")
@@ -30,17 +43,25 @@ nonisolated enum Types {
static let NoteAddedPayload = Baton.Registry.type("NoteAddedPayload")
static let NoteConnection = Baton.Registry.type("NoteConnection")
static let NoteEdge = Baton.Registry.type("NoteEdge")
+ static let NotificationUnion = Baton.Registry.type("NotificationUnion")
static let PageInfo = Baton.Registry.type("PageInfo")
static let Protocol_ = Baton.Registry.type("Protocol")
static let Query = Baton.Registry.type("Query")
static let Quote = Baton.Registry.type("Quote")
+ static let RelatedMediaAdditionNotification = Baton.Registry.type("RelatedMediaAdditionNotification")
static let RemoveNotePayload = Baton.Registry.type("RemoveNotePayload")
static let SearchResult = Baton.Registry.type("SearchResult")
static let Secret = Baton.Registry.type("Secret", transient: true)
static let Set = Baton.Registry.type("Set")
static let Spelled = Baton.Registry.type("Spelled")
static let Spelling = Baton.Registry.type("Spelling")
+ static let StaffSubmissionUpdateNotification = Baton.Registry.type("StaffSubmissionUpdateNotification")
static let Subscription = Baton.Registry.type("Subscription")
+ static let ThreadCommentLikeNotification = Baton.Registry.type("ThreadCommentLikeNotification")
+ static let ThreadCommentMentionNotification = Baton.Registry.type("ThreadCommentMentionNotification")
+ static let ThreadCommentReplyNotification = Baton.Registry.type("ThreadCommentReplyNotification")
+ static let ThreadCommentSubscribedNotification = Baton.Registry.type("ThreadCommentSubscribedNotification")
+ static let ThreadLikeNotification = Baton.Registry.type("ThreadLikeNotification")
static let Tokenizer = Baton.Registry.type("Tokenizer")
static let Type_ = Baton.Registry.type("Type")
static let Types = Baton.Registry.type("Types")
@@ -56,10 +77,39 @@ nonisolated enum Types {
/// Interned storage keys used by this module's documents.
nonisolated enum Slots {
+ nonisolated enum ActivityLikeNotification {
+ static let activityId = Baton.Registry.slot(Types.ActivityLikeNotification, "activityId")
+ static let id = Baton.Registry.slot(Types.ActivityLikeNotification, "id")
+ }
+ nonisolated enum ActivityMentionNotification {
+ static let activityId = Baton.Registry.slot(Types.ActivityMentionNotification, "activityId")
+ static let id = Baton.Registry.slot(Types.ActivityMentionNotification, "id")
+ }
+ nonisolated enum ActivityMessageNotification {
+ static let activityId = Baton.Registry.slot(Types.ActivityMessageNotification, "activityId")
+ static let id = Baton.Registry.slot(Types.ActivityMessageNotification, "id")
+ }
+ nonisolated enum ActivityReplyLikeNotification {
+ static let activityId = Baton.Registry.slot(Types.ActivityReplyLikeNotification, "activityId")
+ static let id = Baton.Registry.slot(Types.ActivityReplyLikeNotification, "id")
+ }
+ nonisolated enum ActivityReplyNotification {
+ static let activityId = Baton.Registry.slot(Types.ActivityReplyNotification, "activityId")
+ static let id = Baton.Registry.slot(Types.ActivityReplyNotification, "id")
+ }
+ nonisolated enum ActivityReplySubscribedNotification {
+ static let activityId = Baton.Registry.slot(Types.ActivityReplySubscribedNotification, "activityId")
+ static let id = Baton.Registry.slot(Types.ActivityReplySubscribedNotification, "id")
+ }
nonisolated enum AddNotePayload {
static let note = Baton.Registry.slot(Types.AddNotePayload, "note")
static let noteEdge = Baton.Registry.slot(Types.AddNotePayload, "noteEdge")
}
+ nonisolated enum AiringNotification {
+ static let __typename = Baton.Registry.slot(Types.AiringNotification, "__typename")
+ static let episode = Baton.Registry.slot(Types.AiringNotification, "episode")
+ static let id = Baton.Registry.slot(Types.AiringNotification, "id")
+ }
nonisolated enum Any_ {
static let id = Baton.Registry.slot(Types.Any_, "id")
static let label = Baton.Registry.slot(Types.Any_, "label")
@@ -118,6 +168,10 @@ nonisolated enum Slots {
static let status = Baton.Registry.slot(Types.Character, "status")
static let type = Baton.Registry.slot(Types.Character, "type")
}
+ nonisolated enum CharacterSubmissionUpdateNotification {
+ static let id = Baton.Registry.slot(Types.CharacterSubmissionUpdateNotification, "id")
+ static let status = Baton.Registry.slot(Types.CharacterSubmissionUpdateNotification, "status")
+ }
nonisolated enum Characters {
static let info = Baton.Registry.slot(Types.Characters, "info")
static let results = Baton.Registry.slot(Types.Characters, "results")
@@ -138,10 +192,17 @@ nonisolated enum Slots {
static let episode = Baton.Registry.slot(Types.Episode, "episode")
static let id = Baton.Registry.slot(Types.Episode, "id")
static let name = Baton.Registry.slot(Types.Episode, "name")
+ static let status = Baton.Registry.slot(Types.Episode, "status")
+ static let status_98c3c3 = Baton.Registry.slot(Types.Episode, "status(version:2)")
}
nonisolated enum FavoritePayload {
static let character = Baton.Registry.slot(Types.FavoritePayload, "character")
}
+ nonisolated enum FollowingNotification {
+ static let __typename = Baton.Registry.slot(Types.FollowingNotification, "__typename")
+ static let id = Baton.Registry.slot(Types.FollowingNotification, "id")
+ static let userId = Baton.Registry.slot(Types.FollowingNotification, "userId")
+ }
nonisolated enum Info {
static let count = Baton.Registry.slot(Types.Info, "count")
static let next = Baton.Registry.slot(Types.Info, "next")
@@ -165,6 +226,25 @@ nonisolated enum Slots {
static let name = Baton.Registry.slot(Types.Location, "name")
static let type = Baton.Registry.slot(Types.Location, "type")
}
+ nonisolated enum MediaDataChangeNotification {
+ static let __typename = Baton.Registry.slot(Types.MediaDataChangeNotification, "__typename")
+ static let id = Baton.Registry.slot(Types.MediaDataChangeNotification, "id")
+ static let reason = Baton.Registry.slot(Types.MediaDataChangeNotification, "reason")
+ }
+ nonisolated enum MediaDeletionNotification {
+ static let __typename = Baton.Registry.slot(Types.MediaDeletionNotification, "__typename")
+ static let deletedMediaTitle = Baton.Registry.slot(Types.MediaDeletionNotification, "deletedMediaTitle")
+ static let id = Baton.Registry.slot(Types.MediaDeletionNotification, "id")
+ }
+ nonisolated enum MediaMergeNotification {
+ static let __typename = Baton.Registry.slot(Types.MediaMergeNotification, "__typename")
+ static let deletedMediaTitles = Baton.Registry.slot(Types.MediaMergeNotification, "deletedMediaTitles")
+ static let id = Baton.Registry.slot(Types.MediaMergeNotification, "id")
+ }
+ nonisolated enum MediaSubmissionUpdateNotification {
+ static let id = Baton.Registry.slot(Types.MediaSubmissionUpdateNotification, "id")
+ static let status = Baton.Registry.slot(Types.MediaSubmissionUpdateNotification, "status")
+ }
nonisolated enum Mutation {
static let addNote = Baton.Registry.slot(Types.Mutation, "addNote")
static let discardAsset = Baton.Registry.slot(Types.Mutation, "discardAsset")
@@ -206,6 +286,13 @@ nonisolated enum Slots {
static let cursor = Baton.Registry.slot(Types.NoteEdge, "cursor")
static let node = Baton.Registry.slot(Types.NoteEdge, "node")
}
+ nonisolated enum NotificationUnion {
+ static let __typename = Baton.Registry.slot(Types.NotificationUnion, "__typename")
+ static let activityId = Baton.Registry.slot(Types.NotificationUnion, "activityId")
+ static let commentId = Baton.Registry.slot(Types.NotificationUnion, "commentId")
+ static let id = Baton.Registry.slot(Types.NotificationUnion, "id")
+ static let status = Baton.Registry.slot(Types.NotificationUnion, "status")
+ }
nonisolated enum PageInfo {
static let endCursor = Baton.Registry.slot(Types.PageInfo, "endCursor")
static let hasNextPage = Baton.Registry.slot(Types.PageInfo, "hasNextPage")
@@ -217,6 +304,10 @@ nonisolated enum Slots {
static let label = Baton.Registry.slot(Types.Protocol_, "label")
}
nonisolated enum Query {
+ static let Episode_9e33c8 = Baton.DynamicKey(Types.Query, "Episode", [Baton.KeyArgument("id", [.variable("id")])])
+ static let GenreCollection = Baton.Registry.slot(Types.Query, "GenreCollection")
+ static let Notification = Baton.Registry.slot(Types.Query, "Notification")
+ static let Viewer = Baton.Registry.slot(Types.Query, "Viewer")
static let __TestRootNotes_notes_connection = Baton.Registry.slot(Types.Query, "__TestRootNotes_notes_connection")
static let asset_9e39ed = Baton.DynamicKey(Types.Query, "asset", [Baton.KeyArgument("uuid", [.variable("uuid")])])
static let assets = Baton.Registry.slot(Types.Query, "assets")
@@ -239,6 +330,7 @@ nonisolated enum Slots {
static let charactersMatching_ca82bd = Baton.DynamicKey(Types.Query, "charactersMatching", [Baton.KeyArgument("filters", [.variable("filters")])])
static let charactersWithStatus_deb51f = Baton.DynamicKey(Types.Query, "charactersWithStatus", [Baton.KeyArgument("any", [.variable("any")]), Baton.KeyArgument("status", [.variable("status")])])
static let drafts = Baton.Registry.clientSlot(Types.Query, "drafts")
+ static let episode_7d0060 = Baton.DynamicKey(Types.Query, "episode", [Baton.KeyArgument("id", [.variable("id")])])
static let namesake_9b6471 = Baton.DynamicKey(Types.Query, "namesake", [Baton.KeyArgument("name", [.variable("name")])])
static let node_8f7d08 = Baton.DynamicKey(Types.Query, "node", [Baton.KeyArgument("id", [.variable("id")])])
static let node_c27cc2 = Baton.Registry.slot(Types.Query, "node(id:1)")
@@ -260,6 +352,11 @@ nonisolated enum Slots {
static let quote = Baton.Registry.slot(Types.Quote, "quote")
static let rate = Baton.Registry.slot(Types.Quote, "rate")
}
+ nonisolated enum RelatedMediaAdditionNotification {
+ static let __typename = Baton.Registry.slot(Types.RelatedMediaAdditionNotification, "__typename")
+ static let id = Baton.Registry.slot(Types.RelatedMediaAdditionNotification, "id")
+ static let mediaId = Baton.Registry.slot(Types.RelatedMediaAdditionNotification, "mediaId")
+ }
nonisolated enum RemoveNotePayload {
static let removedNoteId = Baton.Registry.slot(Types.RemoveNotePayload, "removedNoteId")
}
@@ -281,10 +378,35 @@ nonisolated enum Slots {
static let id = Baton.Registry.slot(Types.Spelling, "id")
static let label = Baton.Registry.slot(Types.Spelling, "label")
}
+ nonisolated enum StaffSubmissionUpdateNotification {
+ static let id = Baton.Registry.slot(Types.StaffSubmissionUpdateNotification, "id")
+ static let status = Baton.Registry.slot(Types.StaffSubmissionUpdateNotification, "status")
+ }
nonisolated enum Subscription {
static let noteAdded_cab094 = Baton.Registry.slot(Types.Subscription, "noteAdded(characterId:\"1\")")
static let noteAdded_5f458b = Baton.DynamicKey(Types.Subscription, "noteAdded", [Baton.KeyArgument("characterId", [.variable("characterId")])])
}
+ nonisolated enum ThreadCommentLikeNotification {
+ static let commentId = Baton.Registry.slot(Types.ThreadCommentLikeNotification, "commentId")
+ static let id = Baton.Registry.slot(Types.ThreadCommentLikeNotification, "id")
+ }
+ nonisolated enum ThreadCommentMentionNotification {
+ static let commentId = Baton.Registry.slot(Types.ThreadCommentMentionNotification, "commentId")
+ static let id = Baton.Registry.slot(Types.ThreadCommentMentionNotification, "id")
+ }
+ nonisolated enum ThreadCommentReplyNotification {
+ static let commentId = Baton.Registry.slot(Types.ThreadCommentReplyNotification, "commentId")
+ static let id = Baton.Registry.slot(Types.ThreadCommentReplyNotification, "id")
+ }
+ nonisolated enum ThreadCommentSubscribedNotification {
+ static let commentId = Baton.Registry.slot(Types.ThreadCommentSubscribedNotification, "commentId")
+ static let id = Baton.Registry.slot(Types.ThreadCommentSubscribedNotification, "id")
+ }
+ nonisolated enum ThreadLikeNotification {
+ static let __typename = Baton.Registry.slot(Types.ThreadLikeNotification, "__typename")
+ static let id = Baton.Registry.slot(Types.ThreadLikeNotification, "id")
+ static let threadId = Baton.Registry.slot(Types.ThreadLikeNotification, "threadId")
+ }
nonisolated enum Tokenizer {
static let count = Baton.Registry.slot(Types.Tokenizer, "count")
static let counts = Baton.Registry.slot(Types.Tokenizer, "counts")
@@ -498,6 +620,38 @@ nonisolated enum Sites {
static let TestTwoScopes_testNotes_2 = Baton.ArgumentSite()
}
+/// The schema's enum `EpisodeStatus`. A value this build does not know reads as `unknown`, with its text.
+nonisolated public enum EpisodeStatus: Baton.GeneratedEnum {
+ case FINISHED
+ case RELEASING
+ case NOT_YET_RELEASED
+ case CANCELLED
+ case HIATUS
+ case unknown(String)
+
+ public init(enumText: String) {
+ self = switch enumText {
+ case "FINISHED": .FINISHED
+ case "RELEASING": .RELEASING
+ case "NOT_YET_RELEASED": .NOT_YET_RELEASED
+ case "CANCELLED": .CANCELLED
+ case "HIATUS": .HIATUS
+ default: .unknown(enumText)
+ }
+ }
+
+ public var scalarText: String {
+ switch self {
+ case .FINISHED: "FINISHED"
+ case .RELEASING: "RELEASING"
+ case .NOT_YET_RELEASED: "NOT_YET_RELEASED"
+ case .CANCELLED: "CANCELLED"
+ case .HIATUS: "HIATUS"
+ case .unknown(let text): text
+ }
+ }
+}
+
/// The schema's enum `Status`. A value this build does not know reads as `unknown`, with its text.
nonisolated public enum Status: Baton.GeneratedEnum {
case ALIVE
diff --git a/compiler/src/tests/goldens/ConditionDocuments.baton.swift b/compiler/src/tests/goldens/ConditionDocuments.baton.swift
index 8930db3e..0e7fdea7 100644
--- a/compiler/src/tests/goldens/ConditionDocuments.baton.swift
+++ b/compiler/src/tests/goldens/ConditionDocuments.baton.swift
@@ -338,6 +338,259 @@ nonisolated public struct TestNodeFields: Baton.Query {
}
}
+/// Operation value for `query TestNotifications`.
+nonisolated public struct TestNotifications: Baton.Query {
+ @_spi(Generated) public var resolution: Baton.Resolution> = .unresolved
+
+ public init() {
+ }
+
+ public static let name = "TestNotifications"
+ public static let document: Baton.Document = .text(#"query TestNotifications{Notification{__typename,...on AiringNotification{id,episode},...on FollowingNotification{id,userId},...on ActivityMessageNotification{id,activityId},...on ActivityMentionNotification{id,activityId},...on ActivityReplyNotification{id,activityId},...on ActivityReplySubscribedNotification{id,activityId},...on ActivityLikeNotification{id,activityId},...on ActivityReplyLikeNotification{id,activityId},...on ThreadCommentMentionNotification{id,commentId},...on ThreadCommentReplyNotification{id,commentId},...on ThreadCommentSubscribedNotification{id,commentId},...on ThreadCommentLikeNotification{id,commentId},...on ThreadLikeNotification{id,threadId},...on RelatedMediaAdditionNotification{id,mediaId},...on MediaDataChangeNotification{id,reason},...on MediaMergeNotification{id,deletedMediaTitles},...on MediaDeletionNotification{id,deletedMediaTitle},...on MediaSubmissionUpdateNotification{id,status},...on StaffSubmissionUpdateNotification{id,status},...on CharacterSubmissionUpdateNotification{id,status}}}"#)
+
+ public var variables: Baton.Variables {
+ Baton.Variables([:])
+ }
+
+ public static func == (lhs: Self, rhs: Self) -> Bool {
+ true
+ }
+
+ public func hash(into hasher: inout Hasher) {
+ }
+
+ @_spi(Generated) public static let plan = Baton.Plan(root: selection0, transient: Types.transient)
+ private static let selection0: Baton.Selection = Baton.Selection(type: Types.Query, key: [], abstract: false, fields: [
+ .linked("Notification", key: .fixed(Slots.Query.Notification), plural: true, selection: selection1),
+ ])
+ private static let selection1: Baton.Selection = Baton.Selection(type: Types.NotificationUnion, key: ["id"], abstract: true, variants: [
+ .init(types: [Types.ActivityLikeNotification, Types.ActivityMentionNotification, Types.ActivityMessageNotification, Types.ActivityReplyLikeNotification, Types.ActivityReplyNotification, Types.ActivityReplySubscribedNotification], key: ["id"], fields: [
+ .scalar("__typename", key: .fixed(Slots.NotificationUnion.__typename), kind: .string, list: false),
+ .scalar("id", key: .fixed(Slots.NotificationUnion.id), kind: .string, list: false),
+ .scalar("activityId", key: .fixed(Slots.NotificationUnion.activityId), kind: .string, list: false),
+ ]),
+ .init(types: [Types.AiringNotification], key: ["id"], fields: [
+ .scalar("__typename", key: .fixed(Slots.AiringNotification.__typename), kind: .string, list: false),
+ .scalar("id", key: .fixed(Slots.AiringNotification.id), kind: .string, list: false),
+ .scalar("episode", key: .fixed(Slots.AiringNotification.episode), kind: .int, list: false),
+ ]),
+ .init(types: [Types.CharacterSubmissionUpdateNotification, Types.MediaSubmissionUpdateNotification, Types.StaffSubmissionUpdateNotification], key: ["id"], fields: [
+ .scalar("__typename", key: .fixed(Slots.NotificationUnion.__typename), kind: .string, list: false),
+ .scalar("id", key: .fixed(Slots.NotificationUnion.id), kind: .string, list: false),
+ .scalar("status", key: .fixed(Slots.NotificationUnion.status), kind: .string, list: false),
+ ]),
+ .init(types: [Types.FollowingNotification], key: ["id"], fields: [
+ .scalar("__typename", key: .fixed(Slots.FollowingNotification.__typename), kind: .string, list: false),
+ .scalar("id", key: .fixed(Slots.FollowingNotification.id), kind: .string, list: false),
+ .scalar("userId", key: .fixed(Slots.FollowingNotification.userId), kind: .string, list: false),
+ ]),
+ .init(types: [Types.MediaDataChangeNotification], key: ["id"], fields: [
+ .scalar("__typename", key: .fixed(Slots.MediaDataChangeNotification.__typename), kind: .string, list: false),
+ .scalar("id", key: .fixed(Slots.MediaDataChangeNotification.id), kind: .string, list: false),
+ .scalar("reason", key: .fixed(Slots.MediaDataChangeNotification.reason), kind: .string, list: false),
+ ]),
+ .init(types: [Types.MediaDeletionNotification], key: ["id"], fields: [
+ .scalar("__typename", key: .fixed(Slots.MediaDeletionNotification.__typename), kind: .string, list: false),
+ .scalar("id", key: .fixed(Slots.MediaDeletionNotification.id), kind: .string, list: false),
+ .scalar("deletedMediaTitle", key: .fixed(Slots.MediaDeletionNotification.deletedMediaTitle), kind: .string, list: false),
+ ]),
+ .init(types: [Types.MediaMergeNotification], key: ["id"], fields: [
+ .scalar("__typename", key: .fixed(Slots.MediaMergeNotification.__typename), kind: .string, list: false),
+ .scalar("id", key: .fixed(Slots.MediaMergeNotification.id), kind: .string, list: false),
+ .scalar("deletedMediaTitles", key: .fixed(Slots.MediaMergeNotification.deletedMediaTitles), kind: .string, list: true),
+ ]),
+ .init(types: [Types.RelatedMediaAdditionNotification], key: ["id"], fields: [
+ .scalar("__typename", key: .fixed(Slots.RelatedMediaAdditionNotification.__typename), kind: .string, list: false),
+ .scalar("id", key: .fixed(Slots.RelatedMediaAdditionNotification.id), kind: .string, list: false),
+ .scalar("mediaId", key: .fixed(Slots.RelatedMediaAdditionNotification.mediaId), kind: .string, list: false),
+ ]),
+ .init(types: [Types.ThreadCommentLikeNotification, Types.ThreadCommentMentionNotification, Types.ThreadCommentReplyNotification, Types.ThreadCommentSubscribedNotification], key: ["id"], fields: [
+ .scalar("__typename", key: .fixed(Slots.NotificationUnion.__typename), kind: .string, list: false),
+ .scalar("id", key: .fixed(Slots.NotificationUnion.id), kind: .string, list: false),
+ .scalar("commentId", key: .fixed(Slots.NotificationUnion.commentId), kind: .string, list: false),
+ ]),
+ .init(types: [Types.ThreadLikeNotification], key: ["id"], fields: [
+ .scalar("__typename", key: .fixed(Slots.ThreadLikeNotification.__typename), kind: .string, list: false),
+ .scalar("id", key: .fixed(Slots.ThreadLikeNotification.id), kind: .string, list: false),
+ .scalar("threadId", key: .fixed(Slots.ThreadLikeNotification.threadId), kind: .string, list: false),
+ ]),
+ .init(types: nil, fields: [
+ .scalar("__typename", key: .fixed(Slots.NotificationUnion.__typename), kind: .string, list: false),
+ ]),
+ ])
+
+ nonisolated public struct Data: Baton.Lens {
+ @_spi(Generated) public let anchor: Baton.Anchor
+ @_spi(Generated) public init(anchor: Baton.Anchor) { self.anchor = anchor }
+ @MainActor public var Notification: Baton.List? { anchor.list(Slots.Query.Notification) }
+
+ nonisolated public struct Notification2: Baton.Lens {
+ @_spi(Generated) public let anchor: Baton.Anchor
+ @_spi(Generated) public init(anchor: Baton.Anchor) { self.anchor = anchor }
+ @MainActor public var asAiringNotification: AsAiringNotification? { anchor.record.is(Types.AiringNotification) ? AsAiringNotification(anchor: anchor) : nil }
+ @MainActor public var asFollowingNotification: AsFollowingNotification? { anchor.record.is(Types.FollowingNotification) ? AsFollowingNotification(anchor: anchor) : nil }
+ @MainActor public var asActivityMessageNotification: AsActivityMessageNotification? { anchor.record.is(Types.ActivityMessageNotification) ? AsActivityMessageNotification(anchor: anchor) : nil }
+ @MainActor public var asActivityMentionNotification: AsActivityMentionNotification? { anchor.record.is(Types.ActivityMentionNotification) ? AsActivityMentionNotification(anchor: anchor) : nil }
+ @MainActor public var asActivityReplyNotification: AsActivityReplyNotification? { anchor.record.is(Types.ActivityReplyNotification) ? AsActivityReplyNotification(anchor: anchor) : nil }
+ @MainActor public var asActivityReplySubscribedNotification: AsActivityReplySubscribedNotification? { anchor.record.is(Types.ActivityReplySubscribedNotification) ? AsActivityReplySubscribedNotification(anchor: anchor) : nil }
+ @MainActor public var asActivityLikeNotification: AsActivityLikeNotification? { anchor.record.is(Types.ActivityLikeNotification) ? AsActivityLikeNotification(anchor: anchor) : nil }
+ @MainActor public var asActivityReplyLikeNotification: AsActivityReplyLikeNotification? { anchor.record.is(Types.ActivityReplyLikeNotification) ? AsActivityReplyLikeNotification(anchor: anchor) : nil }
+ @MainActor public var asThreadCommentMentionNotification: AsThreadCommentMentionNotification? { anchor.record.is(Types.ThreadCommentMentionNotification) ? AsThreadCommentMentionNotification(anchor: anchor) : nil }
+ @MainActor public var asThreadCommentReplyNotification: AsThreadCommentReplyNotification? { anchor.record.is(Types.ThreadCommentReplyNotification) ? AsThreadCommentReplyNotification(anchor: anchor) : nil }
+ @MainActor public var asThreadCommentSubscribedNotification: AsThreadCommentSubscribedNotification? { anchor.record.is(Types.ThreadCommentSubscribedNotification) ? AsThreadCommentSubscribedNotification(anchor: anchor) : nil }
+ @MainActor public var asThreadCommentLikeNotification: AsThreadCommentLikeNotification? { anchor.record.is(Types.ThreadCommentLikeNotification) ? AsThreadCommentLikeNotification(anchor: anchor) : nil }
+ @MainActor public var asThreadLikeNotification: AsThreadLikeNotification? { anchor.record.is(Types.ThreadLikeNotification) ? AsThreadLikeNotification(anchor: anchor) : nil }
+ @MainActor public var asRelatedMediaAdditionNotification: AsRelatedMediaAdditionNotification? { anchor.record.is(Types.RelatedMediaAdditionNotification) ? AsRelatedMediaAdditionNotification(anchor: anchor) : nil }
+ @MainActor public var asMediaDataChangeNotification: AsMediaDataChangeNotification? { anchor.record.is(Types.MediaDataChangeNotification) ? AsMediaDataChangeNotification(anchor: anchor) : nil }
+ @MainActor public var asMediaMergeNotification: AsMediaMergeNotification? { anchor.record.is(Types.MediaMergeNotification) ? AsMediaMergeNotification(anchor: anchor) : nil }
+ @MainActor public var asMediaDeletionNotification: AsMediaDeletionNotification? { anchor.record.is(Types.MediaDeletionNotification) ? AsMediaDeletionNotification(anchor: anchor) : nil }
+ @MainActor public var asMediaSubmissionUpdateNotification: AsMediaSubmissionUpdateNotification? { anchor.record.is(Types.MediaSubmissionUpdateNotification) ? AsMediaSubmissionUpdateNotification(anchor: anchor) : nil }
+ @MainActor public var asStaffSubmissionUpdateNotification: AsStaffSubmissionUpdateNotification? { anchor.record.is(Types.StaffSubmissionUpdateNotification) ? AsStaffSubmissionUpdateNotification(anchor: anchor) : nil }
+ @MainActor public var asCharacterSubmissionUpdateNotification: AsCharacterSubmissionUpdateNotification? { anchor.record.is(Types.CharacterSubmissionUpdateNotification) ? AsCharacterSubmissionUpdateNotification(anchor: anchor) : nil }
+
+ nonisolated public struct AsAiringNotification: Baton.Lens {
+ @_spi(Generated) public let anchor: Baton.Anchor
+ @_spi(Generated) public init(anchor: Baton.Anchor) { self.anchor = anchor }
+ @MainActor public var id: String { anchor.requiredString(Slots.AiringNotification.id) }
+ @MainActor public var episode: Int { anchor.requiredInt(Slots.AiringNotification.episode) }
+ }
+
+ nonisolated public struct AsFollowingNotification: Baton.Lens {
+ @_spi(Generated) public let anchor: Baton.Anchor
+ @_spi(Generated) public init(anchor: Baton.Anchor) { self.anchor = anchor }
+ @MainActor public var id: String { anchor.requiredString(Slots.FollowingNotification.id) }
+ @MainActor public var userId: String { anchor.requiredString(Slots.FollowingNotification.userId) }
+ }
+
+ nonisolated public struct AsActivityMessageNotification: Baton.Lens {
+ @_spi(Generated) public let anchor: Baton.Anchor
+ @_spi(Generated) public init(anchor: Baton.Anchor) { self.anchor = anchor }
+ @MainActor public var id: String { anchor.requiredString(Slots.ActivityMessageNotification.id) }
+ @MainActor public var activityId: String { anchor.requiredString(Slots.ActivityMessageNotification.activityId) }
+ }
+
+ nonisolated public struct AsActivityMentionNotification: Baton.Lens {
+ @_spi(Generated) public let anchor: Baton.Anchor
+ @_spi(Generated) public init(anchor: Baton.Anchor) { self.anchor = anchor }
+ @MainActor public var id: String { anchor.requiredString(Slots.ActivityMentionNotification.id) }
+ @MainActor public var activityId: String { anchor.requiredString(Slots.ActivityMentionNotification.activityId) }
+ }
+
+ nonisolated public struct AsActivityReplyNotification: Baton.Lens {
+ @_spi(Generated) public let anchor: Baton.Anchor
+ @_spi(Generated) public init(anchor: Baton.Anchor) { self.anchor = anchor }
+ @MainActor public var id: String { anchor.requiredString(Slots.ActivityReplyNotification.id) }
+ @MainActor public var activityId: String { anchor.requiredString(Slots.ActivityReplyNotification.activityId) }
+ }
+
+ nonisolated public struct AsActivityReplySubscribedNotification: Baton.Lens {
+ @_spi(Generated) public let anchor: Baton.Anchor
+ @_spi(Generated) public init(anchor: Baton.Anchor) { self.anchor = anchor }
+ @MainActor public var id: String { anchor.requiredString(Slots.ActivityReplySubscribedNotification.id) }
+ @MainActor public var activityId: String { anchor.requiredString(Slots.ActivityReplySubscribedNotification.activityId) }
+ }
+
+ nonisolated public struct AsActivityLikeNotification: Baton.Lens {
+ @_spi(Generated) public let anchor: Baton.Anchor
+ @_spi(Generated) public init(anchor: Baton.Anchor) { self.anchor = anchor }
+ @MainActor public var id: String { anchor.requiredString(Slots.ActivityLikeNotification.id) }
+ @MainActor public var activityId: String { anchor.requiredString(Slots.ActivityLikeNotification.activityId) }
+ }
+
+ nonisolated public struct AsActivityReplyLikeNotification: Baton.Lens {
+ @_spi(Generated) public let anchor: Baton.Anchor
+ @_spi(Generated) public init(anchor: Baton.Anchor) { self.anchor = anchor }
+ @MainActor public var id: String { anchor.requiredString(Slots.ActivityReplyLikeNotification.id) }
+ @MainActor public var activityId: String { anchor.requiredString(Slots.ActivityReplyLikeNotification.activityId) }
+ }
+
+ nonisolated public struct AsThreadCommentMentionNotification: Baton.Lens {
+ @_spi(Generated) public let anchor: Baton.Anchor
+ @_spi(Generated) public init(anchor: Baton.Anchor) { self.anchor = anchor }
+ @MainActor public var id: String { anchor.requiredString(Slots.ThreadCommentMentionNotification.id) }
+ @MainActor public var commentId: String { anchor.requiredString(Slots.ThreadCommentMentionNotification.commentId) }
+ }
+
+ nonisolated public struct AsThreadCommentReplyNotification: Baton.Lens {
+ @_spi(Generated) public let anchor: Baton.Anchor
+ @_spi(Generated) public init(anchor: Baton.Anchor) { self.anchor = anchor }
+ @MainActor public var id: String { anchor.requiredString(Slots.ThreadCommentReplyNotification.id) }
+ @MainActor public var commentId: String { anchor.requiredString(Slots.ThreadCommentReplyNotification.commentId) }
+ }
+
+ nonisolated public struct AsThreadCommentSubscribedNotification: Baton.Lens {
+ @_spi(Generated) public let anchor: Baton.Anchor
+ @_spi(Generated) public init(anchor: Baton.Anchor) { self.anchor = anchor }
+ @MainActor public var id: String { anchor.requiredString(Slots.ThreadCommentSubscribedNotification.id) }
+ @MainActor public var commentId: String { anchor.requiredString(Slots.ThreadCommentSubscribedNotification.commentId) }
+ }
+
+ nonisolated public struct AsThreadCommentLikeNotification: Baton.Lens {
+ @_spi(Generated) public let anchor: Baton.Anchor
+ @_spi(Generated) public init(anchor: Baton.Anchor) { self.anchor = anchor }
+ @MainActor public var id: String { anchor.requiredString(Slots.ThreadCommentLikeNotification.id) }
+ @MainActor public var commentId: String { anchor.requiredString(Slots.ThreadCommentLikeNotification.commentId) }
+ }
+
+ nonisolated public struct AsThreadLikeNotification: Baton.Lens {
+ @_spi(Generated) public let anchor: Baton.Anchor
+ @_spi(Generated) public init(anchor: Baton.Anchor) { self.anchor = anchor }
+ @MainActor public var id: String { anchor.requiredString(Slots.ThreadLikeNotification.id) }
+ @MainActor public var threadId: String { anchor.requiredString(Slots.ThreadLikeNotification.threadId) }
+ }
+
+ nonisolated public struct AsRelatedMediaAdditionNotification: Baton.Lens {
+ @_spi(Generated) public let anchor: Baton.Anchor
+ @_spi(Generated) public init(anchor: Baton.Anchor) { self.anchor = anchor }
+ @MainActor public var id: String { anchor.requiredString(Slots.RelatedMediaAdditionNotification.id) }
+ @MainActor public var mediaId: String { anchor.requiredString(Slots.RelatedMediaAdditionNotification.mediaId) }
+ }
+
+ nonisolated public struct AsMediaDataChangeNotification: Baton.Lens {
+ @_spi(Generated) public let anchor: Baton.Anchor
+ @_spi(Generated) public init(anchor: Baton.Anchor) { self.anchor = anchor }
+ @MainActor public var id: String { anchor.requiredString(Slots.MediaDataChangeNotification.id) }
+ @MainActor public var reason: String? { anchor.string(Slots.MediaDataChangeNotification.reason) }
+ }
+
+ nonisolated public struct AsMediaMergeNotification: Baton.Lens {
+ @_spi(Generated) public let anchor: Baton.Anchor
+ @_spi(Generated) public init(anchor: Baton.Anchor) { self.anchor = anchor }
+ @MainActor public var id: String { anchor.requiredString(Slots.MediaMergeNotification.id) }
+ @MainActor public var deletedMediaTitles: [String?]? { anchor.nullableStrings(Slots.MediaMergeNotification.deletedMediaTitles) }
+ }
+
+ nonisolated public struct AsMediaDeletionNotification: Baton.Lens {
+ @_spi(Generated) public let anchor: Baton.Anchor
+ @_spi(Generated) public init(anchor: Baton.Anchor) { self.anchor = anchor }
+ @MainActor public var id: String { anchor.requiredString(Slots.MediaDeletionNotification.id) }
+ @MainActor public var deletedMediaTitle: String? { anchor.string(Slots.MediaDeletionNotification.deletedMediaTitle) }
+ }
+
+ nonisolated public struct AsMediaSubmissionUpdateNotification: Baton.Lens {
+ @_spi(Generated) public let anchor: Baton.Anchor
+ @_spi(Generated) public init(anchor: Baton.Anchor) { self.anchor = anchor }
+ @MainActor public var id: String { anchor.requiredString(Slots.MediaSubmissionUpdateNotification.id) }
+ @MainActor public var status: String? { anchor.string(Slots.MediaSubmissionUpdateNotification.status) }
+ }
+
+ nonisolated public struct AsStaffSubmissionUpdateNotification: Baton.Lens {
+ @_spi(Generated) public let anchor: Baton.Anchor
+ @_spi(Generated) public init(anchor: Baton.Anchor) { self.anchor = anchor }
+ @MainActor public var id: String { anchor.requiredString(Slots.StaffSubmissionUpdateNotification.id) }
+ @MainActor public var status: String? { anchor.string(Slots.StaffSubmissionUpdateNotification.status) }
+ }
+
+ nonisolated public struct AsCharacterSubmissionUpdateNotification: Baton.Lens {
+ @_spi(Generated) public let anchor: Baton.Anchor
+ @_spi(Generated) public init(anchor: Baton.Anchor) { self.anchor = anchor }
+ @MainActor public var id: String { anchor.requiredString(Slots.CharacterSubmissionUpdateNotification.id) }
+ @MainActor public var status: String? { anchor.string(Slots.CharacterSubmissionUpdateNotification.status) }
+ }
+ }
+ }
+}
+
/// Operation value for `query TestStrictConditions`.
nonisolated public struct TestStrictConditions: Baton.Query {
public var id: String
diff --git a/compiler/src/tests/goldens/EnumDocuments.baton.swift b/compiler/src/tests/goldens/EnumDocuments.baton.swift
index 82051c84..13e89fb8 100644
--- a/compiler/src/tests/goldens/EnumDocuments.baton.swift
+++ b/compiler/src/tests/goldens/EnumDocuments.baton.swift
@@ -53,6 +53,55 @@ nonisolated public struct TestCharactersWithStatus: Baton.Query {
}
}
+/// Operation value for `query TestEpisodeStatus`.
+nonisolated public struct TestEpisodeStatus: Baton.Query {
+ public var id: String
+ @_spi(Generated) public var resolution: Baton.Resolution> = .unresolved
+
+ public init(id: String) {
+ self.id = id
+ }
+
+ public static let name = "TestEpisodeStatus"
+ public static let document: Baton.Document = .text(#"query TestEpisodeStatus($id:ID!){episode(id:$id){id,status,hiatus:status(version:2)}}"#)
+
+ public var variables: Baton.Variables {
+ Baton.Variables(["id": Baton.Variable(self.id)])
+ }
+
+ public static func == (lhs: Self, rhs: Self) -> Bool {
+ lhs.id == rhs.id
+ }
+
+ public func hash(into hasher: inout Hasher) {
+ hasher.combine(self.id)
+ }
+
+ @_spi(Generated) public static let plan = Baton.Plan(root: selection0, transient: Types.transient)
+ private static let selection0: Baton.Selection = Baton.Selection(type: Types.Query, key: [], abstract: false, fields: [
+ .linked("episode", key: .dynamic(Slots.Query.episode_7d0060), plural: false, lookup: Baton.Lookup(type: Types.Episode, key: [.variable("id")]), selection: selection1),
+ ])
+ private static let selection1: Baton.Selection = Baton.Selection(type: Types.Episode, key: ["id"], abstract: false, fields: [
+ .scalar("id", key: .fixed(Slots.Episode.id), kind: .string, list: false),
+ .scalar("status", key: .fixed(Slots.Episode.status), kind: .string, list: false),
+ .scalar("hiatus", key: .fixed(Slots.Episode.status_98c3c3), kind: .string, list: false),
+ ])
+
+ nonisolated public struct Data: Baton.Lens {
+ @_spi(Generated) public let anchor: Baton.Anchor
+ @_spi(Generated) public init(anchor: Baton.Anchor) { self.anchor = anchor }
+ @MainActor public var episode: Episode? { anchor.linked(anchor.owner.slot(Slots.Query.episode_7d0060)).map(Episode.init(anchor:)) }
+
+ nonisolated public struct Episode: Baton.Lens {
+ @_spi(Generated) public let anchor: Baton.Anchor
+ @_spi(Generated) public init(anchor: Baton.Anchor) { self.anchor = anchor }
+ @MainActor public var id: String? { anchor.string(Slots.Episode.id) }
+ @MainActor public var status: EpisodeStatus? { anchor.enumValue(Slots.Episode.status) }
+ @MainActor public var hiatus: EpisodeStatus? { anchor.enumValue(Slots.Episode.status_98c3c3) }
+ }
+ }
+}
+
/// Operation value for `mutation TestSetStatuses`.
nonisolated public struct TestSetStatuses: Baton.Mutation {
diff --git a/compiler/src/tests/goldens/NameDocuments.baton.swift b/compiler/src/tests/goldens/NameDocuments.baton.swift
index 862bfbb6..03363700 100644
--- a/compiler/src/tests/goldens/NameDocuments.baton.swift
+++ b/compiler/src/tests/goldens/NameDocuments.baton.swift
@@ -2,6 +2,84 @@
import Foundation
@_spi(Generated) import Baton
+/// Operation value for `query TestCapitalizedRoots`.
+nonisolated public struct TestCapitalizedRoots: Baton.Query {
+ public var id: String
+ @_spi(Generated) public var resolution: Baton.Resolution> = .unresolved
+
+ public init(id: String) {
+ self.id = id
+ }
+
+ public static let name = "TestCapitalizedRoots"
+ public static let document: Baton.Document = .text(#"query TestCapitalizedRoots($id:ID!){Episode(id:$id){id,name},Viewer{id,name},GenreCollection,Notification{__typename,...on ActivityLikeNotification{id},...on ActivityMentionNotification{id},...on ActivityMessageNotification{id},...on ActivityReplyLikeNotification{id},...on ActivityReplyNotification{id},...on ActivityReplySubscribedNotification{id},...on AiringNotification{id},...on CharacterSubmissionUpdateNotification{id},...on FollowingNotification{id},...on MediaDataChangeNotification{id},...on MediaDeletionNotification{id},...on MediaMergeNotification{id},...on MediaSubmissionUpdateNotification{id},...on RelatedMediaAdditionNotification{id},...on StaffSubmissionUpdateNotification{id},...on ThreadCommentLikeNotification{id},...on ThreadCommentMentionNotification{id},...on ThreadCommentReplyNotification{id},...on ThreadCommentSubscribedNotification{id},...on ThreadLikeNotification{id}}}"#)
+
+ public var variables: Baton.Variables {
+ Baton.Variables(["id": Baton.Variable(self.id)])
+ }
+
+ public static func == (lhs: Self, rhs: Self) -> Bool {
+ lhs.id == rhs.id
+ }
+
+ public func hash(into hasher: inout Hasher) {
+ hasher.combine(self.id)
+ }
+
+ @_spi(Generated) public static let plan = Baton.Plan(root: selection0, transient: Types.transient)
+ private static let selection0: Baton.Selection = Baton.Selection(type: Types.Query, key: [], abstract: false, fields: [
+ .linked("Episode", key: .dynamic(Slots.Query.Episode_9e33c8), plural: false, selection: selection3),
+ .linked("Viewer", key: .fixed(Slots.Query.Viewer), plural: false, selection: selection2),
+ .scalar("GenreCollection", key: .fixed(Slots.Query.GenreCollection), kind: .string, list: true),
+ .linked("Notification", key: .fixed(Slots.Query.Notification), plural: true, selection: selection1),
+ ])
+ private static let selection1: Baton.Selection = Baton.Selection(type: Types.NotificationUnion, key: ["id"], abstract: true, variants: [
+ .init(types: [Types.ActivityLikeNotification, Types.ActivityMentionNotification, Types.ActivityMessageNotification, Types.ActivityReplyLikeNotification, Types.ActivityReplyNotification, Types.ActivityReplySubscribedNotification, Types.AiringNotification, Types.CharacterSubmissionUpdateNotification, Types.FollowingNotification, Types.MediaDataChangeNotification, Types.MediaDeletionNotification, Types.MediaMergeNotification, Types.MediaSubmissionUpdateNotification, Types.RelatedMediaAdditionNotification, Types.StaffSubmissionUpdateNotification, Types.ThreadCommentLikeNotification, Types.ThreadCommentMentionNotification, Types.ThreadCommentReplyNotification, Types.ThreadCommentSubscribedNotification, Types.ThreadLikeNotification], key: ["id"], fields: [
+ .scalar("__typename", key: .fixed(Slots.NotificationUnion.__typename), kind: .string, list: false),
+ .scalar("id", key: .fixed(Slots.NotificationUnion.id), kind: .string, list: false),
+ ]),
+ .init(types: nil, fields: [
+ .scalar("__typename", key: .fixed(Slots.NotificationUnion.__typename), kind: .string, list: false),
+ ]),
+ ])
+ private static let selection2: Baton.Selection = Baton.Selection(type: Types.Character, key: ["id"], abstract: false, fields: [
+ .scalar("id", key: .fixed(Slots.Character.id), kind: .string, list: false),
+ .scalar("name", key: .fixed(Slots.Character.name), kind: .string, list: false),
+ ])
+ private static let selection3: Baton.Selection = Baton.Selection(type: Types.Episode, key: ["id"], abstract: false, fields: [
+ .scalar("id", key: .fixed(Slots.Episode.id), kind: .string, list: false),
+ .scalar("name", key: .fixed(Slots.Episode.name), kind: .string, list: false),
+ ])
+
+ nonisolated public struct Data: Baton.Lens {
+ @_spi(Generated) public let anchor: Baton.Anchor
+ @_spi(Generated) public init(anchor: Baton.Anchor) { self.anchor = anchor }
+ @MainActor public var Episode: Episode2? { anchor.linked(anchor.owner.slot(Slots.Query.Episode_9e33c8)).map(Episode2.init(anchor:)) }
+ @MainActor public var Viewer: Viewer2? { anchor.linked(Slots.Query.Viewer).map(Viewer2.init(anchor:)) }
+ @MainActor public var GenreCollection: [String?]? { anchor.nullableStrings(Slots.Query.GenreCollection) }
+ @MainActor public var Notification: Baton.List? { anchor.list(Slots.Query.Notification) }
+
+ nonisolated public struct Episode2: Baton.Lens {
+ @_spi(Generated) public let anchor: Baton.Anchor
+ @_spi(Generated) public init(anchor: Baton.Anchor) { self.anchor = anchor }
+ @MainActor public var id: String? { anchor.string(Slots.Episode.id) }
+ @MainActor public var name: String? { anchor.string(Slots.Episode.name) }
+ }
+
+ nonisolated public struct Viewer2: Baton.Lens {
+ @_spi(Generated) public let anchor: Baton.Anchor
+ @_spi(Generated) public init(anchor: Baton.Anchor) { self.anchor = anchor }
+ @MainActor public var id: String? { anchor.string(Slots.Character.id) }
+ @MainActor public var name: String? { anchor.string(Slots.Character.name) }
+ }
+
+ nonisolated public struct Notification2: Baton.Lens {
+ @_spi(Generated) public let anchor: Baton.Anchor
+ @_spi(Generated) public init(anchor: Baton.Anchor) { self.anchor = anchor }
+ }
+ }
+}
+
/// Operation value for `query TestCaughtNames`.
nonisolated public struct TestCaughtNames: Baton.Query {
@_spi(Generated) public var resolution: Baton.Resolution> = .unresolved
diff --git a/compiler/src/tests/plans-anilist/AniListDocuments.plan.json b/compiler/src/tests/plans-anilist/AniListDocuments.plan.json
new file mode 100644
index 00000000..a257633f
--- /dev/null
+++ b/compiler/src/tests/plans-anilist/AniListDocuments.plan.json
@@ -0,0 +1,5253 @@
+{
+ "fragments": [
+ {
+ "name": "EntryRow_mediaList",
+ "source": "swift/Tests/AniListDocuments/AniListDocuments.swift",
+ "document": 0,
+ "type_condition": "MediaList",
+ "type_is_abstract": false,
+ "possible_types": [
+ "MediaList"
+ ],
+ "arguments": [],
+ "refetch": null,
+ "throws_on_field_error": false,
+ "bubbles": false,
+ "reader": [
+ {
+ "kind": "scalar",
+ "name": "id",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "id",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "status",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "MediaListStatus",
+ "kind": "enum",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "status",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "progress",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "progress",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "progressVolumes",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "progressVolumes",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "score",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Float",
+ "kind": "float",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "score",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "repeat",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "repeat",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "priority",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "priority",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "notes",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "String",
+ "kind": "string",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "notes",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "private",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Boolean",
+ "kind": "boolean",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "private",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "hiddenFromStatusLists",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Boolean",
+ "kind": "boolean",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "hiddenFromStatusLists",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "customLists",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Json",
+ "kind": "custom_scalar",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "customLists",
+ "arguments": [
+ {
+ "name": "asArray",
+ "value": {
+ "kind": "constant",
+ "value": {
+ "kind": "bool",
+ "value": true
+ }
+ }
+ }
+ ]
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "linked",
+ "name": "startedAt",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "FuzzyDate",
+ "kind": "object",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "keys": {},
+ "is_abstract": false,
+ "possible_types": [
+ "FuzzyDate"
+ ],
+ "storage_key": {
+ "name": "startedAt",
+ "arguments": []
+ },
+ "lookup": null,
+ "connection": null,
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "year",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "year",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "month",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "month",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "day",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "day",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ }
+ ]
+ },
+ {
+ "kind": "linked",
+ "name": "completedAt",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "FuzzyDate",
+ "kind": "object",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "keys": {},
+ "is_abstract": false,
+ "possible_types": [
+ "FuzzyDate"
+ ],
+ "storage_key": {
+ "name": "completedAt",
+ "arguments": []
+ },
+ "lookup": null,
+ "connection": null,
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "year",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "year",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "month",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "month",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "day",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "day",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ }
+ ]
+ },
+ {
+ "kind": "scalar",
+ "name": "updatedAt",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "updatedAt",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "linked",
+ "name": "media",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Media",
+ "kind": "object",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "keys": {
+ "Media": [
+ "id"
+ ]
+ },
+ "is_abstract": false,
+ "possible_types": [
+ "Media"
+ ],
+ "storage_key": {
+ "name": "media",
+ "arguments": []
+ },
+ "lookup": null,
+ "connection": null,
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "id",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "id",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "spread",
+ "fragment": "MediaCard_media",
+ "type_condition": "Media",
+ "arguments": []
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "MediaCard_media",
+ "source": "swift/Tests/AniListDocuments/AniListDocuments.swift",
+ "document": 1,
+ "type_condition": "Media",
+ "type_is_abstract": false,
+ "possible_types": [
+ "Media"
+ ],
+ "arguments": [],
+ "refetch": null,
+ "throws_on_field_error": false,
+ "bubbles": false,
+ "reader": [
+ {
+ "kind": "scalar",
+ "name": "id",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "id",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "idMal",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "idMal",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "type",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "MediaType",
+ "kind": "enum",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "type",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "format",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "MediaFormat",
+ "kind": "enum",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "format",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "status",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "MediaStatus",
+ "kind": "enum",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "status",
+ "arguments": [
+ {
+ "name": "version",
+ "value": {
+ "kind": "constant",
+ "value": {
+ "kind": "int",
+ "value": 2
+ }
+ }
+ }
+ ]
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "episodes",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "episodes",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "chapters",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "chapters",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "volumes",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "volumes",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "duration",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "duration",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "season",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "MediaSeason",
+ "kind": "enum",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "season",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "seasonYear",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "seasonYear",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "countryOfOrigin",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "CountryCode",
+ "kind": "custom_scalar",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "countryOfOrigin",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "isAdult",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Boolean",
+ "kind": "boolean",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "isAdult",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "siteUrl",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "String",
+ "kind": "string",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "siteUrl",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "linked",
+ "name": "title",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "MediaTitle",
+ "kind": "object",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "keys": {},
+ "is_abstract": false,
+ "possible_types": [
+ "MediaTitle"
+ ],
+ "storage_key": {
+ "name": "title",
+ "arguments": []
+ },
+ "lookup": null,
+ "connection": null,
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "romaji",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "String",
+ "kind": "string",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "romaji",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "english",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "String",
+ "kind": "string",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "english",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "native",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "String",
+ "kind": "string",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "native",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "userPreferred",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "String",
+ "kind": "string",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "userPreferred",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ }
+ ]
+ },
+ {
+ "kind": "linked",
+ "name": "coverImage",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "MediaCoverImage",
+ "kind": "object",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "keys": {},
+ "is_abstract": false,
+ "possible_types": [
+ "MediaCoverImage"
+ ],
+ "storage_key": {
+ "name": "coverImage",
+ "arguments": []
+ },
+ "lookup": null,
+ "connection": null,
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "large",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "String",
+ "kind": "string",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "large",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "color",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "String",
+ "kind": "string",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "color",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ }
+ ]
+ },
+ {
+ "kind": "linked",
+ "name": "nextAiringEpisode",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "AiringSchedule",
+ "kind": "object",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "keys": {
+ "AiringSchedule": [
+ "id"
+ ]
+ },
+ "is_abstract": false,
+ "possible_types": [
+ "AiringSchedule"
+ ],
+ "storage_key": {
+ "name": "nextAiringEpisode",
+ "arguments": []
+ },
+ "lookup": null,
+ "connection": null,
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "id",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "id",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "episode",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "episode",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "airingAt",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "airingAt",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ }
+ ]
+ }
+ ]
+ }
+ ],
+ "operations": [
+ {
+ "name": "EntryQuery",
+ "source": "swift/Tests/AniListDocuments/AniListDocuments.swift",
+ "document": 3,
+ "kind": "query",
+ "root_type": "Query",
+ "variables": [
+ {
+ "name": "id",
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": true
+ },
+ "default_value": null
+ }
+ ],
+ "text": "query EntryQuery($id:Int!){MediaList(id:$id){id,...EntryRow_mediaList}}fragment EntryRow_mediaList on MediaList{id,status,progress,progressVolumes,score,repeat,priority,notes,private,hiddenFromStatusLists,customLists(asArray:true),startedAt{year,month,day},completedAt{year,month,day},updatedAt,media{id,...MediaCard_media}}fragment MediaCard_media on Media{id,idMal,type,format,status(version:2),episodes,chapters,volumes,duration,season,seasonYear,countryOfOrigin,isAdult,siteUrl,title{romaji,english,native,userPreferred},coverImage{large,color},nextAiringEpisode{id,episode,airingAt}}",
+ "throws_on_field_error": false,
+ "bubbles": false,
+ "has_incremental": false,
+ "error_behavior": null,
+ "reader": [
+ {
+ "kind": "linked",
+ "name": "MediaList",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "MediaList",
+ "kind": "object",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "keys": {
+ "MediaList": [
+ "id"
+ ]
+ },
+ "is_abstract": false,
+ "possible_types": [
+ "MediaList"
+ ],
+ "storage_key": {
+ "name": "MediaList",
+ "arguments": [
+ {
+ "name": "id",
+ "value": {
+ "kind": "variable",
+ "value": "id"
+ }
+ }
+ ]
+ },
+ "lookup": {
+ "type_name": "MediaList",
+ "possible_types": [
+ "MediaList"
+ ],
+ "arguments": [
+ {
+ "name": "id",
+ "value": {
+ "kind": "variable",
+ "value": "id"
+ }
+ }
+ ]
+ },
+ "connection": null,
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "id",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "id",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "spread",
+ "fragment": "EntryRow_mediaList",
+ "type_condition": "MediaList",
+ "arguments": []
+ }
+ ]
+ }
+ ],
+ "normalization": [
+ {
+ "kind": "linked",
+ "name": "MediaList",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "MediaList",
+ "kind": "object",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "keys": {
+ "MediaList": [
+ "id"
+ ]
+ },
+ "is_abstract": false,
+ "possible_types": [
+ "MediaList"
+ ],
+ "storage_key": {
+ "name": "MediaList",
+ "arguments": [
+ {
+ "name": "id",
+ "value": {
+ "kind": "variable",
+ "value": "id"
+ }
+ }
+ ]
+ },
+ "lookup": {
+ "type_name": "MediaList",
+ "possible_types": [
+ "MediaList"
+ ],
+ "arguments": [
+ {
+ "name": "id",
+ "value": {
+ "kind": "variable",
+ "value": "id"
+ }
+ }
+ ]
+ },
+ "connection": null,
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "id",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "id",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "status",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "MediaListStatus",
+ "kind": "enum",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "status",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "progress",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "progress",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "progressVolumes",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "progressVolumes",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "score",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Float",
+ "kind": "float",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "score",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "repeat",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "repeat",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "priority",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "priority",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "notes",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "String",
+ "kind": "string",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "notes",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "private",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Boolean",
+ "kind": "boolean",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "private",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "hiddenFromStatusLists",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Boolean",
+ "kind": "boolean",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "hiddenFromStatusLists",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "customLists",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Json",
+ "kind": "custom_scalar",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "customLists",
+ "arguments": [
+ {
+ "name": "asArray",
+ "value": {
+ "kind": "constant",
+ "value": {
+ "kind": "bool",
+ "value": true
+ }
+ }
+ }
+ ]
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "linked",
+ "name": "startedAt",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "FuzzyDate",
+ "kind": "object",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "keys": {},
+ "is_abstract": false,
+ "possible_types": [
+ "FuzzyDate"
+ ],
+ "storage_key": {
+ "name": "startedAt",
+ "arguments": []
+ },
+ "lookup": null,
+ "connection": null,
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "year",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "year",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "month",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "month",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "day",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "day",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ }
+ ]
+ },
+ {
+ "kind": "linked",
+ "name": "completedAt",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "FuzzyDate",
+ "kind": "object",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "keys": {},
+ "is_abstract": false,
+ "possible_types": [
+ "FuzzyDate"
+ ],
+ "storage_key": {
+ "name": "completedAt",
+ "arguments": []
+ },
+ "lookup": null,
+ "connection": null,
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "year",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "year",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "month",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "month",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "day",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "day",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ }
+ ]
+ },
+ {
+ "kind": "scalar",
+ "name": "updatedAt",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "updatedAt",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "linked",
+ "name": "media",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Media",
+ "kind": "object",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "keys": {
+ "Media": [
+ "id"
+ ]
+ },
+ "is_abstract": false,
+ "possible_types": [
+ "Media"
+ ],
+ "storage_key": {
+ "name": "media",
+ "arguments": []
+ },
+ "lookup": null,
+ "connection": null,
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "id",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "id",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "idMal",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "idMal",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "type",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "MediaType",
+ "kind": "enum",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "type",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "format",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "MediaFormat",
+ "kind": "enum",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "format",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "status",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "MediaStatus",
+ "kind": "enum",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "status",
+ "arguments": [
+ {
+ "name": "version",
+ "value": {
+ "kind": "constant",
+ "value": {
+ "kind": "int",
+ "value": 2
+ }
+ }
+ }
+ ]
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "episodes",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "episodes",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "chapters",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "chapters",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "volumes",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "volumes",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "duration",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "duration",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "season",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "MediaSeason",
+ "kind": "enum",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "season",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "seasonYear",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "seasonYear",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "countryOfOrigin",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "CountryCode",
+ "kind": "custom_scalar",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "countryOfOrigin",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "isAdult",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Boolean",
+ "kind": "boolean",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "isAdult",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "siteUrl",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "String",
+ "kind": "string",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "siteUrl",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "linked",
+ "name": "title",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "MediaTitle",
+ "kind": "object",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "keys": {},
+ "is_abstract": false,
+ "possible_types": [
+ "MediaTitle"
+ ],
+ "storage_key": {
+ "name": "title",
+ "arguments": []
+ },
+ "lookup": null,
+ "connection": null,
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "romaji",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "String",
+ "kind": "string",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "romaji",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "english",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "String",
+ "kind": "string",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "english",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "native",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "String",
+ "kind": "string",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "native",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "userPreferred",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "String",
+ "kind": "string",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "userPreferred",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ }
+ ]
+ },
+ {
+ "kind": "linked",
+ "name": "coverImage",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "MediaCoverImage",
+ "kind": "object",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "keys": {},
+ "is_abstract": false,
+ "possible_types": [
+ "MediaCoverImage"
+ ],
+ "storage_key": {
+ "name": "coverImage",
+ "arguments": []
+ },
+ "lookup": null,
+ "connection": null,
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "large",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "String",
+ "kind": "string",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "large",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "color",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "String",
+ "kind": "string",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "color",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ }
+ ]
+ },
+ {
+ "kind": "linked",
+ "name": "nextAiringEpisode",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "AiringSchedule",
+ "kind": "object",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "keys": {
+ "AiringSchedule": [
+ "id"
+ ]
+ },
+ "is_abstract": false,
+ "possible_types": [
+ "AiringSchedule"
+ ],
+ "storage_key": {
+ "name": "nextAiringEpisode",
+ "arguments": []
+ },
+ "lookup": null,
+ "connection": null,
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "id",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "id",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "episode",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "episode",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "airingAt",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "airingAt",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "ListQuery",
+ "source": "swift/Tests/AniListDocuments/AniListDocuments.swift",
+ "document": 2,
+ "kind": "query",
+ "root_type": "Query",
+ "variables": [
+ {
+ "name": "userId",
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": true
+ },
+ "default_value": null
+ },
+ {
+ "name": "mediaType",
+ "type": {
+ "shape": "named",
+ "name": "MediaType",
+ "kind": "enum",
+ "non_null": true
+ },
+ "default_value": null
+ },
+ {
+ "name": "chunk",
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": true
+ },
+ "default_value": null
+ }
+ ],
+ "text": "query ListQuery($userId:Int!,$mediaType:MediaType!,$chunk:Int!){MediaListCollection(userId:$userId,type:$mediaType,chunk:$chunk,perChunk:500,forceSingleCompletedList:true){hasNextChunk,lists{name,isCustomList,status,entries{id,...EntryRow_mediaList}}}}fragment EntryRow_mediaList on MediaList{id,status,progress,progressVolumes,score,repeat,priority,notes,private,hiddenFromStatusLists,customLists(asArray:true),startedAt{year,month,day},completedAt{year,month,day},updatedAt,media{id,...MediaCard_media}}fragment MediaCard_media on Media{id,idMal,type,format,status(version:2),episodes,chapters,volumes,duration,season,seasonYear,countryOfOrigin,isAdult,siteUrl,title{romaji,english,native,userPreferred},coverImage{large,color},nextAiringEpisode{id,episode,airingAt}}",
+ "throws_on_field_error": false,
+ "bubbles": false,
+ "has_incremental": false,
+ "error_behavior": null,
+ "reader": [
+ {
+ "kind": "linked",
+ "name": "MediaListCollection",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "MediaListCollection",
+ "kind": "object",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "keys": {},
+ "is_abstract": false,
+ "possible_types": [
+ "MediaListCollection"
+ ],
+ "storage_key": {
+ "name": "MediaListCollection",
+ "arguments": [
+ {
+ "name": "chunk",
+ "value": {
+ "kind": "variable",
+ "value": "chunk"
+ }
+ },
+ {
+ "name": "forceSingleCompletedList",
+ "value": {
+ "kind": "constant",
+ "value": {
+ "kind": "bool",
+ "value": true
+ }
+ }
+ },
+ {
+ "name": "perChunk",
+ "value": {
+ "kind": "constant",
+ "value": {
+ "kind": "int",
+ "value": 500
+ }
+ }
+ },
+ {
+ "name": "type",
+ "value": {
+ "kind": "variable",
+ "value": "mediaType"
+ }
+ },
+ {
+ "name": "userId",
+ "value": {
+ "kind": "variable",
+ "value": "userId"
+ }
+ }
+ ]
+ },
+ "lookup": null,
+ "connection": null,
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "hasNextChunk",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Boolean",
+ "kind": "boolean",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "hasNextChunk",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "linked",
+ "name": "lists",
+ "alias": null,
+ "type": {
+ "shape": "list",
+ "element": {
+ "shape": "named",
+ "name": "MediaListGroup",
+ "kind": "object",
+ "non_null": false
+ },
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "keys": {},
+ "is_abstract": false,
+ "possible_types": [
+ "MediaListGroup"
+ ],
+ "storage_key": {
+ "name": "lists",
+ "arguments": []
+ },
+ "lookup": null,
+ "connection": null,
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "name",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "String",
+ "kind": "string",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "name",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "isCustomList",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Boolean",
+ "kind": "boolean",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "isCustomList",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "status",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "MediaListStatus",
+ "kind": "enum",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "status",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "linked",
+ "name": "entries",
+ "alias": null,
+ "type": {
+ "shape": "list",
+ "element": {
+ "shape": "named",
+ "name": "MediaList",
+ "kind": "object",
+ "non_null": false
+ },
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "keys": {
+ "MediaList": [
+ "id"
+ ]
+ },
+ "is_abstract": false,
+ "possible_types": [
+ "MediaList"
+ ],
+ "storage_key": {
+ "name": "entries",
+ "arguments": []
+ },
+ "lookup": null,
+ "connection": null,
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "id",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "id",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "spread",
+ "fragment": "EntryRow_mediaList",
+ "type_condition": "MediaList",
+ "arguments": []
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ],
+ "normalization": [
+ {
+ "kind": "linked",
+ "name": "MediaListCollection",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "MediaListCollection",
+ "kind": "object",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "keys": {},
+ "is_abstract": false,
+ "possible_types": [
+ "MediaListCollection"
+ ],
+ "storage_key": {
+ "name": "MediaListCollection",
+ "arguments": [
+ {
+ "name": "chunk",
+ "value": {
+ "kind": "variable",
+ "value": "chunk"
+ }
+ },
+ {
+ "name": "forceSingleCompletedList",
+ "value": {
+ "kind": "constant",
+ "value": {
+ "kind": "bool",
+ "value": true
+ }
+ }
+ },
+ {
+ "name": "perChunk",
+ "value": {
+ "kind": "constant",
+ "value": {
+ "kind": "int",
+ "value": 500
+ }
+ }
+ },
+ {
+ "name": "type",
+ "value": {
+ "kind": "variable",
+ "value": "mediaType"
+ }
+ },
+ {
+ "name": "userId",
+ "value": {
+ "kind": "variable",
+ "value": "userId"
+ }
+ }
+ ]
+ },
+ "lookup": null,
+ "connection": null,
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "hasNextChunk",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Boolean",
+ "kind": "boolean",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "hasNextChunk",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "linked",
+ "name": "lists",
+ "alias": null,
+ "type": {
+ "shape": "list",
+ "element": {
+ "shape": "named",
+ "name": "MediaListGroup",
+ "kind": "object",
+ "non_null": false
+ },
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "keys": {},
+ "is_abstract": false,
+ "possible_types": [
+ "MediaListGroup"
+ ],
+ "storage_key": {
+ "name": "lists",
+ "arguments": []
+ },
+ "lookup": null,
+ "connection": null,
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "name",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "String",
+ "kind": "string",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "name",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "isCustomList",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Boolean",
+ "kind": "boolean",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "isCustomList",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "status",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "MediaListStatus",
+ "kind": "enum",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "status",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "linked",
+ "name": "entries",
+ "alias": null,
+ "type": {
+ "shape": "list",
+ "element": {
+ "shape": "named",
+ "name": "MediaList",
+ "kind": "object",
+ "non_null": false
+ },
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "keys": {
+ "MediaList": [
+ "id"
+ ]
+ },
+ "is_abstract": false,
+ "possible_types": [
+ "MediaList"
+ ],
+ "storage_key": {
+ "name": "entries",
+ "arguments": []
+ },
+ "lookup": null,
+ "connection": null,
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "id",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "id",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "status",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "MediaListStatus",
+ "kind": "enum",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "status",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "progress",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "progress",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "progressVolumes",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "progressVolumes",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "score",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Float",
+ "kind": "float",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "score",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "repeat",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "repeat",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "priority",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "priority",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "notes",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "String",
+ "kind": "string",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "notes",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "private",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Boolean",
+ "kind": "boolean",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "private",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "hiddenFromStatusLists",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Boolean",
+ "kind": "boolean",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "hiddenFromStatusLists",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "customLists",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Json",
+ "kind": "custom_scalar",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "customLists",
+ "arguments": [
+ {
+ "name": "asArray",
+ "value": {
+ "kind": "constant",
+ "value": {
+ "kind": "bool",
+ "value": true
+ }
+ }
+ }
+ ]
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "linked",
+ "name": "startedAt",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "FuzzyDate",
+ "kind": "object",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "keys": {},
+ "is_abstract": false,
+ "possible_types": [
+ "FuzzyDate"
+ ],
+ "storage_key": {
+ "name": "startedAt",
+ "arguments": []
+ },
+ "lookup": null,
+ "connection": null,
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "year",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "year",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "month",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "month",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "day",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "day",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ }
+ ]
+ },
+ {
+ "kind": "linked",
+ "name": "completedAt",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "FuzzyDate",
+ "kind": "object",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "keys": {},
+ "is_abstract": false,
+ "possible_types": [
+ "FuzzyDate"
+ ],
+ "storage_key": {
+ "name": "completedAt",
+ "arguments": []
+ },
+ "lookup": null,
+ "connection": null,
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "year",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "year",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "month",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "month",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "day",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "day",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ }
+ ]
+ },
+ {
+ "kind": "scalar",
+ "name": "updatedAt",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "updatedAt",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "linked",
+ "name": "media",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Media",
+ "kind": "object",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "keys": {
+ "Media": [
+ "id"
+ ]
+ },
+ "is_abstract": false,
+ "possible_types": [
+ "Media"
+ ],
+ "storage_key": {
+ "name": "media",
+ "arguments": []
+ },
+ "lookup": null,
+ "connection": null,
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "id",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "id",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "idMal",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "idMal",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "type",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "MediaType",
+ "kind": "enum",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "type",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "format",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "MediaFormat",
+ "kind": "enum",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "format",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "status",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "MediaStatus",
+ "kind": "enum",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "status",
+ "arguments": [
+ {
+ "name": "version",
+ "value": {
+ "kind": "constant",
+ "value": {
+ "kind": "int",
+ "value": 2
+ }
+ }
+ }
+ ]
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "episodes",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "episodes",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "chapters",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "chapters",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "volumes",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "volumes",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "duration",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "duration",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "season",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "MediaSeason",
+ "kind": "enum",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "season",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "seasonYear",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "seasonYear",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "countryOfOrigin",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "CountryCode",
+ "kind": "custom_scalar",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "countryOfOrigin",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "isAdult",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Boolean",
+ "kind": "boolean",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "isAdult",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "siteUrl",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "String",
+ "kind": "string",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "siteUrl",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "linked",
+ "name": "title",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "MediaTitle",
+ "kind": "object",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "keys": {},
+ "is_abstract": false,
+ "possible_types": [
+ "MediaTitle"
+ ],
+ "storage_key": {
+ "name": "title",
+ "arguments": []
+ },
+ "lookup": null,
+ "connection": null,
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "romaji",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "String",
+ "kind": "string",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "romaji",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "english",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "String",
+ "kind": "string",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "english",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "native",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "String",
+ "kind": "string",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "native",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "userPreferred",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "String",
+ "kind": "string",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "userPreferred",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ }
+ ]
+ },
+ {
+ "kind": "linked",
+ "name": "coverImage",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "MediaCoverImage",
+ "kind": "object",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "keys": {},
+ "is_abstract": false,
+ "possible_types": [
+ "MediaCoverImage"
+ ],
+ "storage_key": {
+ "name": "coverImage",
+ "arguments": []
+ },
+ "lookup": null,
+ "connection": null,
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "large",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "String",
+ "kind": "string",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "large",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "color",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "String",
+ "kind": "string",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "color",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ }
+ ]
+ },
+ {
+ "kind": "linked",
+ "name": "nextAiringEpisode",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "AiringSchedule",
+ "kind": "object",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "keys": {
+ "AiringSchedule": [
+ "id"
+ ]
+ },
+ "is_abstract": false,
+ "possible_types": [
+ "AiringSchedule"
+ ],
+ "storage_key": {
+ "name": "nextAiringEpisode",
+ "arguments": []
+ },
+ "lookup": null,
+ "connection": null,
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "id",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "id",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "episode",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "episode",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "airingAt",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "airingAt",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "SaveEntryMutation",
+ "source": "swift/Tests/AniListDocuments/AniListDocuments.swift",
+ "document": 4,
+ "kind": "mutation",
+ "root_type": "Mutation",
+ "variables": [
+ {
+ "name": "id",
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": false
+ },
+ "default_value": null
+ },
+ {
+ "name": "progress",
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": false
+ },
+ "default_value": null
+ }
+ ],
+ "text": "mutation SaveEntryMutation($id:Int,$progress:Int){SaveMediaListEntry(id:$id,progress:$progress){id,...EntryRow_mediaList}}fragment EntryRow_mediaList on MediaList{id,status,progress,progressVolumes,score,repeat,priority,notes,private,hiddenFromStatusLists,customLists(asArray:true),startedAt{year,month,day},completedAt{year,month,day},updatedAt,media{id,...MediaCard_media}}fragment MediaCard_media on Media{id,idMal,type,format,status(version:2),episodes,chapters,volumes,duration,season,seasonYear,countryOfOrigin,isAdult,siteUrl,title{romaji,english,native,userPreferred},coverImage{large,color},nextAiringEpisode{id,episode,airingAt}}",
+ "throws_on_field_error": false,
+ "bubbles": false,
+ "has_incremental": false,
+ "error_behavior": null,
+ "reader": [
+ {
+ "kind": "linked",
+ "name": "SaveMediaListEntry",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "MediaList",
+ "kind": "object",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "keys": {
+ "MediaList": [
+ "id"
+ ]
+ },
+ "is_abstract": false,
+ "possible_types": [
+ "MediaList"
+ ],
+ "storage_key": {
+ "name": "SaveMediaListEntry",
+ "arguments": []
+ },
+ "lookup": null,
+ "connection": null,
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "id",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "id",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "spread",
+ "fragment": "EntryRow_mediaList",
+ "type_condition": "MediaList",
+ "arguments": []
+ }
+ ]
+ }
+ ],
+ "normalization": [
+ {
+ "kind": "linked",
+ "name": "SaveMediaListEntry",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "MediaList",
+ "kind": "object",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "keys": {
+ "MediaList": [
+ "id"
+ ]
+ },
+ "is_abstract": false,
+ "possible_types": [
+ "MediaList"
+ ],
+ "storage_key": {
+ "name": "SaveMediaListEntry",
+ "arguments": []
+ },
+ "lookup": null,
+ "connection": null,
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "id",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "id",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "status",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "MediaListStatus",
+ "kind": "enum",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "status",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "progress",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "progress",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "progressVolumes",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "progressVolumes",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "score",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Float",
+ "kind": "float",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "score",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "repeat",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "repeat",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "priority",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "priority",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "notes",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "String",
+ "kind": "string",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "notes",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "private",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Boolean",
+ "kind": "boolean",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "private",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "hiddenFromStatusLists",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Boolean",
+ "kind": "boolean",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "hiddenFromStatusLists",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "customLists",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Json",
+ "kind": "custom_scalar",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "customLists",
+ "arguments": [
+ {
+ "name": "asArray",
+ "value": {
+ "kind": "constant",
+ "value": {
+ "kind": "bool",
+ "value": true
+ }
+ }
+ }
+ ]
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "linked",
+ "name": "startedAt",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "FuzzyDate",
+ "kind": "object",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "keys": {},
+ "is_abstract": false,
+ "possible_types": [
+ "FuzzyDate"
+ ],
+ "storage_key": {
+ "name": "startedAt",
+ "arguments": []
+ },
+ "lookup": null,
+ "connection": null,
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "year",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "year",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "month",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "month",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "day",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "day",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ }
+ ]
+ },
+ {
+ "kind": "linked",
+ "name": "completedAt",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "FuzzyDate",
+ "kind": "object",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "keys": {},
+ "is_abstract": false,
+ "possible_types": [
+ "FuzzyDate"
+ ],
+ "storage_key": {
+ "name": "completedAt",
+ "arguments": []
+ },
+ "lookup": null,
+ "connection": null,
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "year",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "year",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "month",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "month",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "day",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "day",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ }
+ ]
+ },
+ {
+ "kind": "scalar",
+ "name": "updatedAt",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "updatedAt",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "linked",
+ "name": "media",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Media",
+ "kind": "object",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "keys": {
+ "Media": [
+ "id"
+ ]
+ },
+ "is_abstract": false,
+ "possible_types": [
+ "Media"
+ ],
+ "storage_key": {
+ "name": "media",
+ "arguments": []
+ },
+ "lookup": null,
+ "connection": null,
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "id",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "id",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "idMal",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "idMal",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "type",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "MediaType",
+ "kind": "enum",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "type",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "format",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "MediaFormat",
+ "kind": "enum",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "format",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "status",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "MediaStatus",
+ "kind": "enum",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "status",
+ "arguments": [
+ {
+ "name": "version",
+ "value": {
+ "kind": "constant",
+ "value": {
+ "kind": "int",
+ "value": 2
+ }
+ }
+ }
+ ]
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "episodes",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "episodes",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "chapters",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "chapters",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "volumes",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "volumes",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "duration",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "duration",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "season",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "MediaSeason",
+ "kind": "enum",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "season",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "seasonYear",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "seasonYear",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "countryOfOrigin",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "CountryCode",
+ "kind": "custom_scalar",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "countryOfOrigin",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "isAdult",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Boolean",
+ "kind": "boolean",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "isAdult",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "siteUrl",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "String",
+ "kind": "string",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "siteUrl",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "linked",
+ "name": "title",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "MediaTitle",
+ "kind": "object",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "keys": {},
+ "is_abstract": false,
+ "possible_types": [
+ "MediaTitle"
+ ],
+ "storage_key": {
+ "name": "title",
+ "arguments": []
+ },
+ "lookup": null,
+ "connection": null,
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "romaji",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "String",
+ "kind": "string",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "romaji",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "english",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "String",
+ "kind": "string",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "english",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "native",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "String",
+ "kind": "string",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "native",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "userPreferred",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "String",
+ "kind": "string",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "userPreferred",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ }
+ ]
+ },
+ {
+ "kind": "linked",
+ "name": "coverImage",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "MediaCoverImage",
+ "kind": "object",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "keys": {},
+ "is_abstract": false,
+ "possible_types": [
+ "MediaCoverImage"
+ ],
+ "storage_key": {
+ "name": "coverImage",
+ "arguments": []
+ },
+ "lookup": null,
+ "connection": null,
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "large",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "String",
+ "kind": "string",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "large",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "color",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "String",
+ "kind": "string",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "color",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ }
+ ]
+ },
+ {
+ "kind": "linked",
+ "name": "nextAiringEpisode",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "AiringSchedule",
+ "kind": "object",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "keys": {
+ "AiringSchedule": [
+ "id"
+ ]
+ },
+ "is_abstract": false,
+ "possible_types": [
+ "AiringSchedule"
+ ],
+ "storage_key": {
+ "name": "nextAiringEpisode",
+ "arguments": []
+ },
+ "lookup": null,
+ "connection": null,
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "id",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "id",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "episode",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "episode",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "airingAt",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "airingAt",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ],
+ "enums": {
+ "MediaFormat": [
+ "TV",
+ "TV_SHORT",
+ "MOVIE",
+ "SPECIAL",
+ "OVA",
+ "ONA",
+ "MUSIC",
+ "MANGA",
+ "NOVEL",
+ "ONE_SHOT"
+ ],
+ "MediaListStatus": [
+ "CURRENT",
+ "PLANNING",
+ "COMPLETED",
+ "DROPPED",
+ "PAUSED",
+ "REPEATING"
+ ],
+ "MediaSeason": [
+ "WINTER",
+ "SPRING",
+ "SUMMER",
+ "FALL"
+ ],
+ "MediaStatus": [
+ "FINISHED",
+ "RELEASING",
+ "NOT_YET_RELEASED",
+ "CANCELLED",
+ "HIATUS"
+ ],
+ "MediaType": [
+ "ANIME",
+ "MANGA"
+ ]
+ }
+}
diff --git a/compiler/src/tests/plans-anilist/AniListShapes.plan.json b/compiler/src/tests/plans-anilist/AniListShapes.plan.json
new file mode 100644
index 00000000..6f0a3dd8
--- /dev/null
+++ b/compiler/src/tests/plans-anilist/AniListShapes.plan.json
@@ -0,0 +1,5959 @@
+{
+ "fragments": [],
+ "operations": [
+ {
+ "name": "DeleteEntryMutation",
+ "source": "swift/Tests/AniListDocuments/AniListShapes.swift",
+ "document": 6,
+ "kind": "mutation",
+ "root_type": "Mutation",
+ "variables": [
+ {
+ "name": "id",
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": true
+ },
+ "default_value": null
+ }
+ ],
+ "text": "mutation DeleteEntryMutation($id:Int!){DeleteMediaListEntry(id:$id){deleted}}",
+ "throws_on_field_error": false,
+ "bubbles": false,
+ "has_incremental": false,
+ "error_behavior": null,
+ "deletes": [
+ {
+ "type": "MediaList",
+ "variable": "id"
+ }
+ ],
+ "reader": [
+ {
+ "kind": "linked",
+ "name": "DeleteMediaListEntry",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Deleted",
+ "kind": "object",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "keys": {},
+ "is_abstract": false,
+ "possible_types": [
+ "Deleted"
+ ],
+ "storage_key": {
+ "name": "DeleteMediaListEntry",
+ "arguments": []
+ },
+ "lookup": null,
+ "connection": null,
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "deleted",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Boolean",
+ "kind": "boolean",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "deleted",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ }
+ ]
+ }
+ ],
+ "normalization": [
+ {
+ "kind": "linked",
+ "name": "DeleteMediaListEntry",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Deleted",
+ "kind": "object",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "keys": {},
+ "is_abstract": false,
+ "possible_types": [
+ "Deleted"
+ ],
+ "storage_key": {
+ "name": "DeleteMediaListEntry",
+ "arguments": []
+ },
+ "lookup": null,
+ "connection": null,
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "deleted",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Boolean",
+ "kind": "boolean",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "deleted",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "EntryScoresQuery",
+ "source": "swift/Tests/AniListDocuments/AniListShapes.swift",
+ "document": 5,
+ "kind": "query",
+ "root_type": "Query",
+ "variables": [
+ {
+ "name": "id",
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": true
+ },
+ "default_value": null
+ }
+ ],
+ "text": "query EntryScoresQuery($id:Int!){MediaList(id:$id){id,score,advancedScores,customLists(asArray:true)}}",
+ "throws_on_field_error": false,
+ "bubbles": false,
+ "has_incremental": false,
+ "error_behavior": null,
+ "reader": [
+ {
+ "kind": "linked",
+ "name": "MediaList",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "MediaList",
+ "kind": "object",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "keys": {
+ "MediaList": [
+ "id"
+ ]
+ },
+ "is_abstract": false,
+ "possible_types": [
+ "MediaList"
+ ],
+ "storage_key": {
+ "name": "MediaList",
+ "arguments": [
+ {
+ "name": "id",
+ "value": {
+ "kind": "variable",
+ "value": "id"
+ }
+ }
+ ]
+ },
+ "lookup": {
+ "type_name": "MediaList",
+ "possible_types": [
+ "MediaList"
+ ],
+ "arguments": [
+ {
+ "name": "id",
+ "value": {
+ "kind": "variable",
+ "value": "id"
+ }
+ }
+ ]
+ },
+ "connection": null,
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "id",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "id",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "score",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Float",
+ "kind": "float",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "score",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "advancedScores",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Json",
+ "kind": "custom_scalar",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "advancedScores",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "customLists",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Json",
+ "kind": "custom_scalar",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "customLists",
+ "arguments": [
+ {
+ "name": "asArray",
+ "value": {
+ "kind": "constant",
+ "value": {
+ "kind": "bool",
+ "value": true
+ }
+ }
+ }
+ ]
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ }
+ ]
+ }
+ ],
+ "normalization": [
+ {
+ "kind": "linked",
+ "name": "MediaList",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "MediaList",
+ "kind": "object",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "keys": {
+ "MediaList": [
+ "id"
+ ]
+ },
+ "is_abstract": false,
+ "possible_types": [
+ "MediaList"
+ ],
+ "storage_key": {
+ "name": "MediaList",
+ "arguments": [
+ {
+ "name": "id",
+ "value": {
+ "kind": "variable",
+ "value": "id"
+ }
+ }
+ ]
+ },
+ "lookup": {
+ "type_name": "MediaList",
+ "possible_types": [
+ "MediaList"
+ ],
+ "arguments": [
+ {
+ "name": "id",
+ "value": {
+ "kind": "variable",
+ "value": "id"
+ }
+ }
+ ]
+ },
+ "connection": null,
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "id",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "id",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "score",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Float",
+ "kind": "float",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "score",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "advancedScores",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Json",
+ "kind": "custom_scalar",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "advancedScores",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "customLists",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Json",
+ "kind": "custom_scalar",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "customLists",
+ "arguments": [
+ {
+ "name": "asArray",
+ "value": {
+ "kind": "constant",
+ "value": {
+ "kind": "bool",
+ "value": true
+ }
+ }
+ }
+ ]
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "MediaQuery",
+ "source": "swift/Tests/AniListDocuments/AniListShapes.swift",
+ "document": 0,
+ "kind": "query",
+ "root_type": "Query",
+ "variables": [
+ {
+ "name": "id",
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": true
+ },
+ "default_value": null
+ }
+ ],
+ "text": "query MediaQuery($id:Int!){Media(id:$id){id,...MediaCard_media,statusV1:status,source(version:3),relations{edges{id,relationType(version:2),node{id,title{romaji}}}}}}fragment MediaCard_media on Media{id,idMal,type,format,status(version:2),episodes,chapters,volumes,duration,season,seasonYear,countryOfOrigin,isAdult,siteUrl,title{romaji,english,native,userPreferred},coverImage{large,color},nextAiringEpisode{id,episode,airingAt}}",
+ "throws_on_field_error": false,
+ "bubbles": false,
+ "has_incremental": false,
+ "error_behavior": null,
+ "reader": [
+ {
+ "kind": "linked",
+ "name": "Media",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Media",
+ "kind": "object",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "keys": {
+ "Media": [
+ "id"
+ ]
+ },
+ "is_abstract": false,
+ "possible_types": [
+ "Media"
+ ],
+ "storage_key": {
+ "name": "Media",
+ "arguments": [
+ {
+ "name": "id",
+ "value": {
+ "kind": "variable",
+ "value": "id"
+ }
+ }
+ ]
+ },
+ "lookup": {
+ "type_name": "Media",
+ "possible_types": [
+ "Media"
+ ],
+ "arguments": [
+ {
+ "name": "id",
+ "value": {
+ "kind": "variable",
+ "value": "id"
+ }
+ }
+ ]
+ },
+ "connection": null,
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "id",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "id",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "spread",
+ "fragment": "MediaCard_media",
+ "type_condition": "Media",
+ "arguments": []
+ },
+ {
+ "kind": "scalar",
+ "name": "status",
+ "alias": "statusV1",
+ "type": {
+ "shape": "named",
+ "name": "MediaStatus",
+ "kind": "enum",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "status",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "source",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "MediaSource",
+ "kind": "enum",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "source",
+ "arguments": [
+ {
+ "name": "version",
+ "value": {
+ "kind": "constant",
+ "value": {
+ "kind": "int",
+ "value": 3
+ }
+ }
+ }
+ ]
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "linked",
+ "name": "relations",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "MediaConnection",
+ "kind": "object",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "keys": {},
+ "is_abstract": false,
+ "possible_types": [
+ "MediaConnection"
+ ],
+ "storage_key": {
+ "name": "relations",
+ "arguments": []
+ },
+ "lookup": null,
+ "connection": null,
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "linked",
+ "name": "edges",
+ "alias": null,
+ "type": {
+ "shape": "list",
+ "element": {
+ "shape": "named",
+ "name": "MediaEdge",
+ "kind": "object",
+ "non_null": false
+ },
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "keys": {
+ "MediaEdge": [
+ "id"
+ ]
+ },
+ "is_abstract": false,
+ "possible_types": [
+ "MediaEdge"
+ ],
+ "storage_key": {
+ "name": "edges",
+ "arguments": []
+ },
+ "lookup": null,
+ "connection": null,
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "id",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "id",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "relationType",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "MediaRelation",
+ "kind": "enum",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "relationType",
+ "arguments": [
+ {
+ "name": "version",
+ "value": {
+ "kind": "constant",
+ "value": {
+ "kind": "int",
+ "value": 2
+ }
+ }
+ }
+ ]
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "linked",
+ "name": "node",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Media",
+ "kind": "object",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "keys": {
+ "Media": [
+ "id"
+ ]
+ },
+ "is_abstract": false,
+ "possible_types": [
+ "Media"
+ ],
+ "storage_key": {
+ "name": "node",
+ "arguments": []
+ },
+ "lookup": null,
+ "connection": null,
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "id",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "id",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "linked",
+ "name": "title",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "MediaTitle",
+ "kind": "object",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "keys": {},
+ "is_abstract": false,
+ "possible_types": [
+ "MediaTitle"
+ ],
+ "storage_key": {
+ "name": "title",
+ "arguments": []
+ },
+ "lookup": null,
+ "connection": null,
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "romaji",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "String",
+ "kind": "string",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "romaji",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ],
+ "normalization": [
+ {
+ "kind": "linked",
+ "name": "Media",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Media",
+ "kind": "object",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "keys": {
+ "Media": [
+ "id"
+ ]
+ },
+ "is_abstract": false,
+ "possible_types": [
+ "Media"
+ ],
+ "storage_key": {
+ "name": "Media",
+ "arguments": [
+ {
+ "name": "id",
+ "value": {
+ "kind": "variable",
+ "value": "id"
+ }
+ }
+ ]
+ },
+ "lookup": {
+ "type_name": "Media",
+ "possible_types": [
+ "Media"
+ ],
+ "arguments": [
+ {
+ "name": "id",
+ "value": {
+ "kind": "variable",
+ "value": "id"
+ }
+ }
+ ]
+ },
+ "connection": null,
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "id",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "id",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "idMal",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "idMal",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "type",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "MediaType",
+ "kind": "enum",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "type",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "format",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "MediaFormat",
+ "kind": "enum",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "format",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "status",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "MediaStatus",
+ "kind": "enum",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "status",
+ "arguments": [
+ {
+ "name": "version",
+ "value": {
+ "kind": "constant",
+ "value": {
+ "kind": "int",
+ "value": 2
+ }
+ }
+ }
+ ]
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "episodes",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "episodes",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "chapters",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "chapters",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "volumes",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "volumes",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "duration",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "duration",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "season",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "MediaSeason",
+ "kind": "enum",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "season",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "seasonYear",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "seasonYear",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "countryOfOrigin",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "CountryCode",
+ "kind": "custom_scalar",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "countryOfOrigin",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "isAdult",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Boolean",
+ "kind": "boolean",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "isAdult",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "siteUrl",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "String",
+ "kind": "string",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "siteUrl",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "linked",
+ "name": "title",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "MediaTitle",
+ "kind": "object",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "keys": {},
+ "is_abstract": false,
+ "possible_types": [
+ "MediaTitle"
+ ],
+ "storage_key": {
+ "name": "title",
+ "arguments": []
+ },
+ "lookup": null,
+ "connection": null,
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "romaji",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "String",
+ "kind": "string",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "romaji",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "english",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "String",
+ "kind": "string",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "english",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "native",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "String",
+ "kind": "string",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "native",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "userPreferred",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "String",
+ "kind": "string",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "userPreferred",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ }
+ ]
+ },
+ {
+ "kind": "linked",
+ "name": "coverImage",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "MediaCoverImage",
+ "kind": "object",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "keys": {},
+ "is_abstract": false,
+ "possible_types": [
+ "MediaCoverImage"
+ ],
+ "storage_key": {
+ "name": "coverImage",
+ "arguments": []
+ },
+ "lookup": null,
+ "connection": null,
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "large",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "String",
+ "kind": "string",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "large",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "color",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "String",
+ "kind": "string",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "color",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ }
+ ]
+ },
+ {
+ "kind": "linked",
+ "name": "nextAiringEpisode",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "AiringSchedule",
+ "kind": "object",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "keys": {
+ "AiringSchedule": [
+ "id"
+ ]
+ },
+ "is_abstract": false,
+ "possible_types": [
+ "AiringSchedule"
+ ],
+ "storage_key": {
+ "name": "nextAiringEpisode",
+ "arguments": []
+ },
+ "lookup": null,
+ "connection": null,
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "id",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "id",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "episode",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "episode",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "airingAt",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "airingAt",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ }
+ ]
+ },
+ {
+ "kind": "scalar",
+ "name": "status",
+ "alias": "statusV1",
+ "type": {
+ "shape": "named",
+ "name": "MediaStatus",
+ "kind": "enum",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "status",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "source",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "MediaSource",
+ "kind": "enum",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "source",
+ "arguments": [
+ {
+ "name": "version",
+ "value": {
+ "kind": "constant",
+ "value": {
+ "kind": "int",
+ "value": 3
+ }
+ }
+ }
+ ]
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "linked",
+ "name": "relations",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "MediaConnection",
+ "kind": "object",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "keys": {},
+ "is_abstract": false,
+ "possible_types": [
+ "MediaConnection"
+ ],
+ "storage_key": {
+ "name": "relations",
+ "arguments": []
+ },
+ "lookup": null,
+ "connection": null,
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "linked",
+ "name": "edges",
+ "alias": null,
+ "type": {
+ "shape": "list",
+ "element": {
+ "shape": "named",
+ "name": "MediaEdge",
+ "kind": "object",
+ "non_null": false
+ },
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "keys": {
+ "MediaEdge": [
+ "id"
+ ]
+ },
+ "is_abstract": false,
+ "possible_types": [
+ "MediaEdge"
+ ],
+ "storage_key": {
+ "name": "edges",
+ "arguments": []
+ },
+ "lookup": null,
+ "connection": null,
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "id",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "id",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "relationType",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "MediaRelation",
+ "kind": "enum",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "relationType",
+ "arguments": [
+ {
+ "name": "version",
+ "value": {
+ "kind": "constant",
+ "value": {
+ "kind": "int",
+ "value": 2
+ }
+ }
+ }
+ ]
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "linked",
+ "name": "node",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Media",
+ "kind": "object",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "keys": {
+ "Media": [
+ "id"
+ ]
+ },
+ "is_abstract": false,
+ "possible_types": [
+ "Media"
+ ],
+ "storage_key": {
+ "name": "node",
+ "arguments": []
+ },
+ "lookup": null,
+ "connection": null,
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "id",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "id",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "linked",
+ "name": "title",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "MediaTitle",
+ "kind": "object",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "keys": {},
+ "is_abstract": false,
+ "possible_types": [
+ "MediaTitle"
+ ],
+ "storage_key": {
+ "name": "title",
+ "arguments": []
+ },
+ "lookup": null,
+ "connection": null,
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "romaji",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "String",
+ "kind": "string",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "romaji",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "NotificationsQuery",
+ "source": "swift/Tests/AniListDocuments/AniListShapes.swift",
+ "document": 3,
+ "kind": "query",
+ "root_type": "Query",
+ "variables": [
+ {
+ "name": "page",
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": true
+ },
+ "default_value": null
+ }
+ ],
+ "text": "query NotificationsQuery($page:Int!){Page(page:$page,perPage:25){notifications{__typename,...on AiringNotification{id,episode,contexts,media{id,title{romaji}}},...on FollowingNotification{id,user{id,name}},...on ActivityLikeNotification{id,activityId,user{id,name}},...on ThreadCommentReplyNotification{id,commentId},...on MediaDataChangeNotification{id,mediaId,reason},...on ActivityMentionNotification{id},...on ActivityMessageNotification{id},...on ActivityReplyLikeNotification{id},...on ActivityReplyNotification{id},...on ActivityReplySubscribedNotification{id},...on CharacterSubmissionUpdateNotification{id},...on MediaDeletionNotification{id},...on MediaMergeNotification{id},...on MediaSubmissionUpdateNotification{id},...on RelatedMediaAdditionNotification{id},...on StaffSubmissionUpdateNotification{id},...on ThreadCommentLikeNotification{id},...on ThreadCommentMentionNotification{id},...on ThreadCommentSubscribedNotification{id},...on ThreadLikeNotification{id}}}}",
+ "throws_on_field_error": false,
+ "bubbles": false,
+ "has_incremental": false,
+ "error_behavior": null,
+ "reader": [
+ {
+ "kind": "linked",
+ "name": "Page",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Page",
+ "kind": "object",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "keys": {},
+ "is_abstract": false,
+ "possible_types": [
+ "Page"
+ ],
+ "storage_key": {
+ "name": "Page",
+ "arguments": [
+ {
+ "name": "page",
+ "value": {
+ "kind": "variable",
+ "value": "page"
+ }
+ },
+ {
+ "name": "perPage",
+ "value": {
+ "kind": "constant",
+ "value": {
+ "kind": "int",
+ "value": 25
+ }
+ }
+ }
+ ]
+ },
+ "lookup": null,
+ "connection": null,
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "linked",
+ "name": "notifications",
+ "alias": null,
+ "type": {
+ "shape": "list",
+ "element": {
+ "shape": "named",
+ "name": "NotificationUnion",
+ "kind": "union",
+ "non_null": false
+ },
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "keys": {
+ "ActivityLikeNotification": [
+ "id"
+ ],
+ "ActivityMentionNotification": [
+ "id"
+ ],
+ "ActivityMessageNotification": [
+ "id"
+ ],
+ "ActivityReplyLikeNotification": [
+ "id"
+ ],
+ "ActivityReplyNotification": [
+ "id"
+ ],
+ "ActivityReplySubscribedNotification": [
+ "id"
+ ],
+ "AiringNotification": [
+ "id"
+ ],
+ "CharacterSubmissionUpdateNotification": [
+ "id"
+ ],
+ "FollowingNotification": [
+ "id"
+ ],
+ "MediaDataChangeNotification": [
+ "id"
+ ],
+ "MediaDeletionNotification": [
+ "id"
+ ],
+ "MediaMergeNotification": [
+ "id"
+ ],
+ "MediaSubmissionUpdateNotification": [
+ "id"
+ ],
+ "RelatedMediaAdditionNotification": [
+ "id"
+ ],
+ "StaffSubmissionUpdateNotification": [
+ "id"
+ ],
+ "ThreadCommentLikeNotification": [
+ "id"
+ ],
+ "ThreadCommentMentionNotification": [
+ "id"
+ ],
+ "ThreadCommentReplyNotification": [
+ "id"
+ ],
+ "ThreadCommentSubscribedNotification": [
+ "id"
+ ],
+ "ThreadLikeNotification": [
+ "id"
+ ]
+ },
+ "is_abstract": true,
+ "possible_types": [
+ "ActivityLikeNotification",
+ "ActivityMentionNotification",
+ "ActivityMessageNotification",
+ "ActivityReplyLikeNotification",
+ "ActivityReplyNotification",
+ "ActivityReplySubscribedNotification",
+ "AiringNotification",
+ "CharacterSubmissionUpdateNotification",
+ "FollowingNotification",
+ "MediaDataChangeNotification",
+ "MediaDeletionNotification",
+ "MediaMergeNotification",
+ "MediaSubmissionUpdateNotification",
+ "RelatedMediaAdditionNotification",
+ "StaffSubmissionUpdateNotification",
+ "ThreadCommentLikeNotification",
+ "ThreadCommentMentionNotification",
+ "ThreadCommentReplyNotification",
+ "ThreadCommentSubscribedNotification",
+ "ThreadLikeNotification"
+ ],
+ "storage_key": {
+ "name": "notifications",
+ "arguments": []
+ },
+ "lookup": null,
+ "connection": null,
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "__typename",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "String",
+ "kind": "string",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "__typename",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "inline",
+ "type_condition": "AiringNotification",
+ "condition_types": [
+ "AiringNotification"
+ ],
+ "condition_class": {
+ "kind": "concrete",
+ "type": "AiringNotification"
+ },
+ "alias": null,
+ "deferred": null,
+ "catch": null,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "id",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "id",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "episode",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "episode",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "contexts",
+ "alias": null,
+ "type": {
+ "shape": "list",
+ "element": {
+ "shape": "named",
+ "name": "String",
+ "kind": "string",
+ "non_null": false
+ },
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "contexts",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "linked",
+ "name": "media",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Media",
+ "kind": "object",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "keys": {
+ "Media": [
+ "id"
+ ]
+ },
+ "is_abstract": false,
+ "possible_types": [
+ "Media"
+ ],
+ "storage_key": {
+ "name": "media",
+ "arguments": []
+ },
+ "lookup": null,
+ "connection": null,
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "id",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "id",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "linked",
+ "name": "title",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "MediaTitle",
+ "kind": "object",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "keys": {},
+ "is_abstract": false,
+ "possible_types": [
+ "MediaTitle"
+ ],
+ "storage_key": {
+ "name": "title",
+ "arguments": []
+ },
+ "lookup": null,
+ "connection": null,
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "romaji",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "String",
+ "kind": "string",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "romaji",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "kind": "inline",
+ "type_condition": "FollowingNotification",
+ "condition_types": [
+ "FollowingNotification"
+ ],
+ "condition_class": {
+ "kind": "concrete",
+ "type": "FollowingNotification"
+ },
+ "alias": null,
+ "deferred": null,
+ "catch": null,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "id",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "id",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "linked",
+ "name": "user",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "User",
+ "kind": "object",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "keys": {
+ "User": [
+ "id"
+ ]
+ },
+ "is_abstract": false,
+ "possible_types": [
+ "User"
+ ],
+ "storage_key": {
+ "name": "user",
+ "arguments": []
+ },
+ "lookup": null,
+ "connection": null,
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "id",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "id",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "name",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "String",
+ "kind": "string",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "name",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "kind": "inline",
+ "type_condition": "ActivityLikeNotification",
+ "condition_types": [
+ "ActivityLikeNotification"
+ ],
+ "condition_class": {
+ "kind": "concrete",
+ "type": "ActivityLikeNotification"
+ },
+ "alias": null,
+ "deferred": null,
+ "catch": null,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "id",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "id",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "activityId",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "activityId",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "linked",
+ "name": "user",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "User",
+ "kind": "object",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "keys": {
+ "User": [
+ "id"
+ ]
+ },
+ "is_abstract": false,
+ "possible_types": [
+ "User"
+ ],
+ "storage_key": {
+ "name": "user",
+ "arguments": []
+ },
+ "lookup": null,
+ "connection": null,
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "id",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "id",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "name",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "String",
+ "kind": "string",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "name",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "kind": "inline",
+ "type_condition": "ThreadCommentReplyNotification",
+ "condition_types": [
+ "ThreadCommentReplyNotification"
+ ],
+ "condition_class": {
+ "kind": "concrete",
+ "type": "ThreadCommentReplyNotification"
+ },
+ "alias": null,
+ "deferred": null,
+ "catch": null,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "id",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "id",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "commentId",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "commentId",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ }
+ ]
+ },
+ {
+ "kind": "inline",
+ "type_condition": "MediaDataChangeNotification",
+ "condition_types": [
+ "MediaDataChangeNotification"
+ ],
+ "condition_class": {
+ "kind": "concrete",
+ "type": "MediaDataChangeNotification"
+ },
+ "alias": null,
+ "deferred": null,
+ "catch": null,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "id",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "id",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "mediaId",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "mediaId",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "reason",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "String",
+ "kind": "string",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "reason",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ],
+ "normalization": [
+ {
+ "kind": "linked",
+ "name": "Page",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Page",
+ "kind": "object",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "keys": {},
+ "is_abstract": false,
+ "possible_types": [
+ "Page"
+ ],
+ "storage_key": {
+ "name": "Page",
+ "arguments": [
+ {
+ "name": "page",
+ "value": {
+ "kind": "variable",
+ "value": "page"
+ }
+ },
+ {
+ "name": "perPage",
+ "value": {
+ "kind": "constant",
+ "value": {
+ "kind": "int",
+ "value": 25
+ }
+ }
+ }
+ ]
+ },
+ "lookup": null,
+ "connection": null,
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "linked",
+ "name": "notifications",
+ "alias": null,
+ "type": {
+ "shape": "list",
+ "element": {
+ "shape": "named",
+ "name": "NotificationUnion",
+ "kind": "union",
+ "non_null": false
+ },
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "keys": {
+ "ActivityLikeNotification": [
+ "id"
+ ],
+ "ActivityMentionNotification": [
+ "id"
+ ],
+ "ActivityMessageNotification": [
+ "id"
+ ],
+ "ActivityReplyLikeNotification": [
+ "id"
+ ],
+ "ActivityReplyNotification": [
+ "id"
+ ],
+ "ActivityReplySubscribedNotification": [
+ "id"
+ ],
+ "AiringNotification": [
+ "id"
+ ],
+ "CharacterSubmissionUpdateNotification": [
+ "id"
+ ],
+ "FollowingNotification": [
+ "id"
+ ],
+ "MediaDataChangeNotification": [
+ "id"
+ ],
+ "MediaDeletionNotification": [
+ "id"
+ ],
+ "MediaMergeNotification": [
+ "id"
+ ],
+ "MediaSubmissionUpdateNotification": [
+ "id"
+ ],
+ "RelatedMediaAdditionNotification": [
+ "id"
+ ],
+ "StaffSubmissionUpdateNotification": [
+ "id"
+ ],
+ "ThreadCommentLikeNotification": [
+ "id"
+ ],
+ "ThreadCommentMentionNotification": [
+ "id"
+ ],
+ "ThreadCommentReplyNotification": [
+ "id"
+ ],
+ "ThreadCommentSubscribedNotification": [
+ "id"
+ ],
+ "ThreadLikeNotification": [
+ "id"
+ ]
+ },
+ "is_abstract": true,
+ "possible_types": [
+ "ActivityLikeNotification",
+ "ActivityMentionNotification",
+ "ActivityMessageNotification",
+ "ActivityReplyLikeNotification",
+ "ActivityReplyNotification",
+ "ActivityReplySubscribedNotification",
+ "AiringNotification",
+ "CharacterSubmissionUpdateNotification",
+ "FollowingNotification",
+ "MediaDataChangeNotification",
+ "MediaDeletionNotification",
+ "MediaMergeNotification",
+ "MediaSubmissionUpdateNotification",
+ "RelatedMediaAdditionNotification",
+ "StaffSubmissionUpdateNotification",
+ "ThreadCommentLikeNotification",
+ "ThreadCommentMentionNotification",
+ "ThreadCommentReplyNotification",
+ "ThreadCommentSubscribedNotification",
+ "ThreadLikeNotification"
+ ],
+ "storage_key": {
+ "name": "notifications",
+ "arguments": []
+ },
+ "lookup": null,
+ "connection": null,
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "__typename",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "String",
+ "kind": "string",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "__typename",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "inline",
+ "type_condition": "AiringNotification",
+ "condition_types": [
+ "AiringNotification"
+ ],
+ "condition_class": {
+ "kind": "concrete",
+ "type": "AiringNotification"
+ },
+ "alias": null,
+ "deferred": null,
+ "catch": null,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "id",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "id",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "episode",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "episode",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "contexts",
+ "alias": null,
+ "type": {
+ "shape": "list",
+ "element": {
+ "shape": "named",
+ "name": "String",
+ "kind": "string",
+ "non_null": false
+ },
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "contexts",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "linked",
+ "name": "media",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Media",
+ "kind": "object",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "keys": {
+ "Media": [
+ "id"
+ ]
+ },
+ "is_abstract": false,
+ "possible_types": [
+ "Media"
+ ],
+ "storage_key": {
+ "name": "media",
+ "arguments": []
+ },
+ "lookup": null,
+ "connection": null,
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "id",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "id",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "linked",
+ "name": "title",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "MediaTitle",
+ "kind": "object",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "keys": {},
+ "is_abstract": false,
+ "possible_types": [
+ "MediaTitle"
+ ],
+ "storage_key": {
+ "name": "title",
+ "arguments": []
+ },
+ "lookup": null,
+ "connection": null,
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "romaji",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "String",
+ "kind": "string",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "romaji",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "kind": "inline",
+ "type_condition": "FollowingNotification",
+ "condition_types": [
+ "FollowingNotification"
+ ],
+ "condition_class": {
+ "kind": "concrete",
+ "type": "FollowingNotification"
+ },
+ "alias": null,
+ "deferred": null,
+ "catch": null,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "id",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "id",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "linked",
+ "name": "user",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "User",
+ "kind": "object",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "keys": {
+ "User": [
+ "id"
+ ]
+ },
+ "is_abstract": false,
+ "possible_types": [
+ "User"
+ ],
+ "storage_key": {
+ "name": "user",
+ "arguments": []
+ },
+ "lookup": null,
+ "connection": null,
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "id",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "id",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "name",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "String",
+ "kind": "string",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "name",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "kind": "inline",
+ "type_condition": "ActivityLikeNotification",
+ "condition_types": [
+ "ActivityLikeNotification"
+ ],
+ "condition_class": {
+ "kind": "concrete",
+ "type": "ActivityLikeNotification"
+ },
+ "alias": null,
+ "deferred": null,
+ "catch": null,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "id",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "id",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "activityId",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "activityId",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "linked",
+ "name": "user",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "User",
+ "kind": "object",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "keys": {
+ "User": [
+ "id"
+ ]
+ },
+ "is_abstract": false,
+ "possible_types": [
+ "User"
+ ],
+ "storage_key": {
+ "name": "user",
+ "arguments": []
+ },
+ "lookup": null,
+ "connection": null,
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "id",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "id",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "name",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "String",
+ "kind": "string",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "name",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "kind": "inline",
+ "type_condition": "ThreadCommentReplyNotification",
+ "condition_types": [
+ "ThreadCommentReplyNotification"
+ ],
+ "condition_class": {
+ "kind": "concrete",
+ "type": "ThreadCommentReplyNotification"
+ },
+ "alias": null,
+ "deferred": null,
+ "catch": null,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "id",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "id",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "commentId",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "commentId",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ }
+ ]
+ },
+ {
+ "kind": "inline",
+ "type_condition": "MediaDataChangeNotification",
+ "condition_types": [
+ "MediaDataChangeNotification"
+ ],
+ "condition_class": {
+ "kind": "concrete",
+ "type": "MediaDataChangeNotification"
+ },
+ "alias": null,
+ "deferred": null,
+ "catch": null,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "id",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "id",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "mediaId",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "mediaId",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "reason",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "String",
+ "kind": "string",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "reason",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ }
+ ]
+ },
+ {
+ "kind": "inline",
+ "type_condition": "ActivityMentionNotification",
+ "condition_types": [
+ "ActivityMentionNotification"
+ ],
+ "condition_class": {
+ "kind": "concrete",
+ "type": "ActivityMentionNotification"
+ },
+ "alias": null,
+ "deferred": null,
+ "catch": null,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "id",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "id",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ }
+ ]
+ },
+ {
+ "kind": "inline",
+ "type_condition": "ActivityMessageNotification",
+ "condition_types": [
+ "ActivityMessageNotification"
+ ],
+ "condition_class": {
+ "kind": "concrete",
+ "type": "ActivityMessageNotification"
+ },
+ "alias": null,
+ "deferred": null,
+ "catch": null,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "id",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "id",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ }
+ ]
+ },
+ {
+ "kind": "inline",
+ "type_condition": "ActivityReplyLikeNotification",
+ "condition_types": [
+ "ActivityReplyLikeNotification"
+ ],
+ "condition_class": {
+ "kind": "concrete",
+ "type": "ActivityReplyLikeNotification"
+ },
+ "alias": null,
+ "deferred": null,
+ "catch": null,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "id",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "id",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ }
+ ]
+ },
+ {
+ "kind": "inline",
+ "type_condition": "ActivityReplyNotification",
+ "condition_types": [
+ "ActivityReplyNotification"
+ ],
+ "condition_class": {
+ "kind": "concrete",
+ "type": "ActivityReplyNotification"
+ },
+ "alias": null,
+ "deferred": null,
+ "catch": null,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "id",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "id",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ }
+ ]
+ },
+ {
+ "kind": "inline",
+ "type_condition": "ActivityReplySubscribedNotification",
+ "condition_types": [
+ "ActivityReplySubscribedNotification"
+ ],
+ "condition_class": {
+ "kind": "concrete",
+ "type": "ActivityReplySubscribedNotification"
+ },
+ "alias": null,
+ "deferred": null,
+ "catch": null,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "id",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "id",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ }
+ ]
+ },
+ {
+ "kind": "inline",
+ "type_condition": "CharacterSubmissionUpdateNotification",
+ "condition_types": [
+ "CharacterSubmissionUpdateNotification"
+ ],
+ "condition_class": {
+ "kind": "concrete",
+ "type": "CharacterSubmissionUpdateNotification"
+ },
+ "alias": null,
+ "deferred": null,
+ "catch": null,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "id",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "id",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ }
+ ]
+ },
+ {
+ "kind": "inline",
+ "type_condition": "MediaDeletionNotification",
+ "condition_types": [
+ "MediaDeletionNotification"
+ ],
+ "condition_class": {
+ "kind": "concrete",
+ "type": "MediaDeletionNotification"
+ },
+ "alias": null,
+ "deferred": null,
+ "catch": null,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "id",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "id",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ }
+ ]
+ },
+ {
+ "kind": "inline",
+ "type_condition": "MediaMergeNotification",
+ "condition_types": [
+ "MediaMergeNotification"
+ ],
+ "condition_class": {
+ "kind": "concrete",
+ "type": "MediaMergeNotification"
+ },
+ "alias": null,
+ "deferred": null,
+ "catch": null,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "id",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "id",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ }
+ ]
+ },
+ {
+ "kind": "inline",
+ "type_condition": "MediaSubmissionUpdateNotification",
+ "condition_types": [
+ "MediaSubmissionUpdateNotification"
+ ],
+ "condition_class": {
+ "kind": "concrete",
+ "type": "MediaSubmissionUpdateNotification"
+ },
+ "alias": null,
+ "deferred": null,
+ "catch": null,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "id",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "id",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ }
+ ]
+ },
+ {
+ "kind": "inline",
+ "type_condition": "RelatedMediaAdditionNotification",
+ "condition_types": [
+ "RelatedMediaAdditionNotification"
+ ],
+ "condition_class": {
+ "kind": "concrete",
+ "type": "RelatedMediaAdditionNotification"
+ },
+ "alias": null,
+ "deferred": null,
+ "catch": null,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "id",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "id",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ }
+ ]
+ },
+ {
+ "kind": "inline",
+ "type_condition": "StaffSubmissionUpdateNotification",
+ "condition_types": [
+ "StaffSubmissionUpdateNotification"
+ ],
+ "condition_class": {
+ "kind": "concrete",
+ "type": "StaffSubmissionUpdateNotification"
+ },
+ "alias": null,
+ "deferred": null,
+ "catch": null,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "id",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "id",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ }
+ ]
+ },
+ {
+ "kind": "inline",
+ "type_condition": "ThreadCommentLikeNotification",
+ "condition_types": [
+ "ThreadCommentLikeNotification"
+ ],
+ "condition_class": {
+ "kind": "concrete",
+ "type": "ThreadCommentLikeNotification"
+ },
+ "alias": null,
+ "deferred": null,
+ "catch": null,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "id",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "id",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ }
+ ]
+ },
+ {
+ "kind": "inline",
+ "type_condition": "ThreadCommentMentionNotification",
+ "condition_types": [
+ "ThreadCommentMentionNotification"
+ ],
+ "condition_class": {
+ "kind": "concrete",
+ "type": "ThreadCommentMentionNotification"
+ },
+ "alias": null,
+ "deferred": null,
+ "catch": null,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "id",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "id",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ }
+ ]
+ },
+ {
+ "kind": "inline",
+ "type_condition": "ThreadCommentSubscribedNotification",
+ "condition_types": [
+ "ThreadCommentSubscribedNotification"
+ ],
+ "condition_class": {
+ "kind": "concrete",
+ "type": "ThreadCommentSubscribedNotification"
+ },
+ "alias": null,
+ "deferred": null,
+ "catch": null,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "id",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "id",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ }
+ ]
+ },
+ {
+ "kind": "inline",
+ "type_condition": "ThreadLikeNotification",
+ "condition_types": [
+ "ThreadLikeNotification"
+ ],
+ "condition_class": {
+ "kind": "concrete",
+ "type": "ThreadLikeNotification"
+ },
+ "alias": null,
+ "deferred": null,
+ "catch": null,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "id",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "id",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "SeasonQuery",
+ "source": "swift/Tests/AniListDocuments/AniListShapes.swift",
+ "document": 1,
+ "kind": "query",
+ "root_type": "Query",
+ "variables": [
+ {
+ "name": "season",
+ "type": {
+ "shape": "named",
+ "name": "MediaSeason",
+ "kind": "enum",
+ "non_null": true
+ },
+ "default_value": null
+ },
+ {
+ "name": "seasonYear",
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": true
+ },
+ "default_value": null
+ },
+ {
+ "name": "page",
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": true
+ },
+ "default_value": null
+ }
+ ],
+ "text": "query SeasonQuery($season:MediaSeason!,$seasonYear:Int!,$page:Int!){Page(page:$page,perPage:48){pageInfo{hasNextPage},media(season:$season,seasonYear:$seasonYear,type:ANIME,sort:[POPULARITY_DESC]){id,...MediaCard_media}}}fragment MediaCard_media on Media{id,idMal,type,format,status(version:2),episodes,chapters,volumes,duration,season,seasonYear,countryOfOrigin,isAdult,siteUrl,title{romaji,english,native,userPreferred},coverImage{large,color},nextAiringEpisode{id,episode,airingAt}}",
+ "throws_on_field_error": false,
+ "bubbles": false,
+ "has_incremental": false,
+ "error_behavior": null,
+ "reader": [
+ {
+ "kind": "linked",
+ "name": "Page",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Page",
+ "kind": "object",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "keys": {},
+ "is_abstract": false,
+ "possible_types": [
+ "Page"
+ ],
+ "storage_key": {
+ "name": "Page",
+ "arguments": [
+ {
+ "name": "page",
+ "value": {
+ "kind": "variable",
+ "value": "page"
+ }
+ },
+ {
+ "name": "perPage",
+ "value": {
+ "kind": "constant",
+ "value": {
+ "kind": "int",
+ "value": 48
+ }
+ }
+ }
+ ]
+ },
+ "lookup": null,
+ "connection": null,
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "linked",
+ "name": "pageInfo",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "PageInfo",
+ "kind": "object",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "keys": {},
+ "is_abstract": false,
+ "possible_types": [
+ "PageInfo"
+ ],
+ "storage_key": {
+ "name": "pageInfo",
+ "arguments": []
+ },
+ "lookup": null,
+ "connection": null,
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "hasNextPage",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Boolean",
+ "kind": "boolean",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "hasNextPage",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ }
+ ]
+ },
+ {
+ "kind": "linked",
+ "name": "media",
+ "alias": null,
+ "type": {
+ "shape": "list",
+ "element": {
+ "shape": "named",
+ "name": "Media",
+ "kind": "object",
+ "non_null": false
+ },
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "keys": {
+ "Media": [
+ "id"
+ ]
+ },
+ "is_abstract": false,
+ "possible_types": [
+ "Media"
+ ],
+ "storage_key": {
+ "name": "media",
+ "arguments": [
+ {
+ "name": "season",
+ "value": {
+ "kind": "variable",
+ "value": "season"
+ }
+ },
+ {
+ "name": "seasonYear",
+ "value": {
+ "kind": "variable",
+ "value": "seasonYear"
+ }
+ },
+ {
+ "name": "sort",
+ "value": {
+ "kind": "constant",
+ "value": {
+ "kind": "list",
+ "value": [
+ {
+ "kind": "string",
+ "value": "POPULARITY_DESC"
+ }
+ ]
+ }
+ }
+ },
+ {
+ "name": "type",
+ "value": {
+ "kind": "constant",
+ "value": {
+ "kind": "string",
+ "value": "ANIME"
+ }
+ }
+ }
+ ]
+ },
+ "lookup": null,
+ "connection": null,
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "id",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "id",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "spread",
+ "fragment": "MediaCard_media",
+ "type_condition": "Media",
+ "arguments": []
+ }
+ ]
+ }
+ ]
+ }
+ ],
+ "normalization": [
+ {
+ "kind": "linked",
+ "name": "Page",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Page",
+ "kind": "object",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "keys": {},
+ "is_abstract": false,
+ "possible_types": [
+ "Page"
+ ],
+ "storage_key": {
+ "name": "Page",
+ "arguments": [
+ {
+ "name": "page",
+ "value": {
+ "kind": "variable",
+ "value": "page"
+ }
+ },
+ {
+ "name": "perPage",
+ "value": {
+ "kind": "constant",
+ "value": {
+ "kind": "int",
+ "value": 48
+ }
+ }
+ }
+ ]
+ },
+ "lookup": null,
+ "connection": null,
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "linked",
+ "name": "pageInfo",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "PageInfo",
+ "kind": "object",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "keys": {},
+ "is_abstract": false,
+ "possible_types": [
+ "PageInfo"
+ ],
+ "storage_key": {
+ "name": "pageInfo",
+ "arguments": []
+ },
+ "lookup": null,
+ "connection": null,
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "hasNextPage",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Boolean",
+ "kind": "boolean",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "hasNextPage",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ }
+ ]
+ },
+ {
+ "kind": "linked",
+ "name": "media",
+ "alias": null,
+ "type": {
+ "shape": "list",
+ "element": {
+ "shape": "named",
+ "name": "Media",
+ "kind": "object",
+ "non_null": false
+ },
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "keys": {
+ "Media": [
+ "id"
+ ]
+ },
+ "is_abstract": false,
+ "possible_types": [
+ "Media"
+ ],
+ "storage_key": {
+ "name": "media",
+ "arguments": [
+ {
+ "name": "season",
+ "value": {
+ "kind": "variable",
+ "value": "season"
+ }
+ },
+ {
+ "name": "seasonYear",
+ "value": {
+ "kind": "variable",
+ "value": "seasonYear"
+ }
+ },
+ {
+ "name": "sort",
+ "value": {
+ "kind": "constant",
+ "value": {
+ "kind": "list",
+ "value": [
+ {
+ "kind": "string",
+ "value": "POPULARITY_DESC"
+ }
+ ]
+ }
+ }
+ },
+ {
+ "name": "type",
+ "value": {
+ "kind": "constant",
+ "value": {
+ "kind": "string",
+ "value": "ANIME"
+ }
+ }
+ }
+ ]
+ },
+ "lookup": null,
+ "connection": null,
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "id",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "id",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "idMal",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "idMal",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "type",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "MediaType",
+ "kind": "enum",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "type",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "format",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "MediaFormat",
+ "kind": "enum",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "format",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "status",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "MediaStatus",
+ "kind": "enum",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "status",
+ "arguments": [
+ {
+ "name": "version",
+ "value": {
+ "kind": "constant",
+ "value": {
+ "kind": "int",
+ "value": 2
+ }
+ }
+ }
+ ]
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "episodes",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "episodes",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "chapters",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "chapters",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "volumes",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "volumes",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "duration",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "duration",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "season",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "MediaSeason",
+ "kind": "enum",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "season",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "seasonYear",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "seasonYear",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "countryOfOrigin",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "CountryCode",
+ "kind": "custom_scalar",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "countryOfOrigin",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "isAdult",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Boolean",
+ "kind": "boolean",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "isAdult",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "siteUrl",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "String",
+ "kind": "string",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "siteUrl",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "linked",
+ "name": "title",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "MediaTitle",
+ "kind": "object",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "keys": {},
+ "is_abstract": false,
+ "possible_types": [
+ "MediaTitle"
+ ],
+ "storage_key": {
+ "name": "title",
+ "arguments": []
+ },
+ "lookup": null,
+ "connection": null,
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "romaji",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "String",
+ "kind": "string",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "romaji",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "english",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "String",
+ "kind": "string",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "english",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "native",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "String",
+ "kind": "string",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "native",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "userPreferred",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "String",
+ "kind": "string",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "userPreferred",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ }
+ ]
+ },
+ {
+ "kind": "linked",
+ "name": "coverImage",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "MediaCoverImage",
+ "kind": "object",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "keys": {},
+ "is_abstract": false,
+ "possible_types": [
+ "MediaCoverImage"
+ ],
+ "storage_key": {
+ "name": "coverImage",
+ "arguments": []
+ },
+ "lookup": null,
+ "connection": null,
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "large",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "String",
+ "kind": "string",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "large",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "color",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "String",
+ "kind": "string",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "color",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ }
+ ]
+ },
+ {
+ "kind": "linked",
+ "name": "nextAiringEpisode",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "AiringSchedule",
+ "kind": "object",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "keys": {
+ "AiringSchedule": [
+ "id"
+ ]
+ },
+ "is_abstract": false,
+ "possible_types": [
+ "AiringSchedule"
+ ],
+ "storage_key": {
+ "name": "nextAiringEpisode",
+ "arguments": []
+ },
+ "lookup": null,
+ "connection": null,
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "id",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "id",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "episode",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "episode",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "airingAt",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "airingAt",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "ThreadCommentsQuery",
+ "source": "swift/Tests/AniListDocuments/AniListShapes.swift",
+ "document": 4,
+ "kind": "query",
+ "root_type": "Query",
+ "variables": [
+ {
+ "name": "threadId",
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": true
+ },
+ "default_value": null
+ }
+ ],
+ "text": "query ThreadCommentsQuery($threadId:Int!){Page(page:1,perPage:25){threadComments(threadId:$threadId){id,comment,childComments}}}",
+ "throws_on_field_error": false,
+ "bubbles": false,
+ "has_incremental": false,
+ "error_behavior": null,
+ "reader": [
+ {
+ "kind": "linked",
+ "name": "Page",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Page",
+ "kind": "object",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "keys": {},
+ "is_abstract": false,
+ "possible_types": [
+ "Page"
+ ],
+ "storage_key": {
+ "name": "Page",
+ "arguments": [
+ {
+ "name": "page",
+ "value": {
+ "kind": "constant",
+ "value": {
+ "kind": "int",
+ "value": 1
+ }
+ }
+ },
+ {
+ "name": "perPage",
+ "value": {
+ "kind": "constant",
+ "value": {
+ "kind": "int",
+ "value": 25
+ }
+ }
+ }
+ ]
+ },
+ "lookup": null,
+ "connection": null,
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "linked",
+ "name": "threadComments",
+ "alias": null,
+ "type": {
+ "shape": "list",
+ "element": {
+ "shape": "named",
+ "name": "ThreadComment",
+ "kind": "object",
+ "non_null": false
+ },
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "keys": {
+ "ThreadComment": [
+ "id"
+ ]
+ },
+ "is_abstract": false,
+ "possible_types": [
+ "ThreadComment"
+ ],
+ "storage_key": {
+ "name": "threadComments",
+ "arguments": [
+ {
+ "name": "threadId",
+ "value": {
+ "kind": "variable",
+ "value": "threadId"
+ }
+ }
+ ]
+ },
+ "lookup": null,
+ "connection": null,
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "id",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "id",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "comment",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "String",
+ "kind": "string",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "comment",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "childComments",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Json",
+ "kind": "custom_scalar",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "childComments",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ }
+ ]
+ }
+ ]
+ }
+ ],
+ "normalization": [
+ {
+ "kind": "linked",
+ "name": "Page",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Page",
+ "kind": "object",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "keys": {},
+ "is_abstract": false,
+ "possible_types": [
+ "Page"
+ ],
+ "storage_key": {
+ "name": "Page",
+ "arguments": [
+ {
+ "name": "page",
+ "value": {
+ "kind": "constant",
+ "value": {
+ "kind": "int",
+ "value": 1
+ }
+ }
+ },
+ {
+ "name": "perPage",
+ "value": {
+ "kind": "constant",
+ "value": {
+ "kind": "int",
+ "value": 25
+ }
+ }
+ }
+ ]
+ },
+ "lookup": null,
+ "connection": null,
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "linked",
+ "name": "threadComments",
+ "alias": null,
+ "type": {
+ "shape": "list",
+ "element": {
+ "shape": "named",
+ "name": "ThreadComment",
+ "kind": "object",
+ "non_null": false
+ },
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "keys": {
+ "ThreadComment": [
+ "id"
+ ]
+ },
+ "is_abstract": false,
+ "possible_types": [
+ "ThreadComment"
+ ],
+ "storage_key": {
+ "name": "threadComments",
+ "arguments": [
+ {
+ "name": "threadId",
+ "value": {
+ "kind": "variable",
+ "value": "threadId"
+ }
+ }
+ ]
+ },
+ "lookup": null,
+ "connection": null,
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "id",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "id",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "comment",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "String",
+ "kind": "string",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "comment",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "childComments",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Json",
+ "kind": "custom_scalar",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "childComments",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "ViewerQuery",
+ "source": "swift/Tests/AniListDocuments/AniListShapes.swift",
+ "document": 2,
+ "kind": "query",
+ "root_type": "Query",
+ "variables": [],
+ "text": "query ViewerQuery{Viewer{id,name,avatar{large},unreadNotificationCount,mediaListOptions{scoreFormat,animeList{customLists,advancedScoringEnabled}}}}",
+ "throws_on_field_error": false,
+ "bubbles": false,
+ "has_incremental": false,
+ "error_behavior": null,
+ "reader": [
+ {
+ "kind": "linked",
+ "name": "Viewer",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "User",
+ "kind": "object",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "keys": {
+ "User": [
+ "id"
+ ]
+ },
+ "is_abstract": false,
+ "possible_types": [
+ "User"
+ ],
+ "storage_key": {
+ "name": "Viewer",
+ "arguments": []
+ },
+ "lookup": null,
+ "connection": null,
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "id",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "id",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "name",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "String",
+ "kind": "string",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "name",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "linked",
+ "name": "avatar",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "UserAvatar",
+ "kind": "object",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "keys": {},
+ "is_abstract": false,
+ "possible_types": [
+ "UserAvatar"
+ ],
+ "storage_key": {
+ "name": "avatar",
+ "arguments": []
+ },
+ "lookup": null,
+ "connection": null,
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "large",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "String",
+ "kind": "string",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "large",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ }
+ ]
+ },
+ {
+ "kind": "scalar",
+ "name": "unreadNotificationCount",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "unreadNotificationCount",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "linked",
+ "name": "mediaListOptions",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "MediaListOptions",
+ "kind": "object",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "keys": {},
+ "is_abstract": false,
+ "possible_types": [
+ "MediaListOptions"
+ ],
+ "storage_key": {
+ "name": "mediaListOptions",
+ "arguments": []
+ },
+ "lookup": null,
+ "connection": null,
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "scoreFormat",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "ScoreFormat",
+ "kind": "enum",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "scoreFormat",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "linked",
+ "name": "animeList",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "MediaListTypeOptions",
+ "kind": "object",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "keys": {},
+ "is_abstract": false,
+ "possible_types": [
+ "MediaListTypeOptions"
+ ],
+ "storage_key": {
+ "name": "animeList",
+ "arguments": []
+ },
+ "lookup": null,
+ "connection": null,
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "customLists",
+ "alias": null,
+ "type": {
+ "shape": "list",
+ "element": {
+ "shape": "named",
+ "name": "String",
+ "kind": "string",
+ "non_null": false
+ },
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "customLists",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "advancedScoringEnabled",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Boolean",
+ "kind": "boolean",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "advancedScoringEnabled",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ],
+ "normalization": [
+ {
+ "kind": "linked",
+ "name": "Viewer",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "User",
+ "kind": "object",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "keys": {
+ "User": [
+ "id"
+ ]
+ },
+ "is_abstract": false,
+ "possible_types": [
+ "User"
+ ],
+ "storage_key": {
+ "name": "Viewer",
+ "arguments": []
+ },
+ "lookup": null,
+ "connection": null,
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "id",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "id",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "name",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "String",
+ "kind": "string",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "name",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "linked",
+ "name": "avatar",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "UserAvatar",
+ "kind": "object",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "keys": {},
+ "is_abstract": false,
+ "possible_types": [
+ "UserAvatar"
+ ],
+ "storage_key": {
+ "name": "avatar",
+ "arguments": []
+ },
+ "lookup": null,
+ "connection": null,
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "large",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "String",
+ "kind": "string",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "large",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ }
+ ]
+ },
+ {
+ "kind": "scalar",
+ "name": "unreadNotificationCount",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "unreadNotificationCount",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "linked",
+ "name": "mediaListOptions",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "MediaListOptions",
+ "kind": "object",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "keys": {},
+ "is_abstract": false,
+ "possible_types": [
+ "MediaListOptions"
+ ],
+ "storage_key": {
+ "name": "mediaListOptions",
+ "arguments": []
+ },
+ "lookup": null,
+ "connection": null,
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "scoreFormat",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "ScoreFormat",
+ "kind": "enum",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "scoreFormat",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "linked",
+ "name": "animeList",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "MediaListTypeOptions",
+ "kind": "object",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "keys": {},
+ "is_abstract": false,
+ "possible_types": [
+ "MediaListTypeOptions"
+ ],
+ "storage_key": {
+ "name": "animeList",
+ "arguments": []
+ },
+ "lookup": null,
+ "connection": null,
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "customLists",
+ "alias": null,
+ "type": {
+ "shape": "list",
+ "element": {
+ "shape": "named",
+ "name": "String",
+ "kind": "string",
+ "non_null": false
+ },
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "customLists",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "advancedScoringEnabled",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Boolean",
+ "kind": "boolean",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "advancedScoringEnabled",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ],
+ "enums": {
+ "MediaFormat": [
+ "TV",
+ "TV_SHORT",
+ "MOVIE",
+ "SPECIAL",
+ "OVA",
+ "ONA",
+ "MUSIC",
+ "MANGA",
+ "NOVEL",
+ "ONE_SHOT"
+ ],
+ "MediaRelation": [
+ "ADAPTATION",
+ "PREQUEL",
+ "SEQUEL",
+ "PARENT",
+ "SIDE_STORY",
+ "CHARACTER",
+ "SUMMARY",
+ "ALTERNATIVE",
+ "SPIN_OFF",
+ "OTHER",
+ "SOURCE",
+ "COMPILATION",
+ "CONTAINS",
+ "SAME_UNIVERSE"
+ ],
+ "MediaSeason": [
+ "WINTER",
+ "SPRING",
+ "SUMMER",
+ "FALL"
+ ],
+ "MediaSource": [
+ "ORIGINAL",
+ "MANGA",
+ "LIGHT_NOVEL",
+ "VISUAL_NOVEL",
+ "VIDEO_GAME",
+ "OTHER",
+ "NOVEL",
+ "DOUJINSHI",
+ "ANIME",
+ "WEB_NOVEL",
+ "LIVE_ACTION",
+ "GAME",
+ "COMIC",
+ "MULTIMEDIA_PROJECT",
+ "PICTURE_BOOK"
+ ],
+ "MediaStatus": [
+ "FINISHED",
+ "RELEASING",
+ "NOT_YET_RELEASED",
+ "CANCELLED",
+ "HIATUS"
+ ],
+ "MediaType": [
+ "ANIME",
+ "MANGA"
+ ],
+ "ScoreFormat": [
+ "POINT_100",
+ "POINT_10_DECIMAL",
+ "POINT_10",
+ "POINT_5",
+ "POINT_3"
+ ]
+ }
+}
diff --git a/compiler/src/tests/plans/ConditionDocuments.plan.json b/compiler/src/tests/plans/ConditionDocuments.plan.json
index 3748d967..91ceb296 100644
--- a/compiler/src/tests/plans/ConditionDocuments.plan.json
+++ b/compiler/src/tests/plans/ConditionDocuments.plan.json
@@ -2029,6 +2029,2663 @@
}
]
},
+ {
+ "name": "TestNotifications",
+ "source": "swift/Tests/BatonTests/ConditionDocuments.swift",
+ "document": 9,
+ "kind": "query",
+ "root_type": "Query",
+ "variables": [],
+ "text": "query TestNotifications{Notification{__typename,...on AiringNotification{id,episode},...on FollowingNotification{id,userId},...on ActivityMessageNotification{id,activityId},...on ActivityMentionNotification{id,activityId},...on ActivityReplyNotification{id,activityId},...on ActivityReplySubscribedNotification{id,activityId},...on ActivityLikeNotification{id,activityId},...on ActivityReplyLikeNotification{id,activityId},...on ThreadCommentMentionNotification{id,commentId},...on ThreadCommentReplyNotification{id,commentId},...on ThreadCommentSubscribedNotification{id,commentId},...on ThreadCommentLikeNotification{id,commentId},...on ThreadLikeNotification{id,threadId},...on RelatedMediaAdditionNotification{id,mediaId},...on MediaDataChangeNotification{id,reason},...on MediaMergeNotification{id,deletedMediaTitles},...on MediaDeletionNotification{id,deletedMediaTitle},...on MediaSubmissionUpdateNotification{id,status},...on StaffSubmissionUpdateNotification{id,status},...on CharacterSubmissionUpdateNotification{id,status}}}",
+ "throws_on_field_error": false,
+ "bubbles": false,
+ "has_incremental": false,
+ "error_behavior": null,
+ "reader": [
+ {
+ "kind": "linked",
+ "name": "Notification",
+ "alias": null,
+ "type": {
+ "shape": "list",
+ "element": {
+ "shape": "named",
+ "name": "NotificationUnion",
+ "kind": "union",
+ "non_null": false
+ },
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "keys": {
+ "ActivityLikeNotification": [
+ "id"
+ ],
+ "ActivityMentionNotification": [
+ "id"
+ ],
+ "ActivityMessageNotification": [
+ "id"
+ ],
+ "ActivityReplyLikeNotification": [
+ "id"
+ ],
+ "ActivityReplyNotification": [
+ "id"
+ ],
+ "ActivityReplySubscribedNotification": [
+ "id"
+ ],
+ "AiringNotification": [
+ "id"
+ ],
+ "CharacterSubmissionUpdateNotification": [
+ "id"
+ ],
+ "FollowingNotification": [
+ "id"
+ ],
+ "MediaDataChangeNotification": [
+ "id"
+ ],
+ "MediaDeletionNotification": [
+ "id"
+ ],
+ "MediaMergeNotification": [
+ "id"
+ ],
+ "MediaSubmissionUpdateNotification": [
+ "id"
+ ],
+ "RelatedMediaAdditionNotification": [
+ "id"
+ ],
+ "StaffSubmissionUpdateNotification": [
+ "id"
+ ],
+ "ThreadCommentLikeNotification": [
+ "id"
+ ],
+ "ThreadCommentMentionNotification": [
+ "id"
+ ],
+ "ThreadCommentReplyNotification": [
+ "id"
+ ],
+ "ThreadCommentSubscribedNotification": [
+ "id"
+ ],
+ "ThreadLikeNotification": [
+ "id"
+ ]
+ },
+ "is_abstract": true,
+ "possible_types": [
+ "ActivityLikeNotification",
+ "ActivityMentionNotification",
+ "ActivityMessageNotification",
+ "ActivityReplyLikeNotification",
+ "ActivityReplyNotification",
+ "ActivityReplySubscribedNotification",
+ "AiringNotification",
+ "CharacterSubmissionUpdateNotification",
+ "FollowingNotification",
+ "MediaDataChangeNotification",
+ "MediaDeletionNotification",
+ "MediaMergeNotification",
+ "MediaSubmissionUpdateNotification",
+ "RelatedMediaAdditionNotification",
+ "StaffSubmissionUpdateNotification",
+ "ThreadCommentLikeNotification",
+ "ThreadCommentMentionNotification",
+ "ThreadCommentReplyNotification",
+ "ThreadCommentSubscribedNotification",
+ "ThreadLikeNotification"
+ ],
+ "storage_key": {
+ "name": "Notification",
+ "arguments": []
+ },
+ "lookup": null,
+ "connection": null,
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "__typename",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "String",
+ "kind": "string",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "__typename",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "inline",
+ "type_condition": "AiringNotification",
+ "condition_types": [
+ "AiringNotification"
+ ],
+ "condition_class": {
+ "kind": "concrete",
+ "type": "AiringNotification"
+ },
+ "alias": null,
+ "deferred": null,
+ "catch": null,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "id",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "ID",
+ "kind": "id",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "id",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "episode",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "episode",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ }
+ ]
+ },
+ {
+ "kind": "inline",
+ "type_condition": "FollowingNotification",
+ "condition_types": [
+ "FollowingNotification"
+ ],
+ "condition_class": {
+ "kind": "concrete",
+ "type": "FollowingNotification"
+ },
+ "alias": null,
+ "deferred": null,
+ "catch": null,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "id",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "ID",
+ "kind": "id",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "id",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "userId",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "ID",
+ "kind": "id",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "userId",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ }
+ ]
+ },
+ {
+ "kind": "inline",
+ "type_condition": "ActivityMessageNotification",
+ "condition_types": [
+ "ActivityMessageNotification"
+ ],
+ "condition_class": {
+ "kind": "concrete",
+ "type": "ActivityMessageNotification"
+ },
+ "alias": null,
+ "deferred": null,
+ "catch": null,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "id",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "ID",
+ "kind": "id",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "id",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "activityId",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "ID",
+ "kind": "id",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "activityId",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ }
+ ]
+ },
+ {
+ "kind": "inline",
+ "type_condition": "ActivityMentionNotification",
+ "condition_types": [
+ "ActivityMentionNotification"
+ ],
+ "condition_class": {
+ "kind": "concrete",
+ "type": "ActivityMentionNotification"
+ },
+ "alias": null,
+ "deferred": null,
+ "catch": null,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "id",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "ID",
+ "kind": "id",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "id",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "activityId",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "ID",
+ "kind": "id",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "activityId",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ }
+ ]
+ },
+ {
+ "kind": "inline",
+ "type_condition": "ActivityReplyNotification",
+ "condition_types": [
+ "ActivityReplyNotification"
+ ],
+ "condition_class": {
+ "kind": "concrete",
+ "type": "ActivityReplyNotification"
+ },
+ "alias": null,
+ "deferred": null,
+ "catch": null,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "id",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "ID",
+ "kind": "id",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "id",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "activityId",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "ID",
+ "kind": "id",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "activityId",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ }
+ ]
+ },
+ {
+ "kind": "inline",
+ "type_condition": "ActivityReplySubscribedNotification",
+ "condition_types": [
+ "ActivityReplySubscribedNotification"
+ ],
+ "condition_class": {
+ "kind": "concrete",
+ "type": "ActivityReplySubscribedNotification"
+ },
+ "alias": null,
+ "deferred": null,
+ "catch": null,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "id",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "ID",
+ "kind": "id",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "id",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "activityId",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "ID",
+ "kind": "id",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "activityId",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ }
+ ]
+ },
+ {
+ "kind": "inline",
+ "type_condition": "ActivityLikeNotification",
+ "condition_types": [
+ "ActivityLikeNotification"
+ ],
+ "condition_class": {
+ "kind": "concrete",
+ "type": "ActivityLikeNotification"
+ },
+ "alias": null,
+ "deferred": null,
+ "catch": null,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "id",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "ID",
+ "kind": "id",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "id",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "activityId",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "ID",
+ "kind": "id",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "activityId",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ }
+ ]
+ },
+ {
+ "kind": "inline",
+ "type_condition": "ActivityReplyLikeNotification",
+ "condition_types": [
+ "ActivityReplyLikeNotification"
+ ],
+ "condition_class": {
+ "kind": "concrete",
+ "type": "ActivityReplyLikeNotification"
+ },
+ "alias": null,
+ "deferred": null,
+ "catch": null,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "id",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "ID",
+ "kind": "id",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "id",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "activityId",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "ID",
+ "kind": "id",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "activityId",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ }
+ ]
+ },
+ {
+ "kind": "inline",
+ "type_condition": "ThreadCommentMentionNotification",
+ "condition_types": [
+ "ThreadCommentMentionNotification"
+ ],
+ "condition_class": {
+ "kind": "concrete",
+ "type": "ThreadCommentMentionNotification"
+ },
+ "alias": null,
+ "deferred": null,
+ "catch": null,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "id",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "ID",
+ "kind": "id",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "id",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "commentId",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "ID",
+ "kind": "id",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "commentId",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ }
+ ]
+ },
+ {
+ "kind": "inline",
+ "type_condition": "ThreadCommentReplyNotification",
+ "condition_types": [
+ "ThreadCommentReplyNotification"
+ ],
+ "condition_class": {
+ "kind": "concrete",
+ "type": "ThreadCommentReplyNotification"
+ },
+ "alias": null,
+ "deferred": null,
+ "catch": null,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "id",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "ID",
+ "kind": "id",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "id",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "commentId",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "ID",
+ "kind": "id",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "commentId",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ }
+ ]
+ },
+ {
+ "kind": "inline",
+ "type_condition": "ThreadCommentSubscribedNotification",
+ "condition_types": [
+ "ThreadCommentSubscribedNotification"
+ ],
+ "condition_class": {
+ "kind": "concrete",
+ "type": "ThreadCommentSubscribedNotification"
+ },
+ "alias": null,
+ "deferred": null,
+ "catch": null,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "id",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "ID",
+ "kind": "id",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "id",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "commentId",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "ID",
+ "kind": "id",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "commentId",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ }
+ ]
+ },
+ {
+ "kind": "inline",
+ "type_condition": "ThreadCommentLikeNotification",
+ "condition_types": [
+ "ThreadCommentLikeNotification"
+ ],
+ "condition_class": {
+ "kind": "concrete",
+ "type": "ThreadCommentLikeNotification"
+ },
+ "alias": null,
+ "deferred": null,
+ "catch": null,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "id",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "ID",
+ "kind": "id",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "id",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "commentId",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "ID",
+ "kind": "id",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "commentId",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ }
+ ]
+ },
+ {
+ "kind": "inline",
+ "type_condition": "ThreadLikeNotification",
+ "condition_types": [
+ "ThreadLikeNotification"
+ ],
+ "condition_class": {
+ "kind": "concrete",
+ "type": "ThreadLikeNotification"
+ },
+ "alias": null,
+ "deferred": null,
+ "catch": null,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "id",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "ID",
+ "kind": "id",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "id",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "threadId",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "ID",
+ "kind": "id",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "threadId",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ }
+ ]
+ },
+ {
+ "kind": "inline",
+ "type_condition": "RelatedMediaAdditionNotification",
+ "condition_types": [
+ "RelatedMediaAdditionNotification"
+ ],
+ "condition_class": {
+ "kind": "concrete",
+ "type": "RelatedMediaAdditionNotification"
+ },
+ "alias": null,
+ "deferred": null,
+ "catch": null,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "id",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "ID",
+ "kind": "id",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "id",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "mediaId",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "ID",
+ "kind": "id",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "mediaId",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ }
+ ]
+ },
+ {
+ "kind": "inline",
+ "type_condition": "MediaDataChangeNotification",
+ "condition_types": [
+ "MediaDataChangeNotification"
+ ],
+ "condition_class": {
+ "kind": "concrete",
+ "type": "MediaDataChangeNotification"
+ },
+ "alias": null,
+ "deferred": null,
+ "catch": null,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "id",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "ID",
+ "kind": "id",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "id",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "reason",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "String",
+ "kind": "string",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "reason",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ }
+ ]
+ },
+ {
+ "kind": "inline",
+ "type_condition": "MediaMergeNotification",
+ "condition_types": [
+ "MediaMergeNotification"
+ ],
+ "condition_class": {
+ "kind": "concrete",
+ "type": "MediaMergeNotification"
+ },
+ "alias": null,
+ "deferred": null,
+ "catch": null,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "id",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "ID",
+ "kind": "id",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "id",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "deletedMediaTitles",
+ "alias": null,
+ "type": {
+ "shape": "list",
+ "element": {
+ "shape": "named",
+ "name": "String",
+ "kind": "string",
+ "non_null": false
+ },
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "deletedMediaTitles",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ }
+ ]
+ },
+ {
+ "kind": "inline",
+ "type_condition": "MediaDeletionNotification",
+ "condition_types": [
+ "MediaDeletionNotification"
+ ],
+ "condition_class": {
+ "kind": "concrete",
+ "type": "MediaDeletionNotification"
+ },
+ "alias": null,
+ "deferred": null,
+ "catch": null,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "id",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "ID",
+ "kind": "id",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "id",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "deletedMediaTitle",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "String",
+ "kind": "string",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "deletedMediaTitle",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ }
+ ]
+ },
+ {
+ "kind": "inline",
+ "type_condition": "MediaSubmissionUpdateNotification",
+ "condition_types": [
+ "MediaSubmissionUpdateNotification"
+ ],
+ "condition_class": {
+ "kind": "concrete",
+ "type": "MediaSubmissionUpdateNotification"
+ },
+ "alias": null,
+ "deferred": null,
+ "catch": null,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "id",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "ID",
+ "kind": "id",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "id",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "status",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "String",
+ "kind": "string",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "status",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ }
+ ]
+ },
+ {
+ "kind": "inline",
+ "type_condition": "StaffSubmissionUpdateNotification",
+ "condition_types": [
+ "StaffSubmissionUpdateNotification"
+ ],
+ "condition_class": {
+ "kind": "concrete",
+ "type": "StaffSubmissionUpdateNotification"
+ },
+ "alias": null,
+ "deferred": null,
+ "catch": null,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "id",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "ID",
+ "kind": "id",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "id",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "status",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "String",
+ "kind": "string",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "status",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ }
+ ]
+ },
+ {
+ "kind": "inline",
+ "type_condition": "CharacterSubmissionUpdateNotification",
+ "condition_types": [
+ "CharacterSubmissionUpdateNotification"
+ ],
+ "condition_class": {
+ "kind": "concrete",
+ "type": "CharacterSubmissionUpdateNotification"
+ },
+ "alias": null,
+ "deferred": null,
+ "catch": null,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "id",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "ID",
+ "kind": "id",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "id",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "status",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "String",
+ "kind": "string",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "status",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ }
+ ]
+ }
+ ]
+ }
+ ],
+ "normalization": [
+ {
+ "kind": "linked",
+ "name": "Notification",
+ "alias": null,
+ "type": {
+ "shape": "list",
+ "element": {
+ "shape": "named",
+ "name": "NotificationUnion",
+ "kind": "union",
+ "non_null": false
+ },
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "keys": {
+ "ActivityLikeNotification": [
+ "id"
+ ],
+ "ActivityMentionNotification": [
+ "id"
+ ],
+ "ActivityMessageNotification": [
+ "id"
+ ],
+ "ActivityReplyLikeNotification": [
+ "id"
+ ],
+ "ActivityReplyNotification": [
+ "id"
+ ],
+ "ActivityReplySubscribedNotification": [
+ "id"
+ ],
+ "AiringNotification": [
+ "id"
+ ],
+ "CharacterSubmissionUpdateNotification": [
+ "id"
+ ],
+ "FollowingNotification": [
+ "id"
+ ],
+ "MediaDataChangeNotification": [
+ "id"
+ ],
+ "MediaDeletionNotification": [
+ "id"
+ ],
+ "MediaMergeNotification": [
+ "id"
+ ],
+ "MediaSubmissionUpdateNotification": [
+ "id"
+ ],
+ "RelatedMediaAdditionNotification": [
+ "id"
+ ],
+ "StaffSubmissionUpdateNotification": [
+ "id"
+ ],
+ "ThreadCommentLikeNotification": [
+ "id"
+ ],
+ "ThreadCommentMentionNotification": [
+ "id"
+ ],
+ "ThreadCommentReplyNotification": [
+ "id"
+ ],
+ "ThreadCommentSubscribedNotification": [
+ "id"
+ ],
+ "ThreadLikeNotification": [
+ "id"
+ ]
+ },
+ "is_abstract": true,
+ "possible_types": [
+ "ActivityLikeNotification",
+ "ActivityMentionNotification",
+ "ActivityMessageNotification",
+ "ActivityReplyLikeNotification",
+ "ActivityReplyNotification",
+ "ActivityReplySubscribedNotification",
+ "AiringNotification",
+ "CharacterSubmissionUpdateNotification",
+ "FollowingNotification",
+ "MediaDataChangeNotification",
+ "MediaDeletionNotification",
+ "MediaMergeNotification",
+ "MediaSubmissionUpdateNotification",
+ "RelatedMediaAdditionNotification",
+ "StaffSubmissionUpdateNotification",
+ "ThreadCommentLikeNotification",
+ "ThreadCommentMentionNotification",
+ "ThreadCommentReplyNotification",
+ "ThreadCommentSubscribedNotification",
+ "ThreadLikeNotification"
+ ],
+ "storage_key": {
+ "name": "Notification",
+ "arguments": []
+ },
+ "lookup": null,
+ "connection": null,
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "__typename",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "String",
+ "kind": "string",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "__typename",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "inline",
+ "type_condition": "AiringNotification",
+ "condition_types": [
+ "AiringNotification"
+ ],
+ "condition_class": {
+ "kind": "concrete",
+ "type": "AiringNotification"
+ },
+ "alias": null,
+ "deferred": null,
+ "catch": null,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "id",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "ID",
+ "kind": "id",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "id",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "episode",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Int",
+ "kind": "int",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "episode",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ }
+ ]
+ },
+ {
+ "kind": "inline",
+ "type_condition": "FollowingNotification",
+ "condition_types": [
+ "FollowingNotification"
+ ],
+ "condition_class": {
+ "kind": "concrete",
+ "type": "FollowingNotification"
+ },
+ "alias": null,
+ "deferred": null,
+ "catch": null,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "id",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "ID",
+ "kind": "id",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "id",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "userId",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "ID",
+ "kind": "id",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "userId",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ }
+ ]
+ },
+ {
+ "kind": "inline",
+ "type_condition": "ActivityMessageNotification",
+ "condition_types": [
+ "ActivityMessageNotification"
+ ],
+ "condition_class": {
+ "kind": "concrete",
+ "type": "ActivityMessageNotification"
+ },
+ "alias": null,
+ "deferred": null,
+ "catch": null,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "id",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "ID",
+ "kind": "id",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "id",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "activityId",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "ID",
+ "kind": "id",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "activityId",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ }
+ ]
+ },
+ {
+ "kind": "inline",
+ "type_condition": "ActivityMentionNotification",
+ "condition_types": [
+ "ActivityMentionNotification"
+ ],
+ "condition_class": {
+ "kind": "concrete",
+ "type": "ActivityMentionNotification"
+ },
+ "alias": null,
+ "deferred": null,
+ "catch": null,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "id",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "ID",
+ "kind": "id",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "id",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "activityId",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "ID",
+ "kind": "id",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "activityId",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ }
+ ]
+ },
+ {
+ "kind": "inline",
+ "type_condition": "ActivityReplyNotification",
+ "condition_types": [
+ "ActivityReplyNotification"
+ ],
+ "condition_class": {
+ "kind": "concrete",
+ "type": "ActivityReplyNotification"
+ },
+ "alias": null,
+ "deferred": null,
+ "catch": null,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "id",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "ID",
+ "kind": "id",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "id",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "activityId",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "ID",
+ "kind": "id",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "activityId",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ }
+ ]
+ },
+ {
+ "kind": "inline",
+ "type_condition": "ActivityReplySubscribedNotification",
+ "condition_types": [
+ "ActivityReplySubscribedNotification"
+ ],
+ "condition_class": {
+ "kind": "concrete",
+ "type": "ActivityReplySubscribedNotification"
+ },
+ "alias": null,
+ "deferred": null,
+ "catch": null,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "id",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "ID",
+ "kind": "id",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "id",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "activityId",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "ID",
+ "kind": "id",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "activityId",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ }
+ ]
+ },
+ {
+ "kind": "inline",
+ "type_condition": "ActivityLikeNotification",
+ "condition_types": [
+ "ActivityLikeNotification"
+ ],
+ "condition_class": {
+ "kind": "concrete",
+ "type": "ActivityLikeNotification"
+ },
+ "alias": null,
+ "deferred": null,
+ "catch": null,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "id",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "ID",
+ "kind": "id",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "id",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "activityId",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "ID",
+ "kind": "id",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "activityId",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ }
+ ]
+ },
+ {
+ "kind": "inline",
+ "type_condition": "ActivityReplyLikeNotification",
+ "condition_types": [
+ "ActivityReplyLikeNotification"
+ ],
+ "condition_class": {
+ "kind": "concrete",
+ "type": "ActivityReplyLikeNotification"
+ },
+ "alias": null,
+ "deferred": null,
+ "catch": null,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "id",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "ID",
+ "kind": "id",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "id",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "activityId",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "ID",
+ "kind": "id",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "activityId",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ }
+ ]
+ },
+ {
+ "kind": "inline",
+ "type_condition": "ThreadCommentMentionNotification",
+ "condition_types": [
+ "ThreadCommentMentionNotification"
+ ],
+ "condition_class": {
+ "kind": "concrete",
+ "type": "ThreadCommentMentionNotification"
+ },
+ "alias": null,
+ "deferred": null,
+ "catch": null,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "id",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "ID",
+ "kind": "id",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "id",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "commentId",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "ID",
+ "kind": "id",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "commentId",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ }
+ ]
+ },
+ {
+ "kind": "inline",
+ "type_condition": "ThreadCommentReplyNotification",
+ "condition_types": [
+ "ThreadCommentReplyNotification"
+ ],
+ "condition_class": {
+ "kind": "concrete",
+ "type": "ThreadCommentReplyNotification"
+ },
+ "alias": null,
+ "deferred": null,
+ "catch": null,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "id",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "ID",
+ "kind": "id",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "id",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "commentId",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "ID",
+ "kind": "id",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "commentId",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ }
+ ]
+ },
+ {
+ "kind": "inline",
+ "type_condition": "ThreadCommentSubscribedNotification",
+ "condition_types": [
+ "ThreadCommentSubscribedNotification"
+ ],
+ "condition_class": {
+ "kind": "concrete",
+ "type": "ThreadCommentSubscribedNotification"
+ },
+ "alias": null,
+ "deferred": null,
+ "catch": null,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "id",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "ID",
+ "kind": "id",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "id",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "commentId",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "ID",
+ "kind": "id",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "commentId",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ }
+ ]
+ },
+ {
+ "kind": "inline",
+ "type_condition": "ThreadCommentLikeNotification",
+ "condition_types": [
+ "ThreadCommentLikeNotification"
+ ],
+ "condition_class": {
+ "kind": "concrete",
+ "type": "ThreadCommentLikeNotification"
+ },
+ "alias": null,
+ "deferred": null,
+ "catch": null,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "id",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "ID",
+ "kind": "id",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "id",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "commentId",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "ID",
+ "kind": "id",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "commentId",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ }
+ ]
+ },
+ {
+ "kind": "inline",
+ "type_condition": "ThreadLikeNotification",
+ "condition_types": [
+ "ThreadLikeNotification"
+ ],
+ "condition_class": {
+ "kind": "concrete",
+ "type": "ThreadLikeNotification"
+ },
+ "alias": null,
+ "deferred": null,
+ "catch": null,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "id",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "ID",
+ "kind": "id",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "id",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "threadId",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "ID",
+ "kind": "id",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "threadId",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ }
+ ]
+ },
+ {
+ "kind": "inline",
+ "type_condition": "RelatedMediaAdditionNotification",
+ "condition_types": [
+ "RelatedMediaAdditionNotification"
+ ],
+ "condition_class": {
+ "kind": "concrete",
+ "type": "RelatedMediaAdditionNotification"
+ },
+ "alias": null,
+ "deferred": null,
+ "catch": null,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "id",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "ID",
+ "kind": "id",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "id",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "mediaId",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "ID",
+ "kind": "id",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "mediaId",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ }
+ ]
+ },
+ {
+ "kind": "inline",
+ "type_condition": "MediaDataChangeNotification",
+ "condition_types": [
+ "MediaDataChangeNotification"
+ ],
+ "condition_class": {
+ "kind": "concrete",
+ "type": "MediaDataChangeNotification"
+ },
+ "alias": null,
+ "deferred": null,
+ "catch": null,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "id",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "ID",
+ "kind": "id",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "id",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "reason",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "String",
+ "kind": "string",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "reason",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ }
+ ]
+ },
+ {
+ "kind": "inline",
+ "type_condition": "MediaMergeNotification",
+ "condition_types": [
+ "MediaMergeNotification"
+ ],
+ "condition_class": {
+ "kind": "concrete",
+ "type": "MediaMergeNotification"
+ },
+ "alias": null,
+ "deferred": null,
+ "catch": null,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "id",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "ID",
+ "kind": "id",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "id",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "deletedMediaTitles",
+ "alias": null,
+ "type": {
+ "shape": "list",
+ "element": {
+ "shape": "named",
+ "name": "String",
+ "kind": "string",
+ "non_null": false
+ },
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "deletedMediaTitles",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ }
+ ]
+ },
+ {
+ "kind": "inline",
+ "type_condition": "MediaDeletionNotification",
+ "condition_types": [
+ "MediaDeletionNotification"
+ ],
+ "condition_class": {
+ "kind": "concrete",
+ "type": "MediaDeletionNotification"
+ },
+ "alias": null,
+ "deferred": null,
+ "catch": null,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "id",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "ID",
+ "kind": "id",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "id",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "deletedMediaTitle",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "String",
+ "kind": "string",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "deletedMediaTitle",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ }
+ ]
+ },
+ {
+ "kind": "inline",
+ "type_condition": "MediaSubmissionUpdateNotification",
+ "condition_types": [
+ "MediaSubmissionUpdateNotification"
+ ],
+ "condition_class": {
+ "kind": "concrete",
+ "type": "MediaSubmissionUpdateNotification"
+ },
+ "alias": null,
+ "deferred": null,
+ "catch": null,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "id",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "ID",
+ "kind": "id",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "id",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "status",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "String",
+ "kind": "string",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "status",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ }
+ ]
+ },
+ {
+ "kind": "inline",
+ "type_condition": "StaffSubmissionUpdateNotification",
+ "condition_types": [
+ "StaffSubmissionUpdateNotification"
+ ],
+ "condition_class": {
+ "kind": "concrete",
+ "type": "StaffSubmissionUpdateNotification"
+ },
+ "alias": null,
+ "deferred": null,
+ "catch": null,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "id",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "ID",
+ "kind": "id",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "id",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "status",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "String",
+ "kind": "string",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "status",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ }
+ ]
+ },
+ {
+ "kind": "inline",
+ "type_condition": "CharacterSubmissionUpdateNotification",
+ "condition_types": [
+ "CharacterSubmissionUpdateNotification"
+ ],
+ "condition_class": {
+ "kind": "concrete",
+ "type": "CharacterSubmissionUpdateNotification"
+ },
+ "alias": null,
+ "deferred": null,
+ "catch": null,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "id",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "ID",
+ "kind": "id",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "id",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "status",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "String",
+ "kind": "string",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "status",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
{
"name": "TestStrictConditions",
"source": "swift/Tests/BatonTests/ConditionDocuments.swift",
diff --git a/compiler/src/tests/plans/EnumDocuments.plan.json b/compiler/src/tests/plans/EnumDocuments.plan.json
index 3581227b..213ca216 100644
--- a/compiler/src/tests/plans/EnumDocuments.plan.json
+++ b/compiler/src/tests/plans/EnumDocuments.plan.json
@@ -214,6 +214,296 @@
}
]
},
+ {
+ "name": "TestEpisodeStatus",
+ "source": "swift/Tests/BatonTests/EnumDocuments.swift",
+ "document": 2,
+ "kind": "query",
+ "root_type": "Query",
+ "variables": [
+ {
+ "name": "id",
+ "type": {
+ "shape": "named",
+ "name": "ID",
+ "kind": "id",
+ "non_null": true
+ },
+ "default_value": null
+ }
+ ],
+ "text": "query TestEpisodeStatus($id:ID!){episode(id:$id){id,status,hiatus:status(version:2)}}",
+ "throws_on_field_error": false,
+ "bubbles": false,
+ "has_incremental": false,
+ "error_behavior": null,
+ "reader": [
+ {
+ "kind": "linked",
+ "name": "episode",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Episode",
+ "kind": "object",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "keys": {
+ "Episode": [
+ "id"
+ ]
+ },
+ "is_abstract": false,
+ "possible_types": [
+ "Episode"
+ ],
+ "storage_key": {
+ "name": "episode",
+ "arguments": [
+ {
+ "name": "id",
+ "value": {
+ "kind": "variable",
+ "value": "id"
+ }
+ }
+ ]
+ },
+ "lookup": {
+ "type_name": "Episode",
+ "possible_types": [
+ "Episode"
+ ],
+ "arguments": [
+ {
+ "name": "id",
+ "value": {
+ "kind": "variable",
+ "value": "id"
+ }
+ }
+ ]
+ },
+ "connection": null,
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "id",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "ID",
+ "kind": "id",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "id",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "status",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "EpisodeStatus",
+ "kind": "enum",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "status",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "status",
+ "alias": "hiatus",
+ "type": {
+ "shape": "named",
+ "name": "EpisodeStatus",
+ "kind": "enum",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "status",
+ "arguments": [
+ {
+ "name": "version",
+ "value": {
+ "kind": "constant",
+ "value": {
+ "kind": "int",
+ "value": 2
+ }
+ }
+ }
+ ]
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ }
+ ]
+ }
+ ],
+ "normalization": [
+ {
+ "kind": "linked",
+ "name": "episode",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Episode",
+ "kind": "object",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "keys": {
+ "Episode": [
+ "id"
+ ]
+ },
+ "is_abstract": false,
+ "possible_types": [
+ "Episode"
+ ],
+ "storage_key": {
+ "name": "episode",
+ "arguments": [
+ {
+ "name": "id",
+ "value": {
+ "kind": "variable",
+ "value": "id"
+ }
+ }
+ ]
+ },
+ "lookup": {
+ "type_name": "Episode",
+ "possible_types": [
+ "Episode"
+ ],
+ "arguments": [
+ {
+ "name": "id",
+ "value": {
+ "kind": "variable",
+ "value": "id"
+ }
+ }
+ ]
+ },
+ "connection": null,
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "id",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "ID",
+ "kind": "id",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "id",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "status",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "EpisodeStatus",
+ "kind": "enum",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "status",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "status",
+ "alias": "hiatus",
+ "type": {
+ "shape": "named",
+ "name": "EpisodeStatus",
+ "kind": "enum",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "status",
+ "arguments": [
+ {
+ "name": "version",
+ "value": {
+ "kind": "constant",
+ "value": {
+ "kind": "int",
+ "value": 2
+ }
+ }
+ }
+ ]
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ }
+ ]
+ }
+ ]
+ },
{
"name": "TestSetStatuses",
"source": "swift/Tests/BatonTests/EnumDocuments.swift",
@@ -345,6 +635,13 @@
}
],
"enums": {
+ "EpisodeStatus": [
+ "FINISHED",
+ "RELEASING",
+ "NOT_YET_RELEASED",
+ "CANCELLED",
+ "HIATUS"
+ ],
"Status": [
"ALIVE",
"DEAD",
diff --git a/compiler/src/tests/plans/NameDocuments.plan.json b/compiler/src/tests/plans/NameDocuments.plan.json
index 912a3328..d7ca89e5 100644
--- a/compiler/src/tests/plans/NameDocuments.plan.json
+++ b/compiler/src/tests/plans/NameDocuments.plan.json
@@ -1,6 +1,1440 @@
{
"fragments": [],
"operations": [
+ {
+ "name": "TestCapitalizedRoots",
+ "source": "swift/Tests/BatonTests/NameDocuments.swift",
+ "document": 3,
+ "kind": "query",
+ "root_type": "Query",
+ "variables": [
+ {
+ "name": "id",
+ "type": {
+ "shape": "named",
+ "name": "ID",
+ "kind": "id",
+ "non_null": true
+ },
+ "default_value": null
+ }
+ ],
+ "text": "query TestCapitalizedRoots($id:ID!){Episode(id:$id){id,name},Viewer{id,name},GenreCollection,Notification{__typename,...on ActivityLikeNotification{id},...on ActivityMentionNotification{id},...on ActivityMessageNotification{id},...on ActivityReplyLikeNotification{id},...on ActivityReplyNotification{id},...on ActivityReplySubscribedNotification{id},...on AiringNotification{id},...on CharacterSubmissionUpdateNotification{id},...on FollowingNotification{id},...on MediaDataChangeNotification{id},...on MediaDeletionNotification{id},...on MediaMergeNotification{id},...on MediaSubmissionUpdateNotification{id},...on RelatedMediaAdditionNotification{id},...on StaffSubmissionUpdateNotification{id},...on ThreadCommentLikeNotification{id},...on ThreadCommentMentionNotification{id},...on ThreadCommentReplyNotification{id},...on ThreadCommentSubscribedNotification{id},...on ThreadLikeNotification{id}}}",
+ "throws_on_field_error": false,
+ "bubbles": false,
+ "has_incremental": false,
+ "error_behavior": null,
+ "reader": [
+ {
+ "kind": "linked",
+ "name": "Episode",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Episode",
+ "kind": "object",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "keys": {
+ "Episode": [
+ "id"
+ ]
+ },
+ "is_abstract": false,
+ "possible_types": [
+ "Episode"
+ ],
+ "storage_key": {
+ "name": "Episode",
+ "arguments": [
+ {
+ "name": "id",
+ "value": {
+ "kind": "variable",
+ "value": "id"
+ }
+ }
+ ]
+ },
+ "lookup": null,
+ "connection": null,
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "id",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "ID",
+ "kind": "id",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "id",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "name",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "String",
+ "kind": "string",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "name",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ }
+ ]
+ },
+ {
+ "kind": "linked",
+ "name": "Viewer",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Character",
+ "kind": "object",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "keys": {
+ "Character": [
+ "id"
+ ]
+ },
+ "is_abstract": false,
+ "possible_types": [
+ "Character"
+ ],
+ "storage_key": {
+ "name": "Viewer",
+ "arguments": []
+ },
+ "lookup": null,
+ "connection": null,
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "id",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "ID",
+ "kind": "id",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "id",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "name",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "String",
+ "kind": "string",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "name",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ }
+ ]
+ },
+ {
+ "kind": "scalar",
+ "name": "GenreCollection",
+ "alias": null,
+ "type": {
+ "shape": "list",
+ "element": {
+ "shape": "named",
+ "name": "String",
+ "kind": "string",
+ "non_null": false
+ },
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "GenreCollection",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "linked",
+ "name": "Notification",
+ "alias": null,
+ "type": {
+ "shape": "list",
+ "element": {
+ "shape": "named",
+ "name": "NotificationUnion",
+ "kind": "union",
+ "non_null": false
+ },
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "keys": {
+ "ActivityLikeNotification": [
+ "id"
+ ],
+ "ActivityMentionNotification": [
+ "id"
+ ],
+ "ActivityMessageNotification": [
+ "id"
+ ],
+ "ActivityReplyLikeNotification": [
+ "id"
+ ],
+ "ActivityReplyNotification": [
+ "id"
+ ],
+ "ActivityReplySubscribedNotification": [
+ "id"
+ ],
+ "AiringNotification": [
+ "id"
+ ],
+ "CharacterSubmissionUpdateNotification": [
+ "id"
+ ],
+ "FollowingNotification": [
+ "id"
+ ],
+ "MediaDataChangeNotification": [
+ "id"
+ ],
+ "MediaDeletionNotification": [
+ "id"
+ ],
+ "MediaMergeNotification": [
+ "id"
+ ],
+ "MediaSubmissionUpdateNotification": [
+ "id"
+ ],
+ "RelatedMediaAdditionNotification": [
+ "id"
+ ],
+ "StaffSubmissionUpdateNotification": [
+ "id"
+ ],
+ "ThreadCommentLikeNotification": [
+ "id"
+ ],
+ "ThreadCommentMentionNotification": [
+ "id"
+ ],
+ "ThreadCommentReplyNotification": [
+ "id"
+ ],
+ "ThreadCommentSubscribedNotification": [
+ "id"
+ ],
+ "ThreadLikeNotification": [
+ "id"
+ ]
+ },
+ "is_abstract": true,
+ "possible_types": [
+ "ActivityLikeNotification",
+ "ActivityMentionNotification",
+ "ActivityMessageNotification",
+ "ActivityReplyLikeNotification",
+ "ActivityReplyNotification",
+ "ActivityReplySubscribedNotification",
+ "AiringNotification",
+ "CharacterSubmissionUpdateNotification",
+ "FollowingNotification",
+ "MediaDataChangeNotification",
+ "MediaDeletionNotification",
+ "MediaMergeNotification",
+ "MediaSubmissionUpdateNotification",
+ "RelatedMediaAdditionNotification",
+ "StaffSubmissionUpdateNotification",
+ "ThreadCommentLikeNotification",
+ "ThreadCommentMentionNotification",
+ "ThreadCommentReplyNotification",
+ "ThreadCommentSubscribedNotification",
+ "ThreadLikeNotification"
+ ],
+ "storage_key": {
+ "name": "Notification",
+ "arguments": []
+ },
+ "lookup": null,
+ "connection": null,
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "__typename",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "String",
+ "kind": "string",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "__typename",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ }
+ ]
+ }
+ ],
+ "normalization": [
+ {
+ "kind": "linked",
+ "name": "Episode",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Episode",
+ "kind": "object",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "keys": {
+ "Episode": [
+ "id"
+ ]
+ },
+ "is_abstract": false,
+ "possible_types": [
+ "Episode"
+ ],
+ "storage_key": {
+ "name": "Episode",
+ "arguments": [
+ {
+ "name": "id",
+ "value": {
+ "kind": "variable",
+ "value": "id"
+ }
+ }
+ ]
+ },
+ "lookup": null,
+ "connection": null,
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "id",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "ID",
+ "kind": "id",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "id",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "name",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "String",
+ "kind": "string",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "name",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ }
+ ]
+ },
+ {
+ "kind": "linked",
+ "name": "Viewer",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "Character",
+ "kind": "object",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "keys": {
+ "Character": [
+ "id"
+ ]
+ },
+ "is_abstract": false,
+ "possible_types": [
+ "Character"
+ ],
+ "storage_key": {
+ "name": "Viewer",
+ "arguments": []
+ },
+ "lookup": null,
+ "connection": null,
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "id",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "ID",
+ "kind": "id",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "id",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "scalar",
+ "name": "name",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "String",
+ "kind": "string",
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "name",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ }
+ ]
+ },
+ {
+ "kind": "scalar",
+ "name": "GenreCollection",
+ "alias": null,
+ "type": {
+ "shape": "list",
+ "element": {
+ "shape": "named",
+ "name": "String",
+ "kind": "string",
+ "non_null": false
+ },
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "GenreCollection",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "linked",
+ "name": "Notification",
+ "alias": null,
+ "type": {
+ "shape": "list",
+ "element": {
+ "shape": "named",
+ "name": "NotificationUnion",
+ "kind": "union",
+ "non_null": false
+ },
+ "non_null": false
+ },
+ "non_null": false,
+ "semantic_non_null": false,
+ "keys": {
+ "ActivityLikeNotification": [
+ "id"
+ ],
+ "ActivityMentionNotification": [
+ "id"
+ ],
+ "ActivityMessageNotification": [
+ "id"
+ ],
+ "ActivityReplyLikeNotification": [
+ "id"
+ ],
+ "ActivityReplyNotification": [
+ "id"
+ ],
+ "ActivityReplySubscribedNotification": [
+ "id"
+ ],
+ "AiringNotification": [
+ "id"
+ ],
+ "CharacterSubmissionUpdateNotification": [
+ "id"
+ ],
+ "FollowingNotification": [
+ "id"
+ ],
+ "MediaDataChangeNotification": [
+ "id"
+ ],
+ "MediaDeletionNotification": [
+ "id"
+ ],
+ "MediaMergeNotification": [
+ "id"
+ ],
+ "MediaSubmissionUpdateNotification": [
+ "id"
+ ],
+ "RelatedMediaAdditionNotification": [
+ "id"
+ ],
+ "StaffSubmissionUpdateNotification": [
+ "id"
+ ],
+ "ThreadCommentLikeNotification": [
+ "id"
+ ],
+ "ThreadCommentMentionNotification": [
+ "id"
+ ],
+ "ThreadCommentReplyNotification": [
+ "id"
+ ],
+ "ThreadCommentSubscribedNotification": [
+ "id"
+ ],
+ "ThreadLikeNotification": [
+ "id"
+ ]
+ },
+ "is_abstract": true,
+ "possible_types": [
+ "ActivityLikeNotification",
+ "ActivityMentionNotification",
+ "ActivityMessageNotification",
+ "ActivityReplyLikeNotification",
+ "ActivityReplyNotification",
+ "ActivityReplySubscribedNotification",
+ "AiringNotification",
+ "CharacterSubmissionUpdateNotification",
+ "FollowingNotification",
+ "MediaDataChangeNotification",
+ "MediaDeletionNotification",
+ "MediaMergeNotification",
+ "MediaSubmissionUpdateNotification",
+ "RelatedMediaAdditionNotification",
+ "StaffSubmissionUpdateNotification",
+ "ThreadCommentLikeNotification",
+ "ThreadCommentMentionNotification",
+ "ThreadCommentReplyNotification",
+ "ThreadCommentSubscribedNotification",
+ "ThreadLikeNotification"
+ ],
+ "storage_key": {
+ "name": "Notification",
+ "arguments": []
+ },
+ "lookup": null,
+ "connection": null,
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "__typename",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "String",
+ "kind": "string",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "__typename",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ },
+ {
+ "kind": "inline",
+ "type_condition": "ActivityLikeNotification",
+ "condition_types": [
+ "ActivityLikeNotification"
+ ],
+ "condition_class": {
+ "kind": "concrete",
+ "type": "ActivityLikeNotification"
+ },
+ "alias": null,
+ "deferred": null,
+ "catch": null,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "id",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "ID",
+ "kind": "id",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "id",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ }
+ ]
+ },
+ {
+ "kind": "inline",
+ "type_condition": "ActivityMentionNotification",
+ "condition_types": [
+ "ActivityMentionNotification"
+ ],
+ "condition_class": {
+ "kind": "concrete",
+ "type": "ActivityMentionNotification"
+ },
+ "alias": null,
+ "deferred": null,
+ "catch": null,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "id",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "ID",
+ "kind": "id",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "id",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ }
+ ]
+ },
+ {
+ "kind": "inline",
+ "type_condition": "ActivityMessageNotification",
+ "condition_types": [
+ "ActivityMessageNotification"
+ ],
+ "condition_class": {
+ "kind": "concrete",
+ "type": "ActivityMessageNotification"
+ },
+ "alias": null,
+ "deferred": null,
+ "catch": null,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "id",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "ID",
+ "kind": "id",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "id",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ }
+ ]
+ },
+ {
+ "kind": "inline",
+ "type_condition": "ActivityReplyLikeNotification",
+ "condition_types": [
+ "ActivityReplyLikeNotification"
+ ],
+ "condition_class": {
+ "kind": "concrete",
+ "type": "ActivityReplyLikeNotification"
+ },
+ "alias": null,
+ "deferred": null,
+ "catch": null,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "id",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "ID",
+ "kind": "id",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "id",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ }
+ ]
+ },
+ {
+ "kind": "inline",
+ "type_condition": "ActivityReplyNotification",
+ "condition_types": [
+ "ActivityReplyNotification"
+ ],
+ "condition_class": {
+ "kind": "concrete",
+ "type": "ActivityReplyNotification"
+ },
+ "alias": null,
+ "deferred": null,
+ "catch": null,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "id",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "ID",
+ "kind": "id",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "id",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ }
+ ]
+ },
+ {
+ "kind": "inline",
+ "type_condition": "ActivityReplySubscribedNotification",
+ "condition_types": [
+ "ActivityReplySubscribedNotification"
+ ],
+ "condition_class": {
+ "kind": "concrete",
+ "type": "ActivityReplySubscribedNotification"
+ },
+ "alias": null,
+ "deferred": null,
+ "catch": null,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "id",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "ID",
+ "kind": "id",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "id",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ }
+ ]
+ },
+ {
+ "kind": "inline",
+ "type_condition": "AiringNotification",
+ "condition_types": [
+ "AiringNotification"
+ ],
+ "condition_class": {
+ "kind": "concrete",
+ "type": "AiringNotification"
+ },
+ "alias": null,
+ "deferred": null,
+ "catch": null,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "id",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "ID",
+ "kind": "id",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "id",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ }
+ ]
+ },
+ {
+ "kind": "inline",
+ "type_condition": "CharacterSubmissionUpdateNotification",
+ "condition_types": [
+ "CharacterSubmissionUpdateNotification"
+ ],
+ "condition_class": {
+ "kind": "concrete",
+ "type": "CharacterSubmissionUpdateNotification"
+ },
+ "alias": null,
+ "deferred": null,
+ "catch": null,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "id",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "ID",
+ "kind": "id",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "id",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ }
+ ]
+ },
+ {
+ "kind": "inline",
+ "type_condition": "FollowingNotification",
+ "condition_types": [
+ "FollowingNotification"
+ ],
+ "condition_class": {
+ "kind": "concrete",
+ "type": "FollowingNotification"
+ },
+ "alias": null,
+ "deferred": null,
+ "catch": null,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "id",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "ID",
+ "kind": "id",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "id",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ }
+ ]
+ },
+ {
+ "kind": "inline",
+ "type_condition": "MediaDataChangeNotification",
+ "condition_types": [
+ "MediaDataChangeNotification"
+ ],
+ "condition_class": {
+ "kind": "concrete",
+ "type": "MediaDataChangeNotification"
+ },
+ "alias": null,
+ "deferred": null,
+ "catch": null,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "id",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "ID",
+ "kind": "id",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "id",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ }
+ ]
+ },
+ {
+ "kind": "inline",
+ "type_condition": "MediaDeletionNotification",
+ "condition_types": [
+ "MediaDeletionNotification"
+ ],
+ "condition_class": {
+ "kind": "concrete",
+ "type": "MediaDeletionNotification"
+ },
+ "alias": null,
+ "deferred": null,
+ "catch": null,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "id",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "ID",
+ "kind": "id",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "id",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ }
+ ]
+ },
+ {
+ "kind": "inline",
+ "type_condition": "MediaMergeNotification",
+ "condition_types": [
+ "MediaMergeNotification"
+ ],
+ "condition_class": {
+ "kind": "concrete",
+ "type": "MediaMergeNotification"
+ },
+ "alias": null,
+ "deferred": null,
+ "catch": null,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "id",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "ID",
+ "kind": "id",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "id",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ }
+ ]
+ },
+ {
+ "kind": "inline",
+ "type_condition": "MediaSubmissionUpdateNotification",
+ "condition_types": [
+ "MediaSubmissionUpdateNotification"
+ ],
+ "condition_class": {
+ "kind": "concrete",
+ "type": "MediaSubmissionUpdateNotification"
+ },
+ "alias": null,
+ "deferred": null,
+ "catch": null,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "id",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "ID",
+ "kind": "id",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "id",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ }
+ ]
+ },
+ {
+ "kind": "inline",
+ "type_condition": "RelatedMediaAdditionNotification",
+ "condition_types": [
+ "RelatedMediaAdditionNotification"
+ ],
+ "condition_class": {
+ "kind": "concrete",
+ "type": "RelatedMediaAdditionNotification"
+ },
+ "alias": null,
+ "deferred": null,
+ "catch": null,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "id",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "ID",
+ "kind": "id",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "id",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ }
+ ]
+ },
+ {
+ "kind": "inline",
+ "type_condition": "StaffSubmissionUpdateNotification",
+ "condition_types": [
+ "StaffSubmissionUpdateNotification"
+ ],
+ "condition_class": {
+ "kind": "concrete",
+ "type": "StaffSubmissionUpdateNotification"
+ },
+ "alias": null,
+ "deferred": null,
+ "catch": null,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "id",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "ID",
+ "kind": "id",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "id",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ }
+ ]
+ },
+ {
+ "kind": "inline",
+ "type_condition": "ThreadCommentLikeNotification",
+ "condition_types": [
+ "ThreadCommentLikeNotification"
+ ],
+ "condition_class": {
+ "kind": "concrete",
+ "type": "ThreadCommentLikeNotification"
+ },
+ "alias": null,
+ "deferred": null,
+ "catch": null,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "id",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "ID",
+ "kind": "id",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "id",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ }
+ ]
+ },
+ {
+ "kind": "inline",
+ "type_condition": "ThreadCommentMentionNotification",
+ "condition_types": [
+ "ThreadCommentMentionNotification"
+ ],
+ "condition_class": {
+ "kind": "concrete",
+ "type": "ThreadCommentMentionNotification"
+ },
+ "alias": null,
+ "deferred": null,
+ "catch": null,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "id",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "ID",
+ "kind": "id",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "id",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ }
+ ]
+ },
+ {
+ "kind": "inline",
+ "type_condition": "ThreadCommentReplyNotification",
+ "condition_types": [
+ "ThreadCommentReplyNotification"
+ ],
+ "condition_class": {
+ "kind": "concrete",
+ "type": "ThreadCommentReplyNotification"
+ },
+ "alias": null,
+ "deferred": null,
+ "catch": null,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "id",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "ID",
+ "kind": "id",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "id",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ }
+ ]
+ },
+ {
+ "kind": "inline",
+ "type_condition": "ThreadCommentSubscribedNotification",
+ "condition_types": [
+ "ThreadCommentSubscribedNotification"
+ ],
+ "condition_class": {
+ "kind": "concrete",
+ "type": "ThreadCommentSubscribedNotification"
+ },
+ "alias": null,
+ "deferred": null,
+ "catch": null,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "id",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "ID",
+ "kind": "id",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "id",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ }
+ ]
+ },
+ {
+ "kind": "inline",
+ "type_condition": "ThreadLikeNotification",
+ "condition_types": [
+ "ThreadLikeNotification"
+ ],
+ "condition_class": {
+ "kind": "concrete",
+ "type": "ThreadLikeNotification"
+ },
+ "alias": null,
+ "deferred": null,
+ "catch": null,
+ "bubbles": false,
+ "selections": [
+ {
+ "kind": "scalar",
+ "name": "id",
+ "alias": null,
+ "type": {
+ "shape": "named",
+ "name": "ID",
+ "kind": "id",
+ "non_null": true
+ },
+ "non_null": true,
+ "semantic_non_null": false,
+ "storage_key": {
+ "name": "id",
+ "arguments": []
+ },
+ "edit": null,
+ "required": null,
+ "catch": null,
+ "caught": false
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
{
"name": "TestCaughtNames",
"source": "swift/Tests/BatonTests/NameDocuments.swift",
diff --git a/compiler/src/tests/reports/BatonTests.report.json b/compiler/src/tests/reports/BatonTests.report.json
index 25ca8f21..b82de312 100644
--- a/compiler/src/tests/reports/BatonTests.report.json
+++ b/compiler/src/tests/reports/BatonTests.report.json
@@ -1,5 +1,5 @@
{
- "schemaDigest": "5beaef3e41ff4dcf1169e9ba839e88cc",
+ "schemaDigest": "05a112649a1212d03abe827e91364544",
"operations": [
{
"name": "Fixture",
@@ -1120,6 +1120,92 @@
]
}
},
+ {
+ "name": "TestCapitalizedRoots",
+ "kind": "query",
+ "source": "swift/Tests/BatonTests/NameDocuments.swift",
+ "variables": [
+ {
+ "name": "id",
+ "type": "ID!"
+ }
+ ],
+ "fragments": [],
+ "text": "query TestCapitalizedRoots($id:ID!){Episode(id:$id){id,name},Viewer{id,name},GenreCollection,Notification{__typename,...on ActivityLikeNotification{id},...on ActivityMentionNotification{id},...on ActivityMessageNotification{id},...on ActivityReplyLikeNotification{id},...on ActivityReplyNotification{id},...on ActivityReplySubscribedNotification{id},...on AiringNotification{id},...on CharacterSubmissionUpdateNotification{id},...on FollowingNotification{id},...on MediaDataChangeNotification{id},...on MediaDeletionNotification{id},...on MediaMergeNotification{id},...on MediaSubmissionUpdateNotification{id},...on RelatedMediaAdditionNotification{id},...on StaffSubmissionUpdateNotification{id},...on ThreadCommentLikeNotification{id},...on ThreadCommentMentionNotification{id},...on ThreadCommentReplyNotification{id},...on ThreadCommentSubscribedNotification{id},...on ThreadLikeNotification{id}}}",
+ "lens": {
+ "type": "Query",
+ "accessors": [
+ {
+ "name": "Episode",
+ "key": "Episode",
+ "read": "linked",
+ "optional": true,
+ "lens": {
+ "type": "Episode",
+ "accessors": [
+ {
+ "name": "id",
+ "key": "id",
+ "read": "scalar",
+ "optional": true
+ },
+ {
+ "name": "name",
+ "key": "name",
+ "read": "scalar",
+ "optional": true
+ }
+ ]
+ }
+ },
+ {
+ "name": "Viewer",
+ "key": "Viewer",
+ "read": "linked",
+ "optional": true,
+ "lens": {
+ "type": "Character",
+ "accessors": [
+ {
+ "name": "id",
+ "key": "id",
+ "read": "scalar",
+ "optional": true
+ },
+ {
+ "name": "name",
+ "key": "name",
+ "read": "scalar",
+ "optional": true
+ }
+ ]
+ }
+ },
+ {
+ "name": "GenreCollection",
+ "key": "GenreCollection",
+ "read": "scalar",
+ "optional": true,
+ "list": {
+ "optionalElements": true
+ }
+ },
+ {
+ "name": "Notification",
+ "key": "Notification",
+ "read": "linked",
+ "optional": true,
+ "list": {
+ "optionalElements": false
+ },
+ "lens": {
+ "type": "NotificationUnion",
+ "accessors": []
+ }
+ }
+ ]
+ }
+ },
{
"name": "TestCaughtEpisodes",
"kind": "query",
@@ -2177,6 +2263,53 @@
]
}
},
+ {
+ "name": "TestEpisodeStatus",
+ "kind": "query",
+ "source": "swift/Tests/BatonTests/EnumDocuments.swift",
+ "variables": [
+ {
+ "name": "id",
+ "type": "ID!"
+ }
+ ],
+ "fragments": [],
+ "text": "query TestEpisodeStatus($id:ID!){episode(id:$id){id,status,hiatus:status(version:2)}}",
+ "lens": {
+ "type": "Query",
+ "accessors": [
+ {
+ "name": "episode",
+ "key": "episode",
+ "read": "linked",
+ "optional": true,
+ "lens": {
+ "type": "Episode",
+ "accessors": [
+ {
+ "name": "id",
+ "key": "id",
+ "read": "scalar",
+ "optional": true
+ },
+ {
+ "name": "status",
+ "key": "status",
+ "read": "scalar",
+ "optional": true
+ },
+ {
+ "name": "hiatus",
+ "key": "hiatus",
+ "read": "scalar",
+ "optional": true
+ }
+ ]
+ }
+ }
+ ]
+ }
+ },
{
"name": "TestEpisodesQuery",
"kind": "query",
@@ -3816,6 +3949,502 @@
]
}
},
+ {
+ "name": "TestNotifications",
+ "kind": "query",
+ "source": "swift/Tests/BatonTests/ConditionDocuments.swift",
+ "variables": [],
+ "fragments": [],
+ "text": "query TestNotifications{Notification{__typename,...on AiringNotification{id,episode},...on FollowingNotification{id,userId},...on ActivityMessageNotification{id,activityId},...on ActivityMentionNotification{id,activityId},...on ActivityReplyNotification{id,activityId},...on ActivityReplySubscribedNotification{id,activityId},...on ActivityLikeNotification{id,activityId},...on ActivityReplyLikeNotification{id,activityId},...on ThreadCommentMentionNotification{id,commentId},...on ThreadCommentReplyNotification{id,commentId},...on ThreadCommentSubscribedNotification{id,commentId},...on ThreadCommentLikeNotification{id,commentId},...on ThreadLikeNotification{id,threadId},...on RelatedMediaAdditionNotification{id,mediaId},...on MediaDataChangeNotification{id,reason},...on MediaMergeNotification{id,deletedMediaTitles},...on MediaDeletionNotification{id,deletedMediaTitle},...on MediaSubmissionUpdateNotification{id,status},...on StaffSubmissionUpdateNotification{id,status},...on CharacterSubmissionUpdateNotification{id,status}}}",
+ "lens": {
+ "type": "Query",
+ "accessors": [
+ {
+ "name": "Notification",
+ "key": "Notification",
+ "read": "linked",
+ "optional": true,
+ "list": {
+ "optionalElements": false
+ },
+ "lens": {
+ "type": "NotificationUnion",
+ "accessors": [
+ {
+ "name": "asAiringNotification",
+ "read": "condition",
+ "optional": true,
+ "types": [
+ "AiringNotification"
+ ],
+ "lens": {
+ "type": "AiringNotification",
+ "accessors": [
+ {
+ "name": "id",
+ "key": "id",
+ "read": "scalar"
+ },
+ {
+ "name": "episode",
+ "key": "episode",
+ "read": "scalar"
+ }
+ ]
+ }
+ },
+ {
+ "name": "asFollowingNotification",
+ "read": "condition",
+ "optional": true,
+ "types": [
+ "FollowingNotification"
+ ],
+ "lens": {
+ "type": "FollowingNotification",
+ "accessors": [
+ {
+ "name": "id",
+ "key": "id",
+ "read": "scalar"
+ },
+ {
+ "name": "userId",
+ "key": "userId",
+ "read": "scalar"
+ }
+ ]
+ }
+ },
+ {
+ "name": "asActivityMessageNotification",
+ "read": "condition",
+ "optional": true,
+ "types": [
+ "ActivityMessageNotification"
+ ],
+ "lens": {
+ "type": "ActivityMessageNotification",
+ "accessors": [
+ {
+ "name": "id",
+ "key": "id",
+ "read": "scalar"
+ },
+ {
+ "name": "activityId",
+ "key": "activityId",
+ "read": "scalar"
+ }
+ ]
+ }
+ },
+ {
+ "name": "asActivityMentionNotification",
+ "read": "condition",
+ "optional": true,
+ "types": [
+ "ActivityMentionNotification"
+ ],
+ "lens": {
+ "type": "ActivityMentionNotification",
+ "accessors": [
+ {
+ "name": "id",
+ "key": "id",
+ "read": "scalar"
+ },
+ {
+ "name": "activityId",
+ "key": "activityId",
+ "read": "scalar"
+ }
+ ]
+ }
+ },
+ {
+ "name": "asActivityReplyNotification",
+ "read": "condition",
+ "optional": true,
+ "types": [
+ "ActivityReplyNotification"
+ ],
+ "lens": {
+ "type": "ActivityReplyNotification",
+ "accessors": [
+ {
+ "name": "id",
+ "key": "id",
+ "read": "scalar"
+ },
+ {
+ "name": "activityId",
+ "key": "activityId",
+ "read": "scalar"
+ }
+ ]
+ }
+ },
+ {
+ "name": "asActivityReplySubscribedNotification",
+ "read": "condition",
+ "optional": true,
+ "types": [
+ "ActivityReplySubscribedNotification"
+ ],
+ "lens": {
+ "type": "ActivityReplySubscribedNotification",
+ "accessors": [
+ {
+ "name": "id",
+ "key": "id",
+ "read": "scalar"
+ },
+ {
+ "name": "activityId",
+ "key": "activityId",
+ "read": "scalar"
+ }
+ ]
+ }
+ },
+ {
+ "name": "asActivityLikeNotification",
+ "read": "condition",
+ "optional": true,
+ "types": [
+ "ActivityLikeNotification"
+ ],
+ "lens": {
+ "type": "ActivityLikeNotification",
+ "accessors": [
+ {
+ "name": "id",
+ "key": "id",
+ "read": "scalar"
+ },
+ {
+ "name": "activityId",
+ "key": "activityId",
+ "read": "scalar"
+ }
+ ]
+ }
+ },
+ {
+ "name": "asActivityReplyLikeNotification",
+ "read": "condition",
+ "optional": true,
+ "types": [
+ "ActivityReplyLikeNotification"
+ ],
+ "lens": {
+ "type": "ActivityReplyLikeNotification",
+ "accessors": [
+ {
+ "name": "id",
+ "key": "id",
+ "read": "scalar"
+ },
+ {
+ "name": "activityId",
+ "key": "activityId",
+ "read": "scalar"
+ }
+ ]
+ }
+ },
+ {
+ "name": "asThreadCommentMentionNotification",
+ "read": "condition",
+ "optional": true,
+ "types": [
+ "ThreadCommentMentionNotification"
+ ],
+ "lens": {
+ "type": "ThreadCommentMentionNotification",
+ "accessors": [
+ {
+ "name": "id",
+ "key": "id",
+ "read": "scalar"
+ },
+ {
+ "name": "commentId",
+ "key": "commentId",
+ "read": "scalar"
+ }
+ ]
+ }
+ },
+ {
+ "name": "asThreadCommentReplyNotification",
+ "read": "condition",
+ "optional": true,
+ "types": [
+ "ThreadCommentReplyNotification"
+ ],
+ "lens": {
+ "type": "ThreadCommentReplyNotification",
+ "accessors": [
+ {
+ "name": "id",
+ "key": "id",
+ "read": "scalar"
+ },
+ {
+ "name": "commentId",
+ "key": "commentId",
+ "read": "scalar"
+ }
+ ]
+ }
+ },
+ {
+ "name": "asThreadCommentSubscribedNotification",
+ "read": "condition",
+ "optional": true,
+ "types": [
+ "ThreadCommentSubscribedNotification"
+ ],
+ "lens": {
+ "type": "ThreadCommentSubscribedNotification",
+ "accessors": [
+ {
+ "name": "id",
+ "key": "id",
+ "read": "scalar"
+ },
+ {
+ "name": "commentId",
+ "key": "commentId",
+ "read": "scalar"
+ }
+ ]
+ }
+ },
+ {
+ "name": "asThreadCommentLikeNotification",
+ "read": "condition",
+ "optional": true,
+ "types": [
+ "ThreadCommentLikeNotification"
+ ],
+ "lens": {
+ "type": "ThreadCommentLikeNotification",
+ "accessors": [
+ {
+ "name": "id",
+ "key": "id",
+ "read": "scalar"
+ },
+ {
+ "name": "commentId",
+ "key": "commentId",
+ "read": "scalar"
+ }
+ ]
+ }
+ },
+ {
+ "name": "asThreadLikeNotification",
+ "read": "condition",
+ "optional": true,
+ "types": [
+ "ThreadLikeNotification"
+ ],
+ "lens": {
+ "type": "ThreadLikeNotification",
+ "accessors": [
+ {
+ "name": "id",
+ "key": "id",
+ "read": "scalar"
+ },
+ {
+ "name": "threadId",
+ "key": "threadId",
+ "read": "scalar"
+ }
+ ]
+ }
+ },
+ {
+ "name": "asRelatedMediaAdditionNotification",
+ "read": "condition",
+ "optional": true,
+ "types": [
+ "RelatedMediaAdditionNotification"
+ ],
+ "lens": {
+ "type": "RelatedMediaAdditionNotification",
+ "accessors": [
+ {
+ "name": "id",
+ "key": "id",
+ "read": "scalar"
+ },
+ {
+ "name": "mediaId",
+ "key": "mediaId",
+ "read": "scalar"
+ }
+ ]
+ }
+ },
+ {
+ "name": "asMediaDataChangeNotification",
+ "read": "condition",
+ "optional": true,
+ "types": [
+ "MediaDataChangeNotification"
+ ],
+ "lens": {
+ "type": "MediaDataChangeNotification",
+ "accessors": [
+ {
+ "name": "id",
+ "key": "id",
+ "read": "scalar"
+ },
+ {
+ "name": "reason",
+ "key": "reason",
+ "read": "scalar",
+ "optional": true
+ }
+ ]
+ }
+ },
+ {
+ "name": "asMediaMergeNotification",
+ "read": "condition",
+ "optional": true,
+ "types": [
+ "MediaMergeNotification"
+ ],
+ "lens": {
+ "type": "MediaMergeNotification",
+ "accessors": [
+ {
+ "name": "id",
+ "key": "id",
+ "read": "scalar"
+ },
+ {
+ "name": "deletedMediaTitles",
+ "key": "deletedMediaTitles",
+ "read": "scalar",
+ "optional": true,
+ "list": {
+ "optionalElements": true
+ }
+ }
+ ]
+ }
+ },
+ {
+ "name": "asMediaDeletionNotification",
+ "read": "condition",
+ "optional": true,
+ "types": [
+ "MediaDeletionNotification"
+ ],
+ "lens": {
+ "type": "MediaDeletionNotification",
+ "accessors": [
+ {
+ "name": "id",
+ "key": "id",
+ "read": "scalar"
+ },
+ {
+ "name": "deletedMediaTitle",
+ "key": "deletedMediaTitle",
+ "read": "scalar",
+ "optional": true
+ }
+ ]
+ }
+ },
+ {
+ "name": "asMediaSubmissionUpdateNotification",
+ "read": "condition",
+ "optional": true,
+ "types": [
+ "MediaSubmissionUpdateNotification"
+ ],
+ "lens": {
+ "type": "MediaSubmissionUpdateNotification",
+ "accessors": [
+ {
+ "name": "id",
+ "key": "id",
+ "read": "scalar"
+ },
+ {
+ "name": "status",
+ "key": "status",
+ "read": "scalar",
+ "optional": true
+ }
+ ]
+ }
+ },
+ {
+ "name": "asStaffSubmissionUpdateNotification",
+ "read": "condition",
+ "optional": true,
+ "types": [
+ "StaffSubmissionUpdateNotification"
+ ],
+ "lens": {
+ "type": "StaffSubmissionUpdateNotification",
+ "accessors": [
+ {
+ "name": "id",
+ "key": "id",
+ "read": "scalar"
+ },
+ {
+ "name": "status",
+ "key": "status",
+ "read": "scalar",
+ "optional": true
+ }
+ ]
+ }
+ },
+ {
+ "name": "asCharacterSubmissionUpdateNotification",
+ "read": "condition",
+ "optional": true,
+ "types": [
+ "CharacterSubmissionUpdateNotification"
+ ],
+ "lens": {
+ "type": "CharacterSubmissionUpdateNotification",
+ "accessors": [
+ {
+ "name": "id",
+ "key": "id",
+ "read": "scalar"
+ },
+ {
+ "name": "status",
+ "key": "status",
+ "read": "scalar",
+ "optional": true
+ }
+ ]
+ }
+ }
+ ]
+ }
+ }
+ ]
+ }
+ },
{
"name": "TestNullsOnError",
"kind": "query",
diff --git a/docs/decisions/derived-state-is-observed-not-signaled.md b/docs/decisions/derived-state-is-observed-not-signaled.md
index 7a6784e0..39792aad 100644
--- a/docs/decisions/derived-state-is-observed-not-signaled.md
+++ b/docs/decisions/derived-state-is-observed-not-signaled.md
@@ -5,7 +5,8 @@ twice for a commit signal a model could observe, and the plan's D-N18.
Serves [What earns a concept](../principles/what-earns-a-concept.md) and
[The store is the UI's state](../principles/store-is-the-ui-state.md).
Reopen if a model is shown that must know a commit happened and cannot say
-what it reads.
+what it reads, or a whole-operation derivation that the per-handle
+composition cannot keep within its budget at a measured size.
## Context
@@ -41,3 +42,13 @@ filter by hand.
once for all of them.
- Derived fields in the store, Relay's resolvers. Logic in the store is
refused by [the client-data decision](client-data-is-described-and-committed.md).
+- A coarser channel for a reading of a whole operation, asked for in
+ [#53](https://github.com/shergin/baton/issues/53) on 2026-10-18: one a
+ reader registers on once per handle, Relay's subscription to a snapshot
+ and its seen records, or one per record rather than per slot. Either is a
+ second way to read and a branch on every tracked read. The tracked
+ read's cost is Observation's registrar, and Compose's read observer pays
+ a tenth of it; the composition in the recipe's *A derivation over a whole
+ operation*, one stream per handle, the first reading untracked, a reading
+ applied only when it differs, keeps the 1,000-entry list's change to one
+ chunk's re-read.
diff --git a/docs/recipes/derived-state.md b/docs/recipes/derived-state.md
index ce6a1998..e80f0aba 100644
--- a/docs/recipes/derived-state.md
+++ b/docs/recipes/derived-state.md
@@ -72,6 +72,176 @@ Collect the flow on the main dispatcher, where the store is read, and
release the hold with the model. [Views and view models](views.md) is
this page's Kotlin twin, with the model compiled and proven.
+## A derivation over a whole operation
+
+A model that derives one value from every entry of a large operation, a
+panel over a user's whole list, reads thousands of entries and dozens of
+fields each. Such a list is often [an unpaged collection](unpaged-collection.md),
+fetched in chunks of one operation value each. Every field it reads inside the closure registers on that
+slot's channel, as a view body's read does. At this size the
+registrations cost more than the reads. Budget the pass before you build
+it: a pass of N entries by M fields costs N × M field reads, at what one
+read costs tracked or untracked.
+
+Measured on the list recorded under `spec/anilist/`, 1,000 entries, on an
+M1 Pro: a reading of every field of the row's fragment is 44 slots an
+entry, 44,006 over the list, and the model below reads seven slots an
+entry for its five values. The entry *The AniList list* in
+[BENCHMARKS.md](../../BENCHMARKS.md), 18 October, has the rest:
+
+| | Swift | Kotlin, the JVM |
+|---|---|---|
+| One field read, untracked | 20 ns | 14 ns |
+| One field read, tracked | 647 ns | 57 ns |
+| The whole list, untracked | 0.89 ms | 0.65 ms |
+| The whole list, tracked, to the first value of `Observations` or `snapshotFlow` | 28.3 ms | 2.2 ms |
+| One chunk of 500 entries, tracked, every field | 14.2 ms | 1.2 ms |
+| One chunk of 500 entries, tracked, five values an entry | 2.6 ms | 0.26 ms |
+
+A tracked read in Swift is Observation's registrar: a key path registered
+with the record, and an observer installed on it when the scope ends. It
+costs what an `@Observable` property costs, 585 ns a field in a row body
+of eight in the same runs, and it stays linear from one chunk to the
+whole list. Compose's read observer adds the slot's state to a set, which
+costs about a tenth as much. The untracked read costs tens of nanoseconds
+on both runtimes. A frame at 120 Hz, 8.3 ms, holds about 13,000 tracked
+field reads in Swift and about 145,000 on the JVM.
+
+The composition keeps the tracked work off the launch and scopes each
+change to one operation value:
+
+- One `Observations` per operation handle, so a change in one chunk
+ re-reads that chunk alone. A list fetched as chunks is one operation
+ value a chunk, and each has its own handle.
+- The first reading at launch is untracked and synchronous, taken before
+ the streams start. A handle the image answers is ready in the turn it is
+ made, so the model has the whole list in the same turn, at the untracked
+ cost.
+- A reading is applied only when it differs from the last. Each stream's
+ first value is the tracked reading of its chunk, equal to the untracked
+ one, and it changes nothing.
+- The closure reads what the derived value needs, not the row's whole
+ fragment. Every field read is registered, so seven slots an entry cost
+ about a sixth of forty-four.
+
+```swift
+/// What the model derives from one entry: a value, so two readings compare.
+struct Entry: Equatable {
+ let id: Int
+ let status: MediaListStatus?
+ let progress: Int?
+ let title: String?
+ let nextEpisodeAt: Int?
+}
+
+@MainActor
+@Observable
+final class ListModel {
+ /// The entries of every chunk, in order: the derived value.
+ private(set) var entries: [Entry] = []
+ private var readings: [[Entry]]
+ private let handles: [OperationHandle]
+ private let retentions: [Retention]
+ private var observations: [Task] = []
+
+ init(environment: Environment, userId: Int, chunks: Int) {
+ handles = (1...chunks).map { environment.handle(for: ListQuery(userId: userId, mediaType: .ANIME, chunk: $0)) }
+ retentions = handles.map { $0.retain() }
+ // The first reading, untracked and in this turn: a handle the image
+ // answered is ready before any stream starts.
+ readings = handles.map(Self.read)
+ entries = readings.flatMap(\.self)
+ // One stream a handle, so a change in one chunk re-reads that chunk.
+ for (index, handle) in handles.enumerated() {
+ observations.append(Task { [weak self] in
+ for await reading in Observations<[Entry], Never>({ Self.read(handle) }) {
+ guard let self else { return }
+ self.apply(reading, at: index)
+ }
+ })
+ }
+ }
+
+ /// Applies a chunk's reading only when it differs from the last, so the
+ /// streams' first readings, equal to the untracked one, change nothing.
+ private func apply(_ reading: [Entry], at index: Int) {
+ guard reading != readings[index] else { return }
+ readings[index] = reading
+ entries = readings.flatMap(\.self)
+ }
+
+ /// What the derived value needs of one chunk: five fields an entry, not
+ /// the row's whole fragment, since every field read is registered.
+ private static func read(_ handle: OperationHandle) -> [Entry] {
+ guard case .ready(let data) = handle.phase else { return [] }
+ var entries: [Entry] = []
+ for group in data.MediaListCollection?.lists ?? .empty {
+ for entry in group.entries ?? .empty {
+ let row = entry.entryRow
+ let card = row.media?.mediaCard
+ entries.append(Entry(id: row.id, status: row.status, progress: row.progress, title: card?.title?.userPreferred, nextEpisodeAt: card?.nextAiringEpisode?.airingAt))
+ }
+ }
+ return entries
+ }
+}
+```
+
+In Kotlin the stream is `snapshotFlow` over each handle, and the derived
+value a `StateFlow`. `snapshotFlow` drops a reading equal to its own last
+one, but it delivers its first, so the model compares as the Swift one
+does:
+
+```kotlin
+data class Entry(val id: Int, val status: MediaListStatus?, val progress: Int?, val title: String?, val nextEpisodeAt: Int?)
+
+class ListModel(environment: Environment, scope: CoroutineScope, userId: Int, chunks: Int) {
+ private val handles = (1..chunks).map { environment.handle(ListQuery(userId = userId, mediaType = MediaType.ANIME, chunk = it)) }
+ private val holds = handles.map { it.retain() }
+
+ // The first reading, untracked and in this call: a handle the image
+ // answered is ready before any flow starts.
+ private val readings = handles.map(::read).toMutableList()
+ private val derived = MutableStateFlow(readings.flatten())
+
+ /** The entries of every chunk, in order: the derived value. */
+ val entries: StateFlow> = derived
+
+ // One flow a handle, so a change in one chunk re-reads that chunk.
+ private val collection = scope.launch {
+ handles.forEachIndexed { index, handle ->
+ launch { snapshotFlow { read(handle) }.collect { apply(it, index) } }
+ }
+ }
+
+ private fun apply(reading: List, index: Int) {
+ if (reading == readings[index]) return
+ readings[index] = reading
+ derived.value = readings.flatten()
+ }
+
+ fun close() {
+ collection.cancel()
+ holds.forEach { it.release() }
+ }
+}
+```
+
+`read` is the Swift one's twin. The scope runs on the store's thread.
+Both models are compiled in this repository, as `ListModel` beside the
+AniList tests under `swift/Tests/BatonAniListTests` and
+`kotlin/baton/src/jvmTest/kotlin/baton/anilist`, and `ListModelTests`
+beside each proves that the whole list is in hand in the turn the model is
+made, with no request, that the streams' first readings change nothing,
+and that a save of one entry changes that entry alone.
+
+What the composition costs is a chunk's tracked re-read on a change. After
+a one-field save in a chunk of 500 entries, the chunk's reading arrives
+15.6 ms after the commit in Swift when it reads every field, and 2.7 ms
+when it reads the model's five values; on the JVM, 1.16 ms and 0.31 ms.
+A smaller chunk is the other lever, since the operation value is the unit
+of a re-read.
+
## What it is not
- Not a commit signal. Caton asked twice for one. A model that observes
diff --git a/docs/recipes/unpaged-collection.md b/docs/recipes/unpaged-collection.md
index a0953a32..aec790ba 100644
--- a/docs/recipes/unpaged-collection.md
+++ b/docs/recipes/unpaged-collection.md
@@ -163,7 +163,10 @@ decodes each time `shelves` runs. The body runs it when a field it read
changes, and also when the view is rendered again for reasons of its own.
A model that keeps the shelves, as
[derived state outside views](derived-state.md) keeps a count, runs it
-only when a field it read changes, and the view reads the result.
+only when a field it read changes, and the view reads the result. For a
+list of several chunks, [a derivation over a whole operation](derived-state.md#a-derivation-over-a-whole-operation)
+keeps one stream a chunk, takes the first reading untracked at launch,
+and says what a tracked pass of the list costs.
Two edits still change the server's arrays rather than an entry's fields:
diff --git a/kotlin/baton/build.gradle.kts b/kotlin/baton/build.gradle.kts
index 2ab5e5af..7f72f73c 100644
--- a/kotlin/baton/build.gradle.kts
+++ b/kotlin/baton/build.gradle.kts
@@ -58,6 +58,16 @@ val generateFateKotlin = tasks.register("generateFateKotlin") {
hosts.from(layout.projectDirectory.file("src/jvmTest/kotlin/baton/fate/FateDocuments.kt"))
}
+// The documents of the list recorded from AniList under `spec/anilist/`, the
+// host `AniListDocuments.kt` beside the AniList tests, compiled against the
+// schema recorded beside the responses with the configuration beside the
+// host, as the Swift target `AniListDocuments` compiles its own.
+val generateAniListKotlin = tasks.register("generateAniListKotlin") {
+ description = "Generates the Kotlin of the AniList documents with batonc."
+ configuration.set(layout.projectDirectory.file("src/jvmTest/kotlin/baton/anilist/baton.json"))
+ hosts.from(layout.projectDirectory.file("src/jvmTest/kotlin/baton/anilist/AniListDocuments.kt"))
+}
+
kotlin {
jvm()
// The JDK the artifacts are compiled with, on the JVM and on Android: the
@@ -139,6 +149,7 @@ kotlin {
kotlin.srcDir(generateSpecKotlin.flatMap { it.outputDirectory })
kotlin.srcDir(generateRelayKotlin.flatMap { it.outputDirectory })
kotlin.srcDir(generateFateKotlin.flatMap { it.outputDirectory })
+ kotlin.srcDir(generateAniListKotlin.flatMap { it.outputDirectory })
dependencies {
// The harness walks a `reads` row over a generated lens by its
// properties' Kotlin names.
@@ -159,15 +170,18 @@ kotlin {
}
// The registry numbers types by name for the whole process, one schema family
-// per process, and the test compilation holds three schemas that give one
-// name to different types: Relay's test schema and fate's both declare a
-// `User`. So each harness runs in a JVM of its own, from the one compilation:
-// the specification's cases and scripts in `jvmTest`, Relay's in
-// `jvmRelayTest` and fate's in `jvmFateTest`, by the package each lives in.
+// per process, and the test compilation holds four schemas that give one
+// name to different types: Relay's test schema, fate's and AniList's all
+// declare a `User`, and AniList's and the specification's a `Character`. So
+// each harness runs in a JVM of its own, from the one
+// compilation: the specification's cases and scripts in `jvmTest`, Relay's in
+// `jvmRelayTest`, fate's in `jvmFateTest` and AniList's in `jvmAniListTest`,
+// by the package each lives in.
val jvmTest = tasks.named("jvmTest") {
filter {
excludeTestsMatching("baton.relay.*")
excludeTestsMatching("baton.fate.*")
+ excludeTestsMatching("baton.anilist.*")
}
}
@@ -183,8 +197,22 @@ fun harness(name: String, packageName: String, what: String) = tasks.register("runAniListBench") {
+ description = "Runs the bench of the list recorded under spec/anilist on the JVM."
+ group = "verification"
+ val test = kotlin.jvm().compilations.getByName("test")
+ classpath(test.output.allOutputs, test.runtimeDependencyFiles)
+ mainClass.set("baton.anilist.AniListBenchKt")
+ workingDir = repository
+}
// The runtime has no Compose resources. The Compose plugin, applied for the
// desktop renderer the JVM tests compose on, would copy the device tests'
diff --git a/kotlin/baton/src/jvmTest/kotlin/baton/anilist/AniListBench.kt b/kotlin/baton/src/jvmTest/kotlin/baton/anilist/AniListBench.kt
new file mode 100644
index 00000000..20f39375
--- /dev/null
+++ b/kotlin/baton/src/jvmTest/kotlin/baton/anilist/AniListBench.kt
@@ -0,0 +1,339 @@
+package baton.anilist
+
+import androidx.compose.runtime.snapshotFlow
+import androidx.compose.runtime.snapshots.Snapshot
+import baton.Anchor
+import baton.Answer
+import baton.ChangeSet
+import baton.Environment
+import baton.Ingest
+import baton.Owner
+import baton.Persistence
+import baton.Phase
+import baton.Spec
+import baton.Store
+import baton.check
+import baton.testing.SilentTransport
+import java.io.File
+import java.util.UUID
+import kotlin.coroutines.ContinuationInterceptor
+import kotlinx.coroutines.CoroutineDispatcher
+import kotlinx.coroutines.Dispatchers
+import kotlinx.coroutines.channels.Channel
+import kotlinx.coroutines.flow.first
+import kotlinx.coroutines.launch
+import kotlinx.coroutines.runBlocking
+
+/**
+ * The bench of the list recorded under `spec/anilist/` on the JVM, the
+ * Kotlin twin of the AniList section of `swift/Benchmarks`:
+ * `gradle :baton:runAniListBench`. Every measurement runs on the thread
+ * that made its store, after as many warm-up rounds as it samples, and
+ * prints the best and the median.
+ */
+fun main(arguments: Array) {
+ if (arguments.size == 2 && arguments[0].startsWith("--launch")) {
+ launch(arguments[1], opened = arguments[0] == "--launch-opened")
+ return
+ }
+ val machine = "the JVM ${System.getProperty("java.vm.name")} ${System.getProperty("java.version")}, " +
+ "${System.getProperty("os.name")} ${System.getProperty("os.version")} ${System.getProperty("os.arch")}"
+ println("Baton AniList bench on $machine")
+ AniListBench().run()
+}
+
+/** The two chunks of the recording, as a screen asks for them: one operation value a chunk. */
+private val chunks = listOf(ListQuery(userId = 0, mediaType = MediaType.ANIME, chunk = 1), ListQuery(userId = 0, mediaType = MediaType.ANIME, chunk = 2))
+
+/** The recorded responses, by chunk. */
+private val responses = listOf(Spec.bytes("anilist/list-anime-chunk-1.json"), Spec.bytes("anilist/list-anime-chunk-2.json"))
+
+/** A store holding both chunks, committed in order, with a lens over each chunk's root. */
+private fun listStore(persistence: Persistence? = null): Pair> {
+ val store = Store(persistence)
+ val readings = chunks.zip(responses).map { (chunk, bytes) ->
+ store.commit(Ingest.normalize(bytes, store.resolve(ListQuery.plan, chunk.variables), Store.ROOT_KEY))
+ ListQuery.Data(Anchor(store.root, Owner.reading(chunk.variables, store)))
+ }
+ return store to readings
+}
+
+/** The entries of one chunk's reading, in the order the response lists them. */
+private fun entries(data: ListQuery.Data): List =
+ data.MediaListCollection?.lists.orEmpty().flatMap { group -> group.entries.orEmpty().map { it.entryRow } }
+
+/** A reading over every entry of the chunks' data, the shape a model that derives one value from the whole list runs. */
+private fun readList(readings: List): Int = readings.sumOf { data -> entries(data).sumOf { readEntry(it, Fields()) } }
+
+/** The slots a reading read. */
+private class Fields {
+ var count = 0
+}
+
+/** What a row's body reads of an entry: every field of the row's fragment and of its media's card, each slot once. */
+private fun readEntry(entry: EntryRow_mediaList, fields: Fields): Int {
+ var sink = entry.id
+ sink += entry.status?.scalarText?.length ?: 0
+ sink += entry.progress ?: 0
+ sink += entry.progressVolumes ?: 0
+ sink += (entry.score ?: 0.0).toInt()
+ sink += entry.repeat ?: 0
+ sink += entry.priority ?: 0
+ sink += entry.notes?.length ?: 0
+ sink += if (entry.private == true) 1 else 0
+ sink += if (entry.hiddenFromStatusLists == true) 1 else 0
+ sink += entry.customLists?.length ?: 0
+ sink += entry.updatedAt ?: 0
+ fields.count += 12
+ entry.startedAt?.let { sink += (it.year ?: 0) + (it.month ?: 0) + (it.day ?: 0); fields.count += 3 }
+ entry.completedAt?.let { sink += (it.year ?: 0) + (it.month ?: 0) + (it.day ?: 0); fields.count += 3 }
+ fields.count += 3
+ val card = entry.media?.mediaCard ?: return sink
+ sink += card.id + (card.idMal ?: 0)
+ sink += card.type?.scalarText?.length ?: 0
+ sink += card.format?.scalarText?.length ?: 0
+ sink += card.status?.scalarText?.length ?: 0
+ sink += (card.episodes ?: 0) + (card.chapters ?: 0) + (card.volumes ?: 0) + (card.duration ?: 0)
+ sink += card.season?.scalarText?.length ?: 0
+ sink += card.seasonYear ?: 0
+ sink += card.countryOfOrigin?.length ?: 0
+ sink += if (card.isAdult == true) 1 else 0
+ sink += card.siteUrl?.length ?: 0
+ fields.count += 14
+ card.title?.let {
+ sink += (it.romaji?.length ?: 0) + (it.english?.length ?: 0) + (it.native?.length ?: 0) + (it.userPreferred?.length ?: 0)
+ fields.count += 4
+ }
+ card.coverImage?.let { sink += (it.large?.length ?: 0) + (it.color?.length ?: 0); fields.count += 2 }
+ card.nextAiringEpisode?.let { sink += it.id + it.episode + it.airingAt; fields.count += 3 }
+ fields.count += 3
+ return sink
+}
+
+/** The reading the derived-state recipe's model takes of one chunk: five values an entry, seven slots, where [readList] reads forty-four. */
+private fun readNarrow(data: ListQuery.Data): Int = entries(data).sumOf { entry ->
+ val card = entry.media?.mediaCard
+ entry.id + (entry.status?.scalarText?.length ?: 0) + (entry.progress ?: 0) +
+ (card?.title?.userPreferred?.length ?: 0) + (card?.nextAiringEpisode?.airingAt ?: 0)
+}
+
+/** The fields [readList] reads over [readings]. */
+private fun fieldsRead(readings: List): Int {
+ val fields = Fields()
+ for (data in readings) for (entry in entries(data)) readEntry(entry, fields)
+ return fields.count
+}
+
+/** The states [read] registers in a snapshot that observes its reads, as `snapshotFlow` reads its block. */
+private fun statesRead(read: () -> Unit): Set {
+ val states = HashSet()
+ val snapshot = Snapshot.takeSnapshot { states.add(it) }
+ try {
+ snapshot.enter(read)
+ } finally {
+ snapshot.dispose()
+ }
+ return states
+}
+
+private class AniListBench {
+ private var sink = 0
+
+ private fun format(nanoseconds: Double): String = when {
+ nanoseconds >= 1_000_000 -> "%8.2f ms".format(nanoseconds / 1_000_000)
+ nanoseconds >= 1_000 -> "%8.2f µs".format(nanoseconds / 1_000)
+ else -> "%8.1f ns".format(nanoseconds)
+ }
+
+ private fun report(label: String, samples: List, ops: Int) {
+ val sorted = samples.sorted()
+ println(" ${label.padEnd(64)} best ${format(sorted.first().toDouble() / ops)} median ${format(sorted[sorted.size / 2].toDouble() / ops)}")
+ }
+
+ /** Times [body] alone, [iterations] times after as many warm-up rounds; [setup] runs before each round, off the clock. */
+ private fun measure(label: String, iterations: Int, ops: Int = 1, setup: () -> Unit = {}, body: () -> Unit) {
+ val samples = ArrayList()
+ repeat(iterations * 2) { round ->
+ setup()
+ val start = System.nanoTime()
+ body()
+ val elapsed = System.nanoTime() - start
+ if (round >= iterations) samples.add(elapsed)
+ }
+ report(label, samples, ops)
+ }
+
+ /** Times a step that returns the nanoseconds it wants counted, after as many warm-up rounds. */
+ private fun measureEach(label: String, iterations: Int, warmUp: Int = iterations, body: () -> Long) {
+ repeat(warmUp) { body() }
+ report(label, List(iterations) { body() }, 1)
+ }
+
+ fun run() {
+ println(" responses: ${responses[0].size} and ${responses[1].size} bytes, 500 entries each")
+ val planned = Store()
+ val plans = chunks.map { planned.resolve(ListQuery.plan, it.variables) }
+ measure("ingest of a chunk of 500 entries, bytes -> change set, per chunk", iterations = 30, ops = 2) {
+ for ((bytes, plan) in responses.zip(plans)) Ingest.normalize(bytes, plan, Store.ROOT_KEY)
+ }
+ var fresh = Store()
+ var changes: List = emptyList()
+ measure("commit of both chunks into an empty store", iterations = 20, setup = {
+ fresh = Store()
+ changes = chunks.zip(responses).map { (chunk, bytes) -> Ingest.normalize(bytes, fresh.resolve(ListQuery.plan, chunk.variables), Store.ROOT_KEY) }
+ }) {
+ for (change in changes) fresh.commit(change)
+ }
+ println(" records after both chunks: ${fresh.count}")
+
+ // The reading a model that derives one value from the whole list
+ // runs, over every field of every entry. A slot's channel is made at
+ // its first read, so a store's first reading pays for making them
+ // and a later one does not; a read-observing snapshot is what
+ // `snapshotFlow` reads its block in.
+ val (store, readings) = listStore()
+ val fields = fieldsRead(readings)
+ println(" a reading of the list: $fields fields over 1,000 entries, ${fields / 1_000} an entry")
+ var first = readings
+ measure("the first reading of a store, untracked, making the channels", iterations = 20, setup = { first = listStore().second }) {
+ sink += readList(first)
+ }
+ measure("the reading, untracked, the whole list", iterations = 50) { sink += readList(readings) }
+ measure("the reading, untracked, per field", iterations = 50, ops = fields) { sink += readList(readings) }
+ measure("the reading in one read-observing snapshot, the whole list", iterations = 20) {
+ statesRead { sink += readList(readings) }
+ }
+ measure("the same, per field", iterations = 20, ops = fields) {
+ statesRead { sink += readList(readings) }
+ }
+ measure("one chunk's reading in its own snapshot, 500 entries", iterations = 20) {
+ statesRead { sink += readList(listOf(readings[1])) }
+ }
+ measure("one chunk's reading of five values an entry, its own snapshot", iterations = 20) {
+ statesRead { sink += readNarrow(readings[1]) }
+ }
+ val thread = Thread.currentThread()
+ measureEach("the reading through snapshotFlow, made to its first value", iterations = 20) {
+ runBlocking {
+ check(Thread.currentThread() == thread)
+ val start = System.nanoTime()
+ sink += snapshotFlow { readList(readings) }.first()
+ System.nanoTime() - start
+ }
+ }
+
+ // The composition the derived-state recipe gives for a whole
+ // operation: one `snapshotFlow` a chunk's handle, so a change in one
+ // chunk re-reads that chunk, timed from the commit of a one-field
+ // save of an entry in the second chunk to that chunk's reading
+ // delivered.
+ val save = Spec.bytes("anilist/save-entry-991-progress.json")
+ val back = save.decodeToString().replace("\"progress\":249", "\"progress\":248").encodeToByteArray()
+ val savePlan = store.resolve(SaveEntryMutation.plan, SaveEntryMutation(id = 991, progress = 249).variables)
+ val saved = Ingest.normalize(save, savePlan, Store.MUTATION_ROOT_KEY)
+ val restored = Ingest.normalize(back, savePlan, Store.MUTATION_ROOT_KEY)
+ for ((label, reading) in listOf Int>>(
+ "a one-field save, the commit to its chunk's reading delivered" to { readList(listOf(readings[1])) },
+ "the same, the chunk read five values an entry" to { readNarrow(readings[1]) },
+ )) {
+ runBlocking {
+ val delivered = Channel(Channel.UNLIMITED)
+ val collector = launch { snapshotFlow { reading() }.collect { delivered.send(it) } }
+ delivered.receive()
+ val samples = ArrayList()
+ repeat(40) { round ->
+ val start = System.nanoTime()
+ store.commit(if (round % 2 == 0) saved else restored)
+ Snapshot.sendApplyNotifications()
+ sink += delivered.receive()
+ if (round >= 20) samples.add(System.nanoTime() - start)
+ }
+ collector.cancel()
+ report(label, samples, 1)
+ }
+ store.commit(restored)
+ Snapshot.sendApplyNotifications()
+ }
+
+ // The save's commit with every row's body observing its entry whole
+ // and a detail's body observing entry 991: the two that read
+ // `progress` of that record are told, and no other.
+ store.commit(restored)
+ val rows = readings.flatMap(::entries)
+ val lookup = EntryQuery(id = 991)
+ check(store.check(store.resolve(EntryQuery.plan, lookup.variables)) != Answer.MISS) { "the lookup did not answer entry 991 from the list" }
+ val detail = checkNotNull(EntryQuery.Data(Anchor(store.root, Owner.reading(lookup.variables, store))).MediaList?.entryRow)
+ val bodies = (rows + detail).map { body -> statesRead { readEntry(body, Fields()) } }
+ var told = 0
+ val observer = Snapshot.registerApplyObserver { changed, _ -> for (states in bodies) if (changed.any { it in states }) told++ }
+ measure("the save's commit, 1,000 rows and a detail observing", iterations = 20, setup = {
+ store.commit(restored)
+ Snapshot.sendApplyNotifications()
+ told = 0
+ }) {
+ store.commit(saved)
+ Snapshot.sendApplyNotifications()
+ }
+ observer.dispose()
+ println(" notifications per save: $told (the row and the detail that read the entry's progress)")
+
+ // Through the image: the write-behind of both chunks, the file's
+ // size after it, and a launch in a new process to both handles ready.
+ val path = File(System.getProperty("java.io.tmpdir"), "baton-bench-anilist-${UUID.randomUUID()}.sqlite").path
+ try {
+ val persistence = Persistence(path)
+ runBlocking { persistence.flush() }
+ measureEach("write-behind of both chunks, off the store's thread", iterations = 10, warmUp = 3) {
+ val (written, _) = listStore(persistence)
+ val start = System.nanoTime()
+ runBlocking { persistence.flush() }
+ val elapsed = System.nanoTime() - start
+ check(written.count > 6_000)
+ elapsed
+ }
+ runBlocking { persistence.close() }
+ println(" the image after both chunks, closed: ${File(path).length()} bytes")
+ measureEach("a launch: open and hydrate at once, both handles ready", iterations = 15, warmUp = 0) { launched("--launch", path) }
+ measureEach("a launch: both handles ready after the image has opened", iterations = 15, warmUp = 0) { launched("--launch-opened", path) }
+ } finally {
+ for (suffix in listOf("", "-wal", "-shm", "-discard")) File(path + suffix).delete()
+ }
+ if (sink == 42) println("")
+ }
+
+ /** This program again, as a new JVM answering both chunks from the image; returns the nanoseconds it printed. */
+ private fun launched(flag: String, path: String): Long {
+ val java = File(System.getProperty("java.home"), "bin/java").path
+ val child = ProcessBuilder(java, "-cp", System.getProperty("java.class.path"), "baton.anilist.AniListBenchKt", flag, path)
+ .redirectErrorStream(true)
+ .start()
+ val text = child.inputStream.bufferedReader().readText()
+ check(child.waitFor() == 0) { "the launch child failed: $text" }
+ return text.trim().lines().last().toLong()
+ }
+}
+
+/**
+ * What the child process of the launch bench does: from creating the
+ * image's handle to both chunks' handles ready from it, or, with [opened],
+ * the handles alone once the file has opened on the writer's thread. Prints
+ * nanoseconds.
+ */
+private fun launch(path: String, opened: Boolean) = runBlocking {
+ var start = System.nanoTime()
+ val persistence = Persistence(path)
+ if (opened) {
+ persistence.flush()
+ start = System.nanoTime()
+ }
+ val dispatcher = coroutineContext[ContinuationInterceptor] as CoroutineDispatcher
+ val environment = Environment(SilentTransport(), null, Store(persistence), dispatcher, Dispatchers.Default).also { it.log = null }
+ val handles = chunks.map { environment.handle(it) }
+ val holds = handles.map { it.retain() }
+ val ready = handles.all { it.phase is Phase.Ready }
+ val elapsed = System.nanoTime() - start
+ check(ready) { "the image did not answer both chunks" }
+ println(elapsed)
+ holds.forEach { it.release() }
+ environment.end()
+}
diff --git a/kotlin/baton/src/jvmTest/kotlin/baton/anilist/AniListDocuments.kt b/kotlin/baton/src/jvmTest/kotlin/baton/anilist/AniListDocuments.kt
new file mode 100644
index 00000000..8c29ce2c
--- /dev/null
+++ b/kotlin/baton/src/jvmTest/kotlin/baton/anilist/AniListDocuments.kt
@@ -0,0 +1,88 @@
+package baton.anilist
+
+import baton.Fragment
+import baton.Mutation
+import baton.Query
+
+/**
+ * The documents of the recording under `spec/anilist/`, compiled from the
+ * schema AniList answered by introspection: one chunk of a user's list, an
+ * entry by `MediaList(id:)`, which the lookup answers from the list's
+ * records, and the save of one entry. The same text as
+ * `swift/Tests/AniListDocuments/AniListDocuments.swift`; `ListQuery` and its
+ * two fragments are the text that asked for the recorded chunks.
+ */
+@Fragment(
+ """
+ fragment EntryRow_mediaList on MediaList {
+ id
+ status
+ progress
+ progressVolumes
+ score
+ repeat
+ priority
+ notes
+ private
+ hiddenFromStatusLists
+ customLists(asArray: true)
+ startedAt { year month day }
+ completedAt { year month day }
+ updatedAt
+ media { id ...MediaCard_media }
+ }
+ """,
+)
+@Fragment(
+ """
+ fragment MediaCard_media on Media {
+ id
+ idMal
+ type
+ format
+ status(version: 2)
+ episodes
+ chapters
+ volumes
+ duration
+ season
+ seasonYear
+ countryOfOrigin
+ isAdult
+ siteUrl
+ title { romaji english native userPreferred }
+ coverImage { large color }
+ nextAiringEpisode { id episode airingAt }
+ }
+ """,
+)
+@Query(
+ $$"""
+ query ListQuery($userId: Int!, $mediaType: MediaType!, $chunk: Int!) {
+ MediaListCollection(userId: $userId, type: $mediaType, chunk: $chunk, perChunk: 500, forceSingleCompletedList: true) {
+ hasNextChunk
+ lists {
+ name
+ isCustomList
+ status
+ entries { id ...EntryRow_mediaList }
+ }
+ }
+ }
+ """,
+)
+@Query(
+ $$"""
+ query EntryQuery($id: Int!) {
+ MediaList(id: $id) { id ...EntryRow_mediaList }
+ }
+ """,
+)
+@Mutation(
+ $$"""
+ mutation SaveEntryMutation($id: Int, $progress: Int) {
+ SaveMediaListEntry(id: $id, progress: $progress) { id ...EntryRow_mediaList }
+ }
+ """,
+)
+object AniListDocuments
diff --git a/kotlin/baton/src/jvmTest/kotlin/baton/anilist/AniListTests.kt b/kotlin/baton/src/jvmTest/kotlin/baton/anilist/AniListTests.kt
new file mode 100644
index 00000000..e88644ca
--- /dev/null
+++ b/kotlin/baton/src/jvmTest/kotlin/baton/anilist/AniListTests.kt
@@ -0,0 +1,245 @@
+package baton.anilist
+
+import androidx.compose.runtime.snapshots.Snapshot
+import baton.Environment
+import baton.Hold
+import baton.Json
+import baton.Phase
+import baton.Spec
+import baton.Store
+import baton.Transport
+import baton.Variable
+import baton.dump
+import baton.testing.RecordedTransport
+import java.io.File
+import kotlin.test.Test
+import kotlin.test.assertEquals
+import kotlin.test.assertIs
+import kotlin.test.assertNotNull
+import kotlin.test.assertNull
+import kotlin.test.assertTrue
+import kotlinx.coroutines.ExperimentalCoroutinesApi
+import kotlinx.coroutines.async
+import kotlinx.coroutines.test.StandardTestDispatcher
+import kotlinx.coroutines.test.TestScope
+import kotlinx.coroutines.test.runCurrent
+import kotlinx.coroutines.test.runTest
+
+/**
+ * A list recorded from AniList: the documents in `AniListDocuments.kt` read
+ * through the responses under `spec/anilist/`, as
+ * `swift/Tests/BatonAniListTests/AniListTests.swift` reads them, against the
+ * same dump.
+ */
+@OptIn(ExperimentalCoroutinesApi::class)
+class AniListTests {
+ /** A response recorded from AniList, by file name under `spec/anilist/`. */
+ private fun recorded(name: String): ByteArray = Spec.bytes("anilist/$name")
+
+ /** A transport that answers each chunk of the list with its recording and the save of entry 991 with its shaped response. */
+ private fun aniListTransport(): RecordedTransport = RecordedTransport { request ->
+ when {
+ request.operationName == SaveEntryMutation.name -> recorded("save-entry-991-progress.json")
+ request.operationName != ListQuery.name -> null
+ else -> (request.variables["chunk"] as? Variable.Int)?.value?.takeIf { it <= 2L }?.let { recorded("list-anime-chunk-$it.json") }
+ }
+ }
+
+ /** The two chunks as the list's screen asks for them: one handle a chunk. */
+ private val chunks = listOf(ListQuery(userId = 0, mediaType = MediaType.ANIME, chunk = 1), ListQuery(userId = 0, mediaType = MediaType.ANIME, chunk = 2))
+
+ /** An environment over [transport] on the test's scheduler, committing and ingesting on one test dispatcher, with no log. */
+ private fun TestScope.environment(transport: Transport): Environment {
+ val dispatcher = StandardTestDispatcher(testScheduler)
+ return Environment(transport, null, Store(), dispatcher, dispatcher).also { it.log = null }
+ }
+
+ /** The two chunks, fetched and held as a screen holds them. */
+ private suspend fun TestScope.listScreen(environment: Environment): Pair, List> {
+ val readings = ArrayList()
+ val holds = ArrayList()
+ for (chunk in chunks) {
+ val handle = environment.handle(chunk)
+ holds.add(handle.retain())
+ runCurrent()
+ handle.settle()
+ readings.add(assertIs>(handle.phase, "chunk ${chunk.chunk} arrives").data)
+ }
+ return readings to holds
+ }
+
+ /** The entries of one chunk's reading, in the order the response lists them. */
+ private fun entries(data: ListQuery.Data): List =
+ data.MediaListCollection?.lists.orEmpty().flatMap { group -> group.entries.orEmpty().map { it.entryRow } }
+
+ /** The entries of the recording, from the response's own JSON: what each lens must read. */
+ @Suppress("UNCHECKED_CAST")
+ private fun recordedEntries(chunk: Int): List