Repository: apollographql/apollo-rs
Pull request #471 (2023-03-10 11:42:22)

chore(parser,compiler): check that test numbers are unique
We use the test numbers for ordering so that the file IDs generated by the compiler are consistent between runs.

Initially did this as an xtask but I think it's better if we don't have to manually run it, so now it's part of the test suite instead. It suggests a new filename if you use a duplicate. <strike>I kept the updates to xtask dependencies in this PR.</strike> pulling it out and rebasing to reduce commit noise

We already had a duplicate number 😇 so I moved that file to the end. That's why there are many file ID changes. This PR should guarantee that we never have to do that again…


Patch:
diff --git a/crates/apollo-parser/Cargo.toml b/crates/apollo-parser/Cargo.toml
index 20a4659..281cdaf 100644
--- a/crates/apollo-parser/Cargo.toml
+++ b/crates/apollo-parser/Cargo.toml
@@ -21,6 +21,7 @@ rowan = "0.15.5"
 thiserror = "1.0.30"
 
 [dev-dependencies]
+indexmap = "1.9.2"
 miette = { version = "3.2.0", features = ["fancy"] }
 apollo-encoder = { path = "../apollo-encoder", version = "0.5.0", features = [
     "apollo-parser",
diff --git a/xtask/Cargo.toml b/xtask/Cargo.toml
index ab1bde6..0c9d9c0 100644
--- a/xtask/Cargo.toml
+++ b/xtask/Cargo.toml
@@ -2,14 +2,12 @@
 name = "xtask"
 version = "0.1.0"
 publish = false
-edition = "2018"
-
-# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
+edition = "2021"
 
 [dependencies]
 ungrammar = "1.14.5"
 proc-macro2 = "1.0.8"
 quote = "1.0.2"
-xshell = "0.1"
+xshell = "0.2"
 anyhow = "1"
-structopt = { version = "0.3", default-features = false }
+clap = { version = "4.1.8", features = ["derive"] }
diff --git a/xtask/src/codegen/mod.rs b/xtask/src/codegen/mod.rs
index 2bb0832..7da93b2 100644
--- a/xtask/src/codegen/mod.rs
+++ b/xtask/src/codegen/mod.rs
@@ -4,7 +4,7 @@ mod gen_syntax_nodes;
 use std::collections::BTreeSet;
 
 use anyhow::Result;
-use structopt::StructOpt;
+use clap::Parser;
 use ungrammar::{Grammar, Rule};
 
 use crate::{
@@ -16,7 +16,7 @@ use crate::{
 use gen_syntax_kinds::generate_kinds;
 use gen_syntax_nodes::generate_nodes;
 
-#[derive(Debug, StructOpt)]
+#[derive(Debug, Parser)]
 pub struct Codegen {}
 
 impl Codegen {
diff --git a/xtask/src/main.rs b/xtask/src/main.rs
index 58dc64a..18eb813 100644
--- a/xtask/src/main.rs
+++ b/xtask/src/main.rs
@@ -8,25 +8,25 @@ use std::{
 };
 
 use anyhow::{bail, Result};
-use structopt::StructOpt;
-use xshell::{cmd, pushenv};
+use clap::{Parser, Subcommand};
+use xshell::{cmd, Shell};
 
 fn main() -> Result<()> {
-    let app = Xtask::from_args();
+    let app = Xtask::parse();
     app.run()
 }
 
-#[derive(Debug, StructOpt)]
-#[structopt(name = "xtask", about = "apollo-rs development workflows")]
+#[derive(Debug, Parser)]
+#[clap(name = "xtask", about = "apollo-rs development workflows")]
 struct Xtask {
-    #[structopt(subcommand)]
+    #[clap(subcommand)]
     pub command: Command,
 
-    #[structopt(long = "verbose", short = "v", global = true)]
+    #[clap(long = "verbose", short = 'v', global = true)]
     verbose: bool,
 }
 
-#[derive(Debug, StructOpt)]
+#[derive(Debug, Subcommand)]
 pub enum Command {
     /// Perform code generation for the parser
     Codegen(codegen::Codegen),
@@ -53,7 +53,9 @@ fn root_path() -> PathBuf {
 }
 
 fn rustfmt() -> Result<()> {
-    let out = cmd!("rustfmt --version").read()?;
+    let sh = Shell::new()?;
+
+    let out = cmd!(sh, "rustfmt --version").read()?;
     if !out.contains("stable") {
         bail!(
             "Failed to run rustfmt from toolchain 'stable'. \
@@ -64,9 +66,10 @@ fn rustfmt() -> Result<()> {
 }
 
 fn reformat(text: &str) -> Result<String> {
-    let _e = pushenv("RUSTUP_TOOLCHAIN", "stable");
+    let sh = Shell::new()?;
+    let _e = sh.push_env("RUSTUP_TOOLCHAIN", "stable");
     rustfmt()?;
-    let stdout = cmd!("rustfmt --config fn_single_line=true")
+    let stdout = cmd!(sh, "rustfmt --config fn_single_line=true")
         .stdin(text)
         .read()?;
     Ok(format!(


Test patch:
diff --git a/crates/apollo-compiler/src/tests.rs b/crates/apollo-compiler/src/tests.rs
index bfd9f1a..fb93ec8 100644
--- a/crates/apollo-compiler/src/tests.rs
+++ b/crates/apollo-compiler/src/tests.rs
@@ -5,6 +5,7 @@
 // This is also an exact setup as we have in `apollo-parser`, in the future we
 // might want to consider merging the two dirs. (@lrlna)
 
+use indexmap::IndexMap;
 use std::{
     env, fs,
     path::{Path, PathBuf},
@@ -108,16 +109,48 @@ fn collect_graphql_files(root_dir: &Path, paths: &[&str]) -> Vec<(PathBuf, Strin
 
 /// Collects paths to all `.graphql` files from `dir` in a sorted `Vec<PathBuf>`.
 fn graphql_files_in_dir(dir: &Path) -> Vec<PathBuf> {
-    let mut acc = Vec::new();
-    for file in fs::read_dir(dir).unwrap() {
-        let file = file.unwrap();
-        let path = file.path();
-        if path.extension().unwrap_or_default() == "graphql" {
-            acc.push(path);
+    let mut paths = fs::read_dir(dir)
+        .unwrap()
+        .map(|file| {
+            let file = file?;
+            let path = file.path();
+            if path.extension().unwrap_or_default() == "graphql" {
+                Ok(Some(path))
+            } else {
+                Ok(None)
+            }
+        })
+        // Get rid of the `None`s
+        .filter_map(|result: std::io::Result<_>| result.transpose())
+        .collect::<Result<Vec<_>, _>>()
+        .unwrap();
+
+    paths.sort();
+
+    // Check for duplicate numbers.
+    let mut seen = IndexMap::new();
+    let next_number = paths.len() + 1;
+    for path in &paths {
+        let file_name = path.file_name().unwrap().to_string_lossy();
+        let (number, name): (usize, _) = match file_name.split_once('_') {
+            Some((number, name)) => match number.parse() {
+                Ok(number) => (number, name),
+                Err(err) => {
+                    panic!("Invalid test file name: {path:?} does not start with a number ({err})")
+                }
+            },
+            None => panic!("Invalid test file name: {path:?} does not start with a number"),
+        };
+
+        if let Some(existing) = seen.get(&number) {
+            let suggest = dir.join(format!("{next_number:03}_{name}"));
+            panic!("Conflicting test file: {path:?} has the same number as {existing:?}. Suggested name: {suggest:?}");
         }
+
+        seen.insert(number, path);
     }
-    acc.sort();
-    acc
+
+    paths
 }
 
 /// PathBuf of test fixtures directory.
diff --git a/crates/apollo-compiler/test_data/diagnostics/0029_directive_definitions_with_duplicate_names.txt b/crates/apollo-compiler/test_data/diagnostics/0029_directive_definitions_with_duplicate_names.txt
index b964594..4f6aa85 100644
--- a/crates/apollo-compiler/test_data/diagnostics/0029_directive_definitions_with_duplicate_names.txt
+++ b/crates/apollo-compiler/test_data/diagnostics/0029_directive_definitions_with_duplicate_names.txt
@@ -1,11 +1,11 @@
 [
     ApolloDiagnostic {
         cache: {
-            29: "0029_directive_definitions_with_duplicate_names.graphql",
+            28: "0029_directive_definitions_with_duplicate_names.graphql",
         },
         location: DiagnosticLocation {
             file_id: FileId {
-                id: 29,
+                id: 28,
             },
             offset: 116,
             length: 3,
@@ -14,7 +14,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 29,
+                        id: 28,
                     },
                     offset: 91,
                     length: 3,
@@ -24,7 +24,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 29,
+                        id: 28,
                     },
                     offset: 116,
                     length: 3,
@@ -40,14 +40,14 @@
             name: "foo",
             original_definition: DiagnosticLocation {
                 file_id: FileId {
-                    id: 29,
+                    id: 28,
                 },
                 offset: 91,
                 length: 3,
             },
             redefined_definition: DiagnosticLocation {
                 file_id: FileId {
-                    id: 29,
+                    id: 28,
                 },
                 offset: 116,
                 length: 3,
diff --git a/crates/apollo-compiler/test_data/diagnostics/0030_schema_with_duplicate_input_objects.txt b/crates/apollo-compiler/test_data/diagnostics/0030_schema_with_duplicate_input_objects.txt
index 2d5ebb7..db5911f 100644
--- a/crates/apollo-compiler/test_data/diagnostics/0030_schema_with_duplicate_input_objects.txt
+++ b/crates/apollo-compiler/test_data/diagnostics/0030_schema_with_duplicate_input_objects.txt
@@ -1,11 +1,11 @@
 [
     ApolloDiagnostic {
         cache: {
-            30: "0030_schema_with_duplicate_input_objects.graphql",
+            29: "0030_schema_with_duplicate_input_objects.graphql",
         },
         location: DiagnosticLocation {
             file_id: FileId {
-                id: 30,
+                id: 29,
             },
             offset: 162,
             length: 7,
@@ -14,7 +14,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 30,
+                        id: 29,
                     },
                     offset: 121,
                     length: 7,
@@ -24,7 +24,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 30,
+                        id: 29,
                     },
                     offset: 162,
                     length: 7,
@@ -40,14 +40,14 @@
             name: "Point2D",
             original_definition: DiagnosticLocation {
                 file_id: FileId {
-                    id: 30,
+                    id: 29,
                 },
                 offset: 121,
                 length: 7,
             },
             redefined_definition: DiagnosticLocation {
                 file_id: FileId {
-                    id: 30,
+                    id: 29,
                 },
                 offset: 162,
                 length: 7,
diff --git a/crates/apollo-compiler/test_data/diagnostics/0031_input_object_with_duplicate_fields.txt b/crates/apollo-compiler/test_data/diagnostics/0031_input_object_with_duplicate_fields.txt
index 8bc6778..8af72d0 100644
--- a/crates/apollo-compiler/test_data/diagnostics/0031_input_object_with_duplicate_fields.txt
+++ b/crates/apollo-compiler/test_data/diagnostics/0031_input_object_with_duplicate_fields.txt
@@ -1,11 +1,11 @@
 [
     ApolloDiagnostic {
         cache: {
-            31: "0031_input_object_with_duplicate_fields.graphql",
+            30: "0031_input_object_with_duplicate_fields.graphql",
         },
         location: DiagnosticLocation {
             file_id: FileId {
-                id: 31,
+                id: 30,
             },
             offset: 133,
             length: 8,
@@ -14,7 +14,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 31,
+                        id: 30,
                     },
                     offset: 133,
                     length: 8,
@@ -24,7 +24,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 31,
+                        id: 30,
                     },
                     offset: 144,
                     length: 8,
@@ -39,14 +39,14 @@
             name: "x",
             original_value: DiagnosticLocation {
                 file_id: FileId {
-                    id: 31,
+                    id: 30,
                 },
                 offset: 133,
                 length: 8,
             },
             redefined_value: DiagnosticLocation {
                 file_id: FileId {
-                    id: 31,
+                    id: 30,
                 },
                 offset: 144,
                 length: 8,
diff --git a/crates/apollo-compiler/test_data/diagnostics/0032_duplicate_object_type_definition.txt b/crates/apollo-compiler/test_data/diagnostics/0032_duplicate_object_type_definition.txt
index 7f97302..2637c53 100644
--- a/crates/apollo-compiler/test_data/diagnostics/0032_duplicate_object_type_definition.txt
+++ b/crates/apollo-compiler/test_data/diagnostics/0032_duplicate_object_type_definition.txt
@@ -1,11 +1,11 @@
 [
     ApolloDiagnostic {
         cache: {
-            32: "0032_duplicate_object_type_definition.graphql",
+            31: "0032_duplicate_object_type_definition.graphql",
         },
         location: DiagnosticLocation {
             file_id: FileId {
-                id: 32,
+                id: 31,
             },
             offset: 36,
             length: 5,
@@ -14,7 +14,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 32,
+                        id: 31,
                     },
                     offset: 5,
                     length: 5,
@@ -24,7 +24,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 32,
+                        id: 31,
                     },
                     offset: 36,
                     length: 5,
@@ -40,14 +40,14 @@
             name: "Query",
             original_definition: DiagnosticLocation {
                 file_id: FileId {
-                    id: 32,
+                    id: 31,
                 },
                 offset: 5,
                 length: 5,
             },
             redefined_definition: DiagnosticLocation {
                 file_id: FileId {
-                    id: 32,
+                    id: 31,
                 },
                 offset: 36,
                 length: 5,
diff --git a/crates/apollo-compiler/test_data/diagnostics/0033_object_type_definition_with_duplicate_fields.txt b/crates/apollo-compiler/test_data/diagnostics/0033_object_type_definition_with_duplicate_fields.txt
index 9c60ff5..38d2d1a 100644
--- a/crates/apollo-compiler/test_data/diagnostics/0033_object_type_definition_with_duplicate_fields.txt
+++ b/crates/apollo-compiler/test_data/diagnostics/0033_object_type_definition_with_duplicate_fields.txt
@@ -1,11 +1,11 @@
 [
     ApolloDiagnostic {
         cache: {
-            33: "0033_object_type_definition_with_duplicate_fields.graphql",
+            32: "0033_object_type_definition_with_duplicate_fields.graphql",
         },
         location: DiagnosticLocation {
             file_id: FileId {
-                id: 33,
+                id: 32,
             },
             offset: 15,
             length: 12,
@@ -14,7 +14,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 33,
+                        id: 32,
                     },
                     offset: 15,
                     length: 12,
@@ -24,7 +24,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 33,
+                        id: 32,
                     },
                     offset: 30,
                     length: 12,
@@ -39,14 +39,14 @@
             field: "name",
             original_definition: DiagnosticLocation {
                 file_id: FileId {
-                    id: 33,
+                    id: 32,
                 },
                 offset: 15,
                 length: 12,
             },
             redefined_definition: DiagnosticLocation {
                 file_id: FileId {
-                    id: 33,
+                    id: 32,
                 },
                 offset: 30,
                 length: 12,
diff --git a/crates/apollo-compiler/test_data/diagnostics/0034_object_type_definition_with_missing_transitive_fields.txt b/crates/apollo-compiler/test_data/diagnostics/0034_object_type_definition_with_missing_transitive_fields.txt
index da8bbde..fbf7210 100644
--- a/crates/apollo-compiler/test_data/diagnostics/0034_object_type_definition_with_missing_transitive_fields.txt
+++ b/crates/apollo-compiler/test_data/diagnostics/0034_object_type_definition_with_missing_transitive_fields.txt
@@ -1,11 +1,11 @@
 [
     ApolloDiagnostic {
         cache: {
-            34: "0034_object_type_definition_with_missing_transitive_fields.graphql",
+            33: "0034_object_type_definition_with_missing_transitive_fields.graphql",
         },
         location: DiagnosticLocation {
             file_id: FileId {
-                id: 34,
+                id: 33,
             },
             offset: 0,
             length: 56,
@@ -14,7 +14,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 34,
+                        id: 33,
                     },
                     offset: 77,
                     length: 7,
@@ -24,7 +24,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 34,
+                        id: 33,
                     },
                     offset: 0,
                     length: 56,
@@ -41,11 +41,11 @@
     },
     ApolloDiagnostic {
         cache: {
-            34: "0034_object_type_definition_with_missing_transitive_fields.graphql",
+            33: "0034_object_type_definition_with_missing_transitive_fields.graphql",
         },
         location: DiagnosticLocation {
             file_id: FileId {
-                id: 34,
+                id: 33,
             },
             offset: 0,
             length: 56,
@@ -54,7 +54,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 34,
+                        id: 33,
                     },
                     offset: 111,
                     length: 10,
@@ -64,7 +64,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 34,
+                        id: 33,
                     },
                     offset: 0,
                     length: 56,
diff --git a/crates/apollo-compiler/test_data/diagnostics/0035_object_type_definition_with_missing_implements_interfaces_definition.txt b/crates/apollo-compiler/test_data/diagnostics/0035_object_type_definition_with_missing_implements_interfaces_definition.txt
index 2d6bf6f..83cd69e 100644
--- a/crates/apollo-compiler/test_data/diagnostics/0035_object_type_definition_with_missing_implements_interfaces_definition.txt
+++ b/crates/apollo-compiler/test_data/diagnostics/0035_object_type_definition_with_missing_implements_interfaces_definition.txt
@@ -1,11 +1,11 @@
 [
     ApolloDiagnostic {
         cache: {
-            35: "0035_object_type_definition_with_missing_implements_interfaces_definition.graphql",
+            34: "0035_object_type_definition_with_missing_implements_interfaces_definition.graphql",
         },
         location: DiagnosticLocation {
             file_id: FileId {
-                id: 35,
+                id: 34,
             },
             offset: 239,
             length: 8,
@@ -14,7 +14,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 35,
+                        id: 34,
                     },
                     offset: 239,
                     length: 8,
@@ -29,11 +29,11 @@
     },
     ApolloDiagnostic {
         cache: {
-            35: "0035_object_type_definition_with_missing_implements_interfaces_definition.graphql",
+            34: "0035_object_type_definition_with_missing_implements_interfaces_definition.graphql",
         },
         location: DiagnosticLocation {
             file_id: FileId {
-                id: 35,
+                id: 34,
             },
             offset: 22,
             length: 5,
@@ -42,7 +42,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 35,
+                        id: 34,
                     },
                     offset: 22,
                     length: 5,
diff --git a/crates/apollo-compiler/test_data/diagnostics/0036_object_type_with_non_output_field_types.txt b/crates/apollo-compiler/test_data/diagnostics/0036_object_type_with_non_output_field_types.txt
index d9bc1df..32d7845 100644
--- a/crates/apollo-compiler/test_data/diagnostics/0036_object_type_with_non_output_field_types.txt
+++ b/crates/apollo-compiler/test_data/diagnostics/0036_object_type_with_non_output_field_types.txt
@@ -1,11 +1,11 @@
 [
     ApolloDiagnostic {
         cache: {
-            36: "0036_object_type_with_non_output_field_types.graphql",
+            35: "0036_object_type_with_non_output_field_types.graphql",
         },
         location: DiagnosticLocation {
             file_id: FileId {
-                id: 36,
+                id: 35,
             },
             offset: 425,
             length: 5,
@@ -14,7 +14,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 36,
+                        id: 35,
                     },
                     offset: 425,
                     length: 5,
@@ -29,11 +29,11 @@
     },
     ApolloDiagnostic {
         cache: {
-            36: "0036_object_type_with_non_output_field_types.graphql",
+            35: "0036_object_type_with_non_output_field_types.graphql",
         },
         location: DiagnosticLocation {
             file_id: FileId {
-                id: 36,
+                id: 35,
             },
             offset: 240,
             length: 4,
@@ -42,7 +42,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 36,
+                        id: 35,
                     },
                     offset: 240,
                     length: 4,
@@ -57,11 +57,11 @@
     },
     ApolloDiagnostic {
         cache: {
-            36: "0036_object_type_with_non_output_field_types.graphql",
+            35: "0036_object_type_with_non_output_field_types.graphql",
         },
         location: DiagnosticLocation {
             file_id: FileId {
-                id: 36,
+                id: 35,
             },
             offset: 247,
             length: 20,
@@ -70,7 +70,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 36,
+                        id: 35,
                     },
                     offset: 247,
                     length: 20,
@@ -88,11 +88,11 @@
     },
     ApolloDiagnostic {
         cache: {
-            36: "0036_object_type_with_non_output_field_types.graphql",
+            35: "0036_object_type_with_non_output_field_types.graphql",
         },
         location: DiagnosticLocation {
             file_id: FileId {
-                id: 36,
+                id: 35,
             },
             offset: 276,
             length: 8,
@@ -101,7 +101,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 36,
+                        id: 35,
                     },
                     offset: 276,
                     length: 8,
diff --git a/crates/apollo-compiler/test_data/diagnostics/0037_interface_with_non_output_fields.txt b/crates/apollo-compiler/test_data/diagnostics/0037_interface_with_non_output_fields.txt
index e3d1c77..51ab82d 100644
--- a/crates/apollo-compiler/test_data/diagnostics/0037_interface_with_non_output_fields.txt
+++ b/crates/apollo-compiler/test_data/diagnostics/0037_interface_with_non_output_fields.txt
@@ -1,11 +1,11 @@
 [
     ApolloDiagnostic {
         cache: {
-            37: "0037_interface_with_non_output_fields.graphql",
+            36: "0037_interface_with_non_output_fields.graphql",
         },
         location: DiagnosticLocation {
             file_id: FileId {
-                id: 37,
+                id: 36,
             },
             offset: 415,
             length: 5,
@@ -14,7 +14,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 37,
+                        id: 36,
                     },
                     offset: 415,
                     length: 5,
@@ -29,11 +29,11 @@
     },
     ApolloDiagnostic {
         cache: {
-            37: "0037_interface_with_non_output_fields.graphql",
+            36: "0037_interface_with_non_output_fields.graphql",
         },
         location: DiagnosticLocation {
             file_id: FileId {
-                id: 37,
+                id: 36,
             },
             offset: 230,
             length: 4,
@@ -42,7 +42,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 37,
+                        id: 36,
                     },
                     offset: 230,
                     length: 4,
@@ -57,11 +57,11 @@
     },
     ApolloDiagnostic {
         cache: {
-            37: "0037_interface_with_non_output_fields.graphql",
+            36: "0037_interface_with_non_output_fields.graphql",
         },
         location: DiagnosticLocation {
             file_id: FileId {
-                id: 37,
+                id: 36,
             },
             offset: 237,
             length: 20,
@@ -70,7 +70,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 37,
+                        id: 36,
                     },
                     offset: 237,
                     length: 20,
@@ -88,11 +88,11 @@
     },
     ApolloDiagnostic {
         cache: {
-            37: "0037_interface_with_non_output_fields.graphql",
+            36: "0037_interface_with_non_output_fields.graphql",
         },
         location: DiagnosticLocation {
             file_id: FileId {
-                id: 37,
+                id: 36,
             },
             offset: 266,
             length: 8,
@@ -101,7 +101,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 37,
+                        id: 36,
                     },
                     offset: 266,
                     length: 8,
diff --git a/crates/apollo-compiler/test_data/diagnostics/0038_object_type_with_undefined_field_type.txt b/crates/apollo-compiler/test_data/diagnostics/0038_object_type_with_undefined_field_type.txt
index 72bb7bf..e02820b 100644
--- a/crates/apollo-compiler/test_data/diagnostics/0038_object_type_with_undefined_field_type.txt
+++ b/crates/apollo-compiler/test_data/diagnostics/0038_object_type_with_undefined_field_type.txt
@@ -1,11 +1,11 @@
 [
     ApolloDiagnostic {
         cache: {
-            38: "0038_object_type_with_undefined_field_type.graphql",
+            37: "0038_object_type_with_undefined_field_type.graphql",
         },
         location: DiagnosticLocation {
             file_id: FileId {
-                id: 38,
+                id: 37,
             },
             offset: 33,
             length: 3,
@@ -14,7 +14,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 38,
+                        id: 37,
                     },
                     offset: 33,
                     length: 3,
@@ -29,11 +29,11 @@
     },
     ApolloDiagnostic {
         cache: {
-            38: "0038_object_type_with_undefined_field_type.graphql",
+            37: "0038_object_type_with_undefined_field_type.graphql",
         },
         location: DiagnosticLocation {
             file_id: FileId {
-                id: 38,
+                id: 37,
             },
             offset: 53,
             length: 6,
@@ -42,7 +42,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 38,
+                        id: 37,
                     },
                     offset: 53,
                     length: 6,
diff --git a/crates/apollo-compiler/test_data/diagnostics/0039_interface_with_undefined_field_type.txt b/crates/apollo-compiler/test_data/diagnostics/0039_interface_with_undefined_field_type.txt
index 3177002..764e9bf 100644
--- a/crates/apollo-compiler/test_data/diagnostics/0039_interface_with_undefined_field_type.txt
+++ b/crates/apollo-compiler/test_data/diagnostics/0039_interface_with_undefined_field_type.txt
@@ -1,11 +1,11 @@
 [
     ApolloDiagnostic {
         cache: {
-            39: "0039_interface_with_undefined_field_type.graphql",
+            38: "0039_interface_with_undefined_field_type.graphql",
         },
         location: DiagnosticLocation {
             file_id: FileId {
-                id: 39,
+                id: 38,
             },
             offset: 79,
             length: 6,
@@ -14,7 +14,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 39,
+                        id: 38,
                     },
                     offset: 79,
                     length: 6,
@@ -29,11 +29,11 @@
     },
     ApolloDiagnostic {
         cache: {
-            39: "0039_interface_with_undefined_field_type.graphql",
+            38: "0039_interface_with_undefined_field_type.graphql",
         },
         location: DiagnosticLocation {
             file_id: FileId {
-                id: 39,
+                id: 38,
             },
             offset: 33,
             length: 3,
@@ -42,7 +42,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 39,
+                        id: 38,
                     },
                     offset: 33,
                     length: 3,
diff --git a/crates/apollo-compiler/test_data/diagnostics/0040_operation_with_undefined_fields_on_reference_type.txt b/crates/apollo-compiler/test_data/diagnostics/0040_operation_with_undefined_fields_on_reference_type.txt
index 2c4c0fa..8e9ed18 100644
--- a/crates/apollo-compiler/test_data/diagnostics/0040_operation_with_undefined_fields_on_reference_type.txt
+++ b/crates/apollo-compiler/test_data/diagnostics/0040_operation_with_undefined_fields_on_reference_type.txt
@@ -1,11 +1,11 @@
 [
     ApolloDiagnostic {
         cache: {
-            40: "0040_operation_with_undefined_fields_on_reference_type.graphql",
+            39: "0040_operation_with_undefined_fields_on_reference_type.graphql",
         },
         location: DiagnosticLocation {
             file_id: FileId {
-                id: 40,
+                id: 39,
             },
             offset: 21,
             length: 4,
@@ -14,7 +14,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 40,
+                        id: 39,
                     },
                     offset: 21,
                     length: 4,
@@ -24,7 +24,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 40,
+                        id: 39,
                     },
                     offset: 38,
                     length: 52,
@@ -41,11 +41,11 @@
     },
     ApolloDiagnostic {
         cache: {
-            40: "0040_operation_with_undefined_fields_on_reference_type.graphql",
+            39: "0040_operation_with_undefined_fields_on_reference_type.graphql",
         },
         location: DiagnosticLocation {
             file_id: FileId {
-                id: 40,
+                id: 39,
             },
             offset: 28,
             length: 6,
@@ -54,7 +54,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 40,
+                        id: 39,
                     },
                     offset: 28,
                     length: 6,
@@ -64,7 +64,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 40,
+                        id: 39,
                     },
                     offset: 38,
                     length: 52,
diff --git a/crates/apollo-compiler/test_data/diagnostics/0041_subscription_operation_with_undefined_fields.txt b/crates/apollo-compiler/test_data/diagnostics/0041_subscription_operation_with_undefined_fields.txt
index 28c2116..ae4e8fb 100644
--- a/crates/apollo-compiler/test_data/diagnostics/0041_subscription_operation_with_undefined_fields.txt
+++ b/crates/apollo-compiler/test_data/diagnostics/0041_subscription_operation_with_undefined_fields.txt
@@ -1,11 +1,11 @@
 [
     ApolloDiagnostic {
         cache: {
-            41: "0041_subscription_operation_with_undefined_fields.graphql",
+            40: "0041_subscription_operation_with_undefined_fields.graphql",
         },
         location: DiagnosticLocation {
             file_id: FileId {
-                id: 41,
+                id: 40,
             },
             offset: 21,
             length: 26,
@@ -14,7 +14,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 41,
+                        id: 40,
                     },
                     offset: 21,
                     length: 26,
@@ -24,7 +24,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 41,
+                        id: 40,
                     },
                     offset: 51,
                     length: 42,
diff --git a/crates/apollo-compiler/test_data/diagnostics/0042_mutation_operation_with_undefined_fields.txt b/crates/apollo-compiler/test_data/diagnostics/0042_mutation_operation_with_undefined_fields.txt
index 4ce4a11..29fcc52 100644
--- a/crates/apollo-compiler/test_data/diagnostics/0042_mutation_operation_with_undefined_fields.txt
+++ b/crates/apollo-compiler/test_data/diagnostics/0042_mutation_operation_with_undefined_fields.txt
@@ -1,11 +1,11 @@
 [
     ApolloDiagnostic {
         cache: {
-            42: "0042_mutation_operation_with_undefined_fields.graphql",
+            41: "0042_mutation_operation_with_undefined_fields.graphql",
         },
         location: DiagnosticLocation {
             file_id: FileId {
-                id: 42,
+                id: 41,
             },
             offset: 217,
             length: 3,
@@ -14,7 +14,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 42,
+                        id: 41,
                     },
                     offset: 217,
                     length: 3,
@@ -29,11 +29,11 @@
     },
     ApolloDiagnostic {
         cache: {
-            42: "0042_mutation_operation_with_undefined_fields.graphql",
+            41: "0042_mutation_operation_with_undefined_fields.graphql",
         },
         location: DiagnosticLocation {
             file_id: FileId {
-                id: 42,
+                id: 41,
             },
             offset: 223,
             length: 3,
@@ -42,7 +42,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 42,
+                        id: 41,
                     },
                     offset: 223,
                     length: 3,
@@ -57,11 +57,11 @@
     },
     ApolloDiagnostic {
         cache: {
-            42: "0042_mutation_operation_with_undefined_fields.graphql",
+            41: "0042_mutation_operation_with_undefined_fields.graphql",
         },
         location: DiagnosticLocation {
             file_id: FileId {
-                id: 42,
+                id: 41,
             },
             offset: 31,
             length: 22,
@@ -70,7 +70,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 42,
+                        id: 41,
                     },
                     offset: 31,
                     length: 22,
@@ -80,7 +80,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 42,
+                        id: 41,
                     },
                     offset: 100,
                     length: 69,
diff --git a/crates/apollo-compiler/test_data/diagnostics/0043_undefined_union_member.txt b/crates/apollo-compiler/test_data/diagnostics/0043_undefined_union_member.txt
index 335effc..0fafa4e 100644
--- a/crates/apollo-compiler/test_data/diagnostics/0043_undefined_union_member.txt
+++ b/crates/apollo-compiler/test_data/diagnostics/0043_undefined_union_member.txt
@@ -1,11 +1,11 @@
 [
     ApolloDiagnostic {
         cache: {
-            43: "0043_undefined_union_member.graphql",
+            42: "0043_undefined_union_member.graphql",
         },
         location: DiagnosticLocation {
             file_id: FileId {
-                id: 43,
+                id: 42,
             },
             offset: 132,
             length: 3,
@@ -14,7 +14,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 43,
+                        id: 42,
                     },
                     offset: 132,
                     length: 3,
diff --git a/crates/apollo-compiler/test_data/diagnostics/0044_union_member_not_of_object_type.txt b/crates/apollo-compiler/test_data/diagnostics/0044_union_member_not_of_object_type.txt
index f4b46f2..0083818 100644
--- a/crates/apollo-compiler/test_data/diagnostics/0044_union_member_not_of_object_type.txt
+++ b/crates/apollo-compiler/test_data/diagnostics/0044_union_member_not_of_object_type.txt
@@ -1,11 +1,11 @@
 [
     ApolloDiagnostic {
         cache: {
-            44: "0044_union_member_not_of_object_type.graphql",
+            43: "0044_union_member_not_of_object_type.graphql",
         },
         location: DiagnosticLocation {
             file_id: FileId {
-                id: 44,
+                id: 43,
             },
             offset: 219,
             length: 3,
@@ -14,7 +14,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 44,
+                        id: 43,
                     },
                     offset: 219,
                     length: 3,
diff --git a/crates/apollo-compiler/test_data/diagnostics/0045_operation_with_unused_variable_in_fragment.txt b/crates/apollo-compiler/test_data/diagnostics/0045_operation_with_unused_variable_in_fragment.txt
index bc08095..61f4f36 100644
--- a/crates/apollo-compiler/test_data/diagnostics/0045_operation_with_unused_variable_in_fragment.txt
+++ b/crates/apollo-compiler/test_data/diagnostics/0045_operation_with_unused_variable_in_fragment.txt
@@ -1,11 +1,11 @@
 [
     ApolloDiagnostic {
         cache: {
-            45: "0045_operation_with_unused_variable_in_fragment.graphql",
+            44: "0045_operation_with_unused_variable_in_fragment.graphql",
         },
         location: DiagnosticLocation {
             file_id: FileId {
-                id: 45,
+                id: 44,
             },
             offset: 192,
             length: 6,
@@ -14,7 +14,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 45,
+                        id: 44,
                     },
                     offset: 192,
                     length: 6,
@@ -29,11 +29,11 @@
     },
     ApolloDiagnostic {
         cache: {
-            45: "0045_operation_with_unused_variable_in_fragment.graphql",
+            44: "0045_operation_with_unused_variable_in_fragment.graphql",
         },
         location: DiagnosticLocation {
             file_id: FileId {
-                id: 45,
+                id: 44,
             },
             offset: 19,
             length: 14,
@@ -42,7 +42,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 45,
+                        id: 44,
                     },
                     offset: 19,
                     length: 14,
diff --git a/crates/apollo-compiler/test_data/diagnostics/0046_duplicate_directive_arguments.txt b/crates/apollo-compiler/test_data/diagnostics/0046_duplicate_directive_arguments.txt
index 2a96ae8..3d8d49c 100644
--- a/crates/apollo-compiler/test_data/diagnostics/0046_duplicate_directive_arguments.txt
+++ b/crates/apollo-compiler/test_data/diagnostics/0046_duplicate_directive_arguments.txt
@@ -1,11 +1,11 @@
 [
     ApolloDiagnostic {
         cache: {
-            46: "0046_duplicate_directive_arguments.graphql",
+            45: "0046_duplicate_directive_arguments.graphql",
         },
         location: DiagnosticLocation {
             file_id: FileId {
-                id: 46,
+                id: 45,
             },
             offset: 74,
             length: 42,
@@ -14,7 +14,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 46,
+                        id: 45,
                     },
                     offset: 30,
                     length: 42,
@@ -24,7 +24,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 46,
+                        id: 45,
                     },
                     offset: 74,
                     length: 42,
@@ -39,14 +39,14 @@
             name: "url",
             original_definition: DiagnosticLocation {
                 file_id: FileId {
-                    id: 46,
+                    id: 45,
                 },
                 offset: 30,
                 length: 42,
             },
             redefined_definition: DiagnosticLocation {
                 file_id: FileId {
-                    id: 46,
+                    id: 45,
                 },
                 offset: 74,
                 length: 42,
@@ -55,11 +55,11 @@
     },
     ApolloDiagnostic {
         cache: {
-            46: "0046_duplicate_directive_arguments.graphql",
+            45: "0046_duplicate_directive_arguments.graphql",
         },
         location: DiagnosticLocation {
             file_id: FileId {
-                id: 46,
+                id: 45,
             },
             offset: 189,
             length: 8,
@@ -68,7 +68,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 46,
+                        id: 45,
                     },
                     offset: 178,
                     length: 9,
@@ -78,7 +78,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 46,
+                        id: 45,
                     },
                     offset: 189,
                     length: 8,
@@ -93,14 +93,14 @@
             name: "if",
             original_definition: DiagnosticLocation {
                 file_id: FileId {
-                    id: 46,
+                    id: 45,
                 },
                 offset: 178,
                 length: 9,
             },
             redefined_definition: DiagnosticLocation {
                 file_id: FileId {
-                    id: 46,
+                    id: 45,
                 },
                 offset: 189,
                 length: 8,
diff --git a/crates/apollo-compiler/test_data/diagnostics/0047_duplicate_field_arguments.txt b/crates/apollo-compiler/test_data/diagnostics/0047_duplicate_field_arguments.txt
index 0cd85a3..4c570e2 100644
--- a/crates/apollo-compiler/test_data/diagnostics/0047_duplicate_field_arguments.txt
+++ b/crates/apollo-compiler/test_data/diagnostics/0047_duplicate_field_arguments.txt
@@ -1,11 +1,11 @@
 [
     ApolloDiagnostic {
         cache: {
-            47: "0047_duplicate_field_arguments.graphql",
+            46: "0047_duplicate_field_arguments.graphql",
         },
         location: DiagnosticLocation {
             file_id: FileId {
-                id: 47,
+                id: 46,
             },
             offset: 84,
             length: 10,
@@ -14,7 +14,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 47,
+                        id: 46,
                     },
                     offset: 73,
                     length: 9,
@@ -24,7 +24,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 47,
+                        id: 46,
                     },
                     offset: 84,
                     length: 10,
@@ -39,14 +39,14 @@
             name: "arg",
             original_definition: DiagnosticLocation {
                 file_id: FileId {
-                    id: 47,
+                    id: 46,
                 },
                 offset: 73,
                 length: 9,
             },
             redefined_definition: DiagnosticLocation {
                 file_id: FileId {
-                    id: 47,
+                    id: 46,
                 },
                 offset: 84,
                 length: 10,
diff --git a/crates/apollo-compiler/test_data/diagnostics/0048_duplicate_field_argument_definition_names.txt b/crates/apollo-compiler/test_data/diagnostics/0048_duplicate_field_argument_definition_names.txt
index c3d732d..6c27ffd 100644
--- a/crates/apollo-compiler/test_data/diagnostics/0048_duplicate_field_argument_definition_names.txt
+++ b/crates/apollo-compiler/test_data/diagnostics/0048_duplicate_field_argument_definition_names.txt
@@ -1,11 +1,11 @@
 [
     ApolloDiagnostic {
         cache: {
-            48: "0048_duplicate_field_argument_definition_names.graphql",
+            47: "0048_duplicate_field_argument_definition_names.graphql",
         },
         location: DiagnosticLocation {
             file_id: FileId {
-                id: 48,
+                id: 47,
             },
             offset: 34,
             length: 12,
@@ -14,7 +14,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 48,
+                        id: 47,
                     },
                     offset: 34,
                     length: 12,
@@ -24,7 +24,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 48,
+                        id: 47,
                     },
                     offset: 48,
                     length: 12,
@@ -39,14 +39,14 @@
             name: "arg",
             original_value: DiagnosticLocation {
                 file_id: FileId {
-                    id: 48,
+                    id: 47,
                 },
                 offset: 34,
                 length: 12,
             },
             redefined_value: DiagnosticLocation {
                 file_id: FileId {
-                    id: 48,
+                    id: 47,
                 },
                 offset: 48,
                 length: 12,
@@ -55,11 +55,11 @@
     },
     ApolloDiagnostic {
         cache: {
-            48: "0048_duplicate_field_argument_definition_names.graphql",
+            47: "0048_duplicate_field_argument_definition_names.graphql",
         },
         location: DiagnosticLocation {
             file_id: FileId {
-                id: 48,
+                id: 47,
             },
             offset: 144,
             length: 12,
@@ -68,7 +68,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 48,
+                        id: 47,
                     },
                     offset: 144,
                     length: 12,
@@ -78,7 +78,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 48,
+                        id: 47,
                     },
                     offset: 158,
                     length: 12,
@@ -93,14 +93,14 @@
             name: "arg",
             original_value: DiagnosticLocation {
                 file_id: FileId {
-                    id: 48,
+                    id: 47,
                 },
                 offset: 144,
                 length: 12,
             },
             redefined_value: DiagnosticLocation {
                 file_id: FileId {
-                    id: 48,
+                    id: 47,
                 },
                 offset: 158,
                 length: 12,
diff --git a/crates/apollo-compiler/test_data/diagnostics/0049_duplicate_directive_argument_definition_names.txt b/crates/apollo-compiler/test_data/diagnostics/0049_duplicate_directive_argument_definition_names.txt
index e6b3183..d100521 100644
--- a/crates/apollo-compiler/test_data/diagnostics/0049_duplicate_directive_argument_definition_names.txt
+++ b/crates/apollo-compiler/test_data/diagnostics/0049_duplicate_directive_argument_definition_names.txt
@@ -1,11 +1,11 @@
 [
     ApolloDiagnostic {
         cache: {
-            49: "0049_duplicate_directive_argument_definition_names.graphql",
+            48: "0049_duplicate_directive_argument_definition_names.graphql",
         },
         location: DiagnosticLocation {
             file_id: FileId {
-                id: 49,
+                id: 48,
             },
             offset: 19,
             length: 12,
@@ -14,7 +14,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 49,
+                        id: 48,
                     },
                     offset: 19,
                     length: 12,
@@ -24,7 +24,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 49,
+                        id: 48,
                     },
                     offset: 33,
                     length: 12,
@@ -39,14 +39,14 @@
             name: "arg",
             original_value: DiagnosticLocation {
                 file_id: FileId {
-                    id: 49,
+                    id: 48,
                 },
                 offset: 19,
                 length: 12,
             },
             redefined_value: DiagnosticLocation {
                 file_id: FileId {
-                    id: 49,
+                    id: 48,
                 },
                 offset: 33,
                 length: 12,
diff --git a/crates/apollo-compiler/test_data/diagnostics/0050_directives_in_invalid_locations.txt b/crates/apollo-compiler/test_data/diagnostics/0050_directives_in_invalid_locations.txt
index 318e150..2a72106 100644
--- a/crates/apollo-compiler/test_data/diagnostics/0050_directives_in_invalid_locations.txt
+++ b/crates/apollo-compiler/test_data/diagnostics/0050_directives_in_invalid_locations.txt
@@ -1,11 +1,11 @@
 [
     ApolloDiagnostic {
         cache: {
-            50: "0050_directives_in_invalid_locations.graphql",
+            49: "0050_directives_in_invalid_locations.graphql",
         },
         location: DiagnosticLocation {
             file_id: FileId {
-                id: 50,
+                id: 49,
             },
             offset: 1145,
             length: 18,
@@ -14,7 +14,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 50,
+                        id: 49,
                     },
                     offset: 1145,
                     length: 18,
@@ -33,11 +33,11 @@
     },
     ApolloDiagnostic {
         cache: {
-            50: "0050_directives_in_invalid_locations.graphql",
+            49: "0050_directives_in_invalid_locations.graphql",
         },
         location: DiagnosticLocation {
             file_id: FileId {
-                id: 50,
+                id: 49,
             },
             offset: 1296,
             length: 11,
@@ -46,7 +46,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 50,
+                        id: 49,
                     },
                     offset: 1296,
                     length: 11,
@@ -56,7 +56,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 50,
+                        id: 49,
                     },
                     offset: 1387,
                     length: 29,
@@ -73,7 +73,7 @@
             directive_def: Some(
                 DiagnosticLocation {
                     file_id: FileId {
-                        id: 50,
+                        id: 49,
                     },
                     offset: 1387,
                     length: 29,
@@ -83,11 +83,11 @@
     },
     ApolloDiagnostic {
         cache: {
-            50: "0050_directives_in_invalid_locations.graphql",
+            49: "0050_directives_in_invalid_locations.graphql",
         },
         location: DiagnosticLocation {
             file_id: FileId {
-                id: 50,
+                id: 49,
             },
             offset: 831,
             length: 11,
@@ -96,7 +96,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 50,
+                        id: 49,
                     },
                     offset: 831,
                     length: 11,
@@ -106,7 +106,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 50,
+                        id: 49,
                     },
                     offset: 1356,
                     length: 30,
@@ -123,7 +123,7 @@
             directive_def: Some(
                 DiagnosticLocation {
                     file_id: FileId {
-                        id: 50,
+                        id: 49,
                     },
                     offset: 1356,
                     length: 30,
@@ -133,11 +133,11 @@
     },
     ApolloDiagnostic {
         cache: {
-            50: "0050_directives_in_invalid_locations.graphql",
+            49: "0050_directives_in_invalid_locations.graphql",
         },
         location: DiagnosticLocation {
             file_id: FileId {
-                id: 50,
+                id: 49,
             },
             offset: 853,
             length: 11,
@@ -146,7 +146,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 50,
+                        id: 49,
                     },
                     offset: 853,
                     length: 11,
@@ -156,7 +156,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 50,
+                        id: 49,
                     },
                     offset: 1356,
                     length: 30,
@@ -173,7 +173,7 @@
             directive_def: Some(
                 DiagnosticLocation {
                     file_id: FileId {
-                        id: 50,
+                        id: 49,
                     },
                     offset: 1356,
                     length: 30,
@@ -183,11 +183,11 @@
     },
     ApolloDiagnostic {
         cache: {
-            50: "0050_directives_in_invalid_locations.graphql",
+            49: "0050_directives_in_invalid_locations.graphql",
         },
         location: DiagnosticLocation {
             file_id: FileId {
-                id: 50,
+                id: 49,
             },
             offset: 749,
             length: 11,
@@ -196,7 +196,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 50,
+                        id: 49,
                     },
                     offset: 749,
                     length: 11,
@@ -206,7 +206,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 50,
+                        id: 49,
                     },
                     offset: 1387,
                     length: 29,
@@ -223,7 +223,7 @@
             directive_def: Some(
                 DiagnosticLocation {
                     file_id: FileId {
-                        id: 50,
+                        id: 49,
                     },
                     offset: 1387,
                     length: 29,
@@ -233,11 +233,11 @@
     },
     ApolloDiagnostic {
         cache: {
-            50: "0050_directives_in_invalid_locations.graphql",
+            49: "0050_directives_in_invalid_locations.graphql",
         },
         location: DiagnosticLocation {
             file_id: FileId {
-                id: 50,
+                id: 49,
             },
             offset: 435,
             length: 15,
@@ -246,7 +246,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 50,
+                        id: 49,
                     },
                     offset: 435,
                     length: 15,
@@ -265,11 +265,11 @@
     },
     ApolloDiagnostic {
         cache: {
-            50: "0050_directives_in_invalid_locations.graphql",
+            49: "0050_directives_in_invalid_locations.graphql",
         },
         location: DiagnosticLocation {
             file_id: FileId {
-                id: 50,
+                id: 49,
             },
             offset: 659,
             length: 18,
@@ -278,7 +278,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 50,
+                        id: 49,
                     },
                     offset: 659,
                     length: 18,
@@ -297,11 +297,11 @@
     },
     ApolloDiagnostic {
         cache: {
-            50: "0050_directives_in_invalid_locations.graphql",
+            49: "0050_directives_in_invalid_locations.graphql",
         },
         location: DiagnosticLocation {
             file_id: FileId {
-                id: 50,
+                id: 49,
             },
             offset: 696,
             length: 18,
@@ -310,7 +310,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 50,
+                        id: 49,
                     },
                     offset: 696,
                     length: 18,
@@ -329,11 +329,11 @@
     },
     ApolloDiagnostic {
         cache: {
-            50: "0050_directives_in_invalid_locations.graphql",
+            49: "0050_directives_in_invalid_locations.graphql",
         },
         location: DiagnosticLocation {
             file_id: FileId {
-                id: 50,
+                id: 49,
             },
             offset: 512,
             length: 11,
@@ -342,7 +342,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 50,
+                        id: 49,
                     },
                     offset: 512,
                     length: 11,
@@ -352,7 +352,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 50,
+                        id: 49,
                     },
                     offset: 1387,
                     length: 29,
@@ -369,7 +369,7 @@
             directive_def: Some(
                 DiagnosticLocation {
                     file_id: FileId {
-                        id: 50,
+                        id: 49,
                     },
                     offset: 1387,
                     length: 29,
@@ -379,11 +379,11 @@
     },
     ApolloDiagnostic {
         cache: {
-            50: "0050_directives_in_invalid_locations.graphql",
+            49: "0050_directives_in_invalid_locations.graphql",
         },
         location: DiagnosticLocation {
             file_id: FileId {
-                id: 50,
+                id: 49,
             },
             offset: 896,
             length: 11,
@@ -392,7 +392,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 50,
+                        id: 49,
                     },
                     offset: 896,
                     length: 11,
@@ -411,11 +411,11 @@
     },
     ApolloDiagnostic {
         cache: {
-            50: "0050_directives_in_invalid_locations.graphql",
+            49: "0050_directives_in_invalid_locations.graphql",
         },
         location: DiagnosticLocation {
             file_id: FileId {
-                id: 50,
+                id: 49,
             },
             offset: 968,
             length: 56,
@@ -424,7 +424,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 50,
+                        id: 49,
                     },
                     offset: 968,
                     length: 56,
@@ -443,11 +443,11 @@
     },
     ApolloDiagnostic {
         cache: {
-            50: "0050_directives_in_invalid_locations.graphql",
+            49: "0050_directives_in_invalid_locations.graphql",
         },
         location: DiagnosticLocation {
             file_id: FileId {
-                id: 50,
+                id: 49,
             },
             offset: 46,
             length: 15,
@@ -456,7 +456,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 50,
+                        id: 49,
                     },
                     offset: 46,
                     length: 15,
@@ -475,11 +475,11 @@
     },
     ApolloDiagnostic {
         cache: {
-            50: "0050_directives_in_invalid_locations.graphql",
+            49: "0050_directives_in_invalid_locations.graphql",
         },
         location: DiagnosticLocation {
             file_id: FileId {
-                id: 50,
+                id: 49,
             },
             offset: 29,
             length: 15,
@@ -488,7 +488,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 50,
+                        id: 49,
                     },
                     offset: 29,
                     length: 15,
@@ -507,11 +507,11 @@
     },
     ApolloDiagnostic {
         cache: {
-            50: "0050_directives_in_invalid_locations.graphql",
+            49: "0050_directives_in_invalid_locations.graphql",
         },
         location: DiagnosticLocation {
             file_id: FileId {
-                id: 50,
+                id: 49,
             },
             offset: 99,
             length: 11,
@@ -520,7 +520,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 50,
+                        id: 49,
                     },
                     offset: 99,
                     length: 11,
@@ -539,11 +539,11 @@
     },
     ApolloDiagnostic {
         cache: {
-            50: "0050_directives_in_invalid_locations.graphql",
+            49: "0050_directives_in_invalid_locations.graphql",
         },
         location: DiagnosticLocation {
             file_id: FileId {
-                id: 50,
+                id: 49,
             },
             offset: 133,
             length: 11,
@@ -552,7 +552,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 50,
+                        id: 49,
                     },
                     offset: 133,
                     length: 11,
@@ -562,7 +562,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 50,
+                        id: 49,
                     },
                     offset: 1387,
                     length: 29,
@@ -579,7 +579,7 @@
             directive_def: Some(
                 DiagnosticLocation {
                     file_id: FileId {
-                        id: 50,
+                        id: 49,
                     },
                     offset: 1387,
                     length: 29,
@@ -589,11 +589,11 @@
     },
     ApolloDiagnostic {
         cache: {
-            50: "0050_directives_in_invalid_locations.graphql",
+            49: "0050_directives_in_invalid_locations.graphql",
         },
         location: DiagnosticLocation {
             file_id: FileId {
-                id: 50,
+                id: 49,
             },
             offset: 268,
             length: 11,
@@ -602,7 +602,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 50,
+                        id: 49,
                     },
                     offset: 268,
                     length: 11,
@@ -612,7 +612,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 50,
+                        id: 49,
                     },
                     offset: 1356,
                     length: 30,
@@ -629,7 +629,7 @@
             directive_def: Some(
                 DiagnosticLocation {
                     file_id: FileId {
-                        id: 50,
+                        id: 49,
                     },
                     offset: 1356,
                     length: 30,
@@ -639,11 +639,11 @@
     },
     ApolloDiagnostic {
         cache: {
-            50: "0050_directives_in_invalid_locations.graphql",
+            49: "0050_directives_in_invalid_locations.graphql",
         },
         location: DiagnosticLocation {
             file_id: FileId {
-                id: 50,
+                id: 49,
             },
             offset: 344,
             length: 15,
@@ -652,7 +652,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 50,
+                        id: 49,
                     },
                     offset: 344,
                     length: 15,
@@ -671,11 +671,11 @@
     },
     ApolloDiagnostic {
         cache: {
-            50: "0050_directives_in_invalid_locations.graphql",
+            49: "0050_directives_in_invalid_locations.graphql",
         },
         location: DiagnosticLocation {
             file_id: FileId {
-                id: 50,
+                id: 49,
             },
             offset: 172,
             length: 11,
@@ -684,7 +684,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 50,
+                        id: 49,
                     },
                     offset: 172,
                     length: 11,
@@ -694,7 +694,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 50,
+                        id: 49,
                     },
                     offset: 1387,
                     length: 29,
@@ -711,7 +711,7 @@
             directive_def: Some(
                 DiagnosticLocation {
                     file_id: FileId {
-                        id: 50,
+                        id: 49,
                     },
                     offset: 1387,
                     length: 29,
@@ -721,11 +721,11 @@
     },
     ApolloDiagnostic {
         cache: {
-            50: "0050_directives_in_invalid_locations.graphql",
+            49: "0050_directives_in_invalid_locations.graphql",
         },
         location: DiagnosticLocation {
             file_id: FileId {
-                id: 50,
+                id: 49,
             },
             offset: 211,
             length: 11,
@@ -734,7 +734,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 50,
+                        id: 49,
                     },
                     offset: 211,
                     length: 11,
@@ -744,7 +744,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 50,
+                        id: 49,
                     },
                     offset: 1356,
                     length: 30,
@@ -761,7 +761,7 @@
             directive_def: Some(
                 DiagnosticLocation {
                     file_id: FileId {
-                        id: 50,
+                        id: 49,
                     },
                     offset: 1356,
                     length: 30,
diff --git a/crates/apollo-compiler/test_data/diagnostics/0051_subscription_operation_with_root_introspection_field.txt b/crates/apollo-compiler/test_data/diagnostics/0051_subscription_operation_with_root_introspection_field.txt
index 3e2a952..f8bfd8d 100644
--- a/crates/apollo-compiler/test_data/diagnostics/0051_subscription_operation_with_root_introspection_field.txt
+++ b/crates/apollo-compiler/test_data/diagnostics/0051_subscription_operation_with_root_introspection_field.txt
@@ -1,11 +1,11 @@
 [
     ApolloDiagnostic {
         cache: {
-            51: "0051_subscription_operation_with_root_introspection_field.graphql",
+            50: "0051_subscription_operation_with_root_introspection_field.graphql",
         },
         location: DiagnosticLocation {
             file_id: FileId {
-                id: 51,
+                id: 50,
             },
             offset: 21,
             length: 10,
@@ -14,7 +14,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 51,
+                        id: 50,
                     },
                     offset: 21,
                     length: 10,
diff --git a/crates/apollo-compiler/test_data/diagnostics/0052_undefined_directive.txt b/crates/apollo-compiler/test_data/diagnostics/0052_undefined_directive.txt
index c5f6c4d..95a0d6c 100644
--- a/crates/apollo-compiler/test_data/diagnostics/0052_undefined_directive.txt
+++ b/crates/apollo-compiler/test_data/diagnostics/0052_undefined_directive.txt
@@ -1,11 +1,11 @@
 [
     ApolloDiagnostic {
         cache: {
-            52: "0052_undefined_directive.graphql",
+            51: "0052_undefined_directive.graphql",
         },
         location: DiagnosticLocation {
             file_id: FileId {
-                id: 52,
+                id: 51,
             },
             offset: 46,
             length: 11,
@@ -14,7 +14,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 52,
+                        id: 51,
                     },
                     offset: 46,
                     length: 11,
diff --git a/crates/apollo-compiler/test_data/diagnostics/0053_argument_name_is_not_defined.txt b/crates/apollo-compiler/test_data/diagnostics/0053_argument_name_is_not_defined.txt
index a0caa78..2cb46ac 100644
--- a/crates/apollo-compiler/test_data/diagnostics/0053_argument_name_is_not_defined.txt
+++ b/crates/apollo-compiler/test_data/diagnostics/0053_argument_name_is_not_defined.txt
@@ -1,11 +1,11 @@
 [
     ApolloDiagnostic {
         cache: {
-            53: "0053_argument_name_is_not_defined.graphql",
+            52: "0053_argument_name_is_not_defined.graphql",
         },
         location: DiagnosticLocation {
             file_id: FileId {
-                id: 53,
+                id: 52,
             },
             offset: 116,
             length: 7,
@@ -14,7 +14,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 53,
+                        id: 52,
                     },
                     offset: 116,
                     length: 7,
@@ -24,7 +24,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 53,
+                        id: 52,
                     },
                     offset: 15,
                     length: 21,
@@ -39,11 +39,11 @@
     },
     ApolloDiagnostic {
         cache: {
-            53: "0053_argument_name_is_not_defined.graphql",
+            52: "0053_argument_name_is_not_defined.graphql",
         },
         location: DiagnosticLocation {
             file_id: FileId {
-                id: 53,
+                id: 52,
             },
             offset: 79,
             length: 7,
@@ -52,7 +52,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 53,
+                        id: 52,
                     },
                     offset: 79,
                     length: 7,
@@ -62,7 +62,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 53,
+                        id: 52,
                     },
                     offset: 15,
                     length: 21,
@@ -77,11 +77,11 @@
     },
     ApolloDiagnostic {
         cache: {
-            53: "0053_argument_name_is_not_defined.graphql",
+            52: "0053_argument_name_is_not_defined.graphql",
         },
         location: DiagnosticLocation {
             file_id: FileId {
-                id: 53,
+                id: 52,
             },
             offset: 88,
             length: 7,
@@ -90,7 +90,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 53,
+                        id: 52,
                     },
                     offset: 88,
                     length: 7,
@@ -100,7 +100,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 53,
+                        id: 52,
                     },
                     offset: 15,
                     length: 21,
diff --git a/crates/apollo-compiler/test_data/diagnostics/0054_argument_not_provided.txt b/crates/apollo-compiler/test_data/diagnostics/0054_argument_not_provided.txt
index 61d4613..a2ea8a0 100644
--- a/crates/apollo-compiler/test_data/diagnostics/0054_argument_not_provided.txt
+++ b/crates/apollo-compiler/test_data/diagnostics/0054_argument_not_provided.txt
@@ -1,11 +1,11 @@
 [
     ApolloDiagnostic {
         cache: {
-            54: "0054_argument_not_provided.graphql",
+            53: "0054_argument_not_provided.graphql",
         },
         location: DiagnosticLocation {
             file_id: FileId {
-                id: 54,
+                id: 53,
             },
             offset: 333,
             length: 5,
@@ -14,7 +14,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 54,
+                        id: 53,
                     },
                     offset: 333,
                     length: 5,
@@ -29,11 +29,11 @@
     },
     ApolloDiagnostic {
         cache: {
-            54: "0054_argument_not_provided.graphql",
+            53: "0054_argument_not_provided.graphql",
         },
         location: DiagnosticLocation {
             file_id: FileId {
-                id: 54,
+                id: 53,
             },
             offset: 348,
             length: 12,
@@ -42,7 +42,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 54,
+                        id: 53,
                     },
                     offset: 348,
                     length: 12,
@@ -57,11 +57,11 @@
     },
     ApolloDiagnostic {
         cache: {
-            54: "0054_argument_not_provided.graphql",
+            53: "0054_argument_not_provided.graphql",
         },
         location: DiagnosticLocation {
             file_id: FileId {
-                id: 54,
+                id: 53,
             },
             offset: 339,
             length: 22,
@@ -70,7 +70,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 54,
+                        id: 53,
                     },
                     offset: 339,
                     length: 22,
@@ -85,11 +85,11 @@
     },
     ApolloDiagnostic {
         cache: {
-            54: "0054_argument_not_provided.graphql",
+            53: "0054_argument_not_provided.graphql",
         },
         location: DiagnosticLocation {
             file_id: FileId {
-                id: 54,
+                id: 53,
             },
             offset: 399,
             length: 21,
@@ -98,7 +98,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 54,
+                        id: 53,
                     },
                     offset: 399,
                     length: 21,
@@ -108,7 +108,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 54,
+                        id: 53,
                     },
                     offset: 38,
                     length: 10,
@@ -123,11 +123,11 @@
     },
     ApolloDiagnostic {
         cache: {
-            54: "0054_argument_not_provided.graphql",
+            53: "0054_argument_not_provided.graphql",
         },
         location: DiagnosticLocation {
             file_id: FileId {
-                id: 54,
+                id: 53,
             },
             offset: 425,
             length: 26,
@@ -136,7 +136,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 54,
+                        id: 53,
                     },
                     offset: 425,
                     length: 26,
@@ -146,7 +146,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 54,
+                        id: 53,
                     },
                     offset: 102,
                     length: 10,
@@ -161,11 +161,11 @@
     },
     ApolloDiagnostic {
         cache: {
-            54: "0054_argument_not_provided.graphql",
+            53: "0054_argument_not_provided.graphql",
         },
         location: DiagnosticLocation {
             file_id: FileId {
-                id: 54,
+                id: 53,
             },
             offset: 456,
             length: 44,
@@ -174,7 +174,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 54,
+                        id: 53,
                     },
                     offset: 456,
                     length: 44,
@@ -184,7 +184,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 54,
+                        id: 53,
                     },
                     offset: 102,
                     length: 10,
@@ -199,11 +199,11 @@
     },
     ApolloDiagnostic {
         cache: {
-            54: "0054_argument_not_provided.graphql",
+            53: "0054_argument_not_provided.graphql",
         },
         location: DiagnosticLocation {
             file_id: FileId {
-                id: 54,
+                id: 53,
             },
             offset: 281,
             length: 12,
@@ -212,7 +212,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 54,
+                        id: 53,
                     },
                     offset: 281,
                     length: 12,
@@ -222,7 +222,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 54,
+                        id: 53,
                     },
                     offset: 38,
                     length: 10,
@@ -237,11 +237,11 @@
     },
     ApolloDiagnostic {
         cache: {
-            54: "0054_argument_not_provided.graphql",
+            53: "0054_argument_not_provided.graphql",
         },
         location: DiagnosticLocation {
             file_id: FileId {
-                id: 54,
+                id: 53,
             },
             offset: 281,
             length: 12,
@@ -250,7 +250,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 54,
+                        id: 53,
                     },
                     offset: 281,
                     length: 12,
@@ -260,7 +260,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 54,
+                        id: 53,
                     },
                     offset: 50,
                     length: 10,
@@ -275,11 +275,11 @@
     },
     ApolloDiagnostic {
         cache: {
-            54: "0054_argument_not_provided.graphql",
+            53: "0054_argument_not_provided.graphql",
         },
         location: DiagnosticLocation {
             file_id: FileId {
-                id: 54,
+                id: 53,
             },
             offset: 298,
             length: 21,
@@ -288,7 +288,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 54,
+                        id: 53,
                     },
                     offset: 298,
                     length: 21,
@@ -298,7 +298,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 54,
+                        id: 53,
                     },
                     offset: 38,
                     length: 10,
diff --git a/crates/apollo-compiler/test_data/diagnostics/0055_duplicate_variable_definitions.txt b/crates/apollo-compiler/test_data/diagnostics/0055_duplicate_variable_definitions.txt
index dfec175..456fc22 100644
--- a/crates/apollo-compiler/test_data/diagnostics/0055_duplicate_variable_definitions.txt
+++ b/crates/apollo-compiler/test_data/diagnostics/0055_duplicate_variable_definitions.txt
@@ -1,11 +1,11 @@
 [
     ApolloDiagnostic {
         cache: {
-            55: "0055_duplicate_variable_definitions.graphql",
+            54: "0055_duplicate_variable_definitions.graphql",
         },
         location: DiagnosticLocation {
             file_id: FileId {
-                id: 55,
+                id: 54,
             },
             offset: 48,
             length: 22,
@@ -14,7 +14,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 55,
+                        id: 54,
                     },
                     offset: 24,
                     length: 22,
@@ -24,7 +24,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 55,
+                        id: 54,
                     },
                     offset: 48,
                     length: 22,
@@ -40,14 +40,14 @@
             name: "atOtherHomes",
             original_definition: DiagnosticLocation {
                 file_id: FileId {
-                    id: 55,
+                    id: 54,
                 },
                 offset: 24,
                 length: 22,
             },
             redefined_definition: DiagnosticLocation {
                 file_id: FileId {
-                    id: 55,
+                    id: 54,
                 },
                 offset: 48,
                 length: 22,
diff --git a/crates/apollo-compiler/test_data/diagnostics/0056_variables_are_input_types.txt b/crates/apollo-compiler/test_data/diagnostics/0056_variables_are_input_types.txt
index 356c595..a4628c9 100644
--- a/crates/apollo-compiler/test_data/diagnostics/0056_variables_are_input_types.txt
+++ b/crates/apollo-compiler/test_data/diagnostics/0056_variables_are_input_types.txt
@@ -1,11 +1,11 @@
 [
     ApolloDiagnostic {
         cache: {
-            56: "0056_variables_are_input_types.graphql",
+            55: "0056_variables_are_input_types.graphql",
         },
         location: DiagnosticLocation {
             file_id: FileId {
-                id: 56,
+                id: 55,
             },
             offset: 15,
             length: 9,
@@ -14,7 +14,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 56,
+                        id: 55,
                     },
                     offset: 21,
                     length: 3,
@@ -32,11 +32,11 @@
     },
     ApolloDiagnostic {
         cache: {
-            56: "0056_variables_are_input_types.graphql",
+            55: "0056_variables_are_input_types.graphql",
         },
         location: DiagnosticLocation {
             file_id: FileId {
-                id: 56,
+                id: 55,
             },
             offset: 101,
             length: 10,
@@ -45,7 +45,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 56,
+                        id: 55,
                     },
                     offset: 107,
                     length: 3,
@@ -63,11 +63,11 @@
     },
     ApolloDiagnostic {
         cache: {
-            56: "0056_variables_are_input_types.graphql",
+            55: "0056_variables_are_input_types.graphql",
         },
         location: DiagnosticLocation {
             file_id: FileId {
-                id: 56,
+                id: 55,
             },
             offset: 190,
             length: 12,
@@ -76,7 +76,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 56,
+                        id: 55,
                     },
                     offset: 197,
                     length: 5,
@@ -94,11 +94,11 @@
     },
     ApolloDiagnostic {
         cache: {
-            56: "0056_variables_are_input_types.graphql",
+            55: "0056_variables_are_input_types.graphql",
         },
         location: DiagnosticLocation {
             file_id: FileId {
-                id: 56,
+                id: 55,
             },
             offset: 266,
             length: 19,
@@ -107,7 +107,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 56,
+                        id: 55,
                     },
                     offset: 277,
                     length: 8,
@@ -125,11 +125,11 @@
     },
     ApolloDiagnostic {
         cache: {
-            56: "0056_variables_are_input_types.graphql",
+            55: "0056_variables_are_input_types.graphql",
         },
         location: DiagnosticLocation {
             file_id: FileId {
-                id: 56,
+                id: 55,
             },
             offset: 369,
             length: 17,
@@ -138,7 +138,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 56,
+                        id: 55,
                     },
                     offset: 369,
                     length: 17,
diff --git a/crates/apollo-compiler/test_data/diagnostics/0057_duplicate_type_names.txt b/crates/apollo-compiler/test_data/diagnostics/0057_duplicate_type_names.txt
index ddd3e5b..d6a411c 100644
--- a/crates/apollo-compiler/test_data/diagnostics/0057_duplicate_type_names.txt
+++ b/crates/apollo-compiler/test_data/diagnostics/0057_duplicate_type_names.txt
@@ -1,11 +1,11 @@
 [
     ApolloDiagnostic {
         cache: {
-            57: "0057_duplicate_type_names.graphql",
+            56: "0057_duplicate_type_names.graphql",
         },
         location: DiagnosticLocation {
             file_id: FileId {
-                id: 57,
+                id: 56,
             },
             offset: 34,
             length: 5,
@@ -14,7 +14,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 57,
+                        id: 56,
                     },
                     offset: 10,
                     length: 5,
@@ -24,7 +24,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 57,
+                        id: 56,
                     },
                     offset: 34,
                     length: 5,
@@ -40,14 +40,14 @@
             name: "World",
             original_definition: DiagnosticLocation {
                 file_id: FileId {
-                    id: 57,
+                    id: 56,
                 },
                 offset: 10,
                 length: 5,
             },
             redefined_definition: DiagnosticLocation {
                 file_id: FileId {
-                    id: 57,
+                    id: 56,
                 },
                 offset: 34,
                 length: 5,
@@ -56,11 +56,11 @@
     },
     ApolloDiagnostic {
         cache: {
-            57: "0057_duplicate_type_names.graphql",
+            56: "0057_duplicate_type_names.graphql",
         },
         location: DiagnosticLocation {
             file_id: FileId {
-                id: 57,
+                id: 56,
             },
             offset: 147,
             length: 1,
@@ -69,7 +69,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 57,
+                        id: 56,
                     },
                     offset: 83,
                     length: 1,
@@ -79,7 +79,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 57,
+                        id: 56,
                     },
                     offset: 147,
                     length: 1,
@@ -95,14 +95,14 @@
             name: "X",
             original_definition: DiagnosticLocation {
                 file_id: FileId {
-                    id: 57,
+                    id: 56,
                 },
                 offset: 83,
                 length: 1,
             },
             redefined_definition: DiagnosticLocation {
                 file_id: FileId {
-                    id: 57,
+                    id: 56,
                 },
                 offset: 147,
                 length: 1,
@@ -111,11 +111,11 @@
     },
     ApolloDiagnostic {
         cache: {
-            57: "0057_duplicate_type_names.graphql",
+            56: "0057_duplicate_type_names.graphql",
         },
         location: DiagnosticLocation {
             file_id: FileId {
-                id: 57,
+                id: 56,
             },
             offset: 174,
             length: 1,
@@ -124,7 +124,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 57,
+                        id: 56,
                     },
                     offset: 83,
                     length: 1,
@@ -134,7 +134,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 57,
+                        id: 56,
                     },
                     offset: 174,
                     length: 1,
@@ -150,14 +150,14 @@
             name: "X",
             original_definition: DiagnosticLocation {
                 file_id: FileId {
-                    id: 57,
+                    id: 56,
                 },
                 offset: 83,
                 length: 1,
             },
             redefined_definition: DiagnosticLocation {
                 file_id: FileId {
-                    id: 57,
+                    id: 56,
                 },
                 offset: 174,
                 length: 1,
@@ -166,11 +166,11 @@
     },
     ApolloDiagnostic {
         cache: {
-            57: "0057_duplicate_type_names.graphql",
+            56: "0057_duplicate_type_names.graphql",
         },
         location: DiagnosticLocation {
             file_id: FileId {
-                id: 57,
+                id: 56,
             },
             offset: 191,
             length: 1,
@@ -179,7 +179,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 57,
+                        id: 56,
                     },
                     offset: 83,
                     length: 1,
@@ -189,7 +189,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 57,
+                        id: 56,
                     },
                     offset: 191,
                     length: 1,
@@ -205,14 +205,14 @@
             name: "X",
             original_definition: DiagnosticLocation {
                 file_id: FileId {
-                    id: 57,
+                    id: 56,
                 },
                 offset: 83,
                 length: 1,
             },
             redefined_definition: DiagnosticLocation {
                 file_id: FileId {
-                    id: 57,
+                    id: 56,
                 },
                 offset: 191,
                 length: 1,
diff --git a/crates/apollo-compiler/test_data/diagnostics/0058_fragment_definitions_with_duplicate_names.txt b/crates/apollo-compiler/test_data/diagnostics/0058_fragment_definitions_with_duplicate_names.txt
index 1b9d0bf..bd487f3 100644
--- a/crates/apollo-compiler/test_data/diagnostics/0058_fragment_definitions_with_duplicate_names.txt
+++ b/crates/apollo-compiler/test_data/diagnostics/0058_fragment_definitions_with_duplicate_names.txt
@@ -1,11 +1,11 @@
 [
     ApolloDiagnostic {
         cache: {
-            58: "0058_fragment_definitions_with_duplicate_names.graphql",
+            57: "0058_fragment_definitions_with_duplicate_names.graphql",
         },
         location: DiagnosticLocation {
             file_id: FileId {
-                id: 58,
+                id: 57,
             },
             offset: 244,
             length: 11,
@@ -14,7 +14,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 58,
+                        id: 57,
                     },
                     offset: 196,
                     length: 11,
@@ -24,7 +24,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 58,
+                        id: 57,
                     },
                     offset: 244,
                     length: 11,
@@ -40,14 +40,14 @@
             name: "petFragment",
             original_definition: DiagnosticLocation {
                 file_id: FileId {
-                    id: 58,
+                    id: 57,
                 },
                 offset: 196,
                 length: 11,
             },
             redefined_definition: DiagnosticLocation {
                 file_id: FileId {
-                    id: 58,
+                    id: 57,
                 },
                 offset: 244,
                 length: 11,
diff --git a/crates/apollo-compiler/test_data/diagnostics/0059_root_operation_object_type.txt b/crates/apollo-compiler/test_data/diagnostics/0059_root_operation_object_type.txt
index 8d5c287..1c15cce 100644
--- a/crates/apollo-compiler/test_data/diagnostics/0059_root_operation_object_type.txt
+++ b/crates/apollo-compiler/test_data/diagnostics/0059_root_operation_object_type.txt
@@ -1,11 +1,11 @@
 [
     ApolloDiagnostic {
         cache: {
-            59: "0059_root_operation_object_type.graphql",
+            58: "0059_root_operation_object_type.graphql",
         },
         location: DiagnosticLocation {
             file_id: FileId {
-                id: 59,
+                id: 58,
             },
             offset: 0,
             length: 36,
@@ -14,7 +14,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 59,
+                        id: 58,
                     },
                     offset: 0,
                     length: 36,
@@ -27,11 +27,11 @@
     },
     ApolloDiagnostic {
         cache: {
-            59: "0059_root_operation_object_type.graphql",
+            58: "0059_root_operation_object_type.graphql",
         },
         location: DiagnosticLocation {
             file_id: FileId {
-                id: 59,
+                id: 58,
             },
             offset: 13,
             length: 20,
@@ -40,7 +40,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 59,
+                        id: 58,
                     },
                     offset: 13,
                     length: 20,
diff --git a/crates/apollo-compiler/test_data/diagnostics/0060_root_operation_definition_undefined_operation_type.txt b/crates/apollo-compiler/test_data/diagnostics/0060_root_operation_definition_undefined_operation_type.txt
index 2b898d8..c258582 100644
--- a/crates/apollo-compiler/test_data/diagnostics/0060_root_operation_definition_undefined_operation_type.txt
+++ b/crates/apollo-compiler/test_data/diagnostics/0060_root_operation_definition_undefined_operation_type.txt
@@ -1,11 +1,11 @@
 [
     ApolloDiagnostic {
         cache: {
-            60: "0060_root_operation_definition_undefined_operation_type.graphql",
+            59: "0060_root_operation_definition_undefined_operation_type.graphql",
         },
         location: DiagnosticLocation {
             file_id: FileId {
-                id: 60,
+                id: 59,
             },
             offset: 0,
             length: 31,
@@ -14,7 +14,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 60,
+                        id: 59,
                     },
                     offset: 0,
                     length: 31,
@@ -27,11 +27,11 @@
     },
     ApolloDiagnostic {
         cache: {
-            60: "0060_root_operation_definition_undefined_operation_type.graphql",
+            59: "0060_root_operation_definition_undefined_operation_type.graphql",
         },
         location: DiagnosticLocation {
             file_id: FileId {
-                id: 60,
+                id: 59,
             },
             offset: 13,
             length: 16,
@@ -40,7 +40,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 60,
+                        id: 59,
                     },
                     offset: 13,
                     length: 16,
diff --git a/crates/apollo-compiler/test_data/diagnostics/0061_root_operation_with_default_undefined_query.txt b/crates/apollo-compiler/test_data/diagnostics/0061_root_operation_with_default_undefined_query.txt
index 8240619..43ff2ab 100644
--- a/crates/apollo-compiler/test_data/diagnostics/0061_root_operation_with_default_undefined_query.txt
+++ b/crates/apollo-compiler/test_data/diagnostics/0061_root_operation_with_default_undefined_query.txt
@@ -1,11 +1,11 @@
 [
     ApolloDiagnostic {
         cache: {
-            61: "0061_root_operation_with_default_undefined_query.graphql",
+            60: "0061_root_operation_with_default_undefined_query.graphql",
         },
         location: DiagnosticLocation {
             file_id: FileId {
-                id: 61,
+                id: 60,
             },
             offset: 0,
             length: 27,
@@ -14,7 +14,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 61,
+                        id: 60,
                     },
                     offset: 0,
                     length: 27,
@@ -27,11 +27,11 @@
     },
     ApolloDiagnostic {
         cache: {
-            61: "0061_root_operation_with_default_undefined_query.graphql",
+            60: "0061_root_operation_with_default_undefined_query.graphql",
         },
         location: DiagnosticLocation {
             file_id: FileId {
-                id: 61,
+                id: 60,
             },
             offset: 13,
             length: 12,
@@ -40,7 +40,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 61,
+                        id: 60,
                     },
                     offset: 13,
                     length: 12,
diff --git a/crates/apollo-compiler/test_data/diagnostics/0062_root_operation_with_list.txt b/crates/apollo-compiler/test_data/diagnostics/0062_root_operation_with_list.txt
index 4abab10..b6af6bf 100644
--- a/crates/apollo-compiler/test_data/diagnostics/0062_root_operation_with_list.txt
+++ b/crates/apollo-compiler/test_data/diagnostics/0062_root_operation_with_list.txt
@@ -1,11 +1,11 @@
 [
     ApolloDiagnostic {
         cache: {
-            62: "0062_root_operation_with_list.graphql",
+            61: "0062_root_operation_with_list.graphql",
         },
         location: DiagnosticLocation {
             file_id: FileId {
-                id: 62,
+                id: 61,
             },
             offset: 18,
             length: 1,
@@ -14,7 +14,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 62,
+                        id: 61,
                     },
                     offset: 18,
                     length: 1,
@@ -29,11 +29,11 @@
     },
     ApolloDiagnostic {
         cache: {
-            62: "0062_root_operation_with_list.graphql",
+            61: "0062_root_operation_with_list.graphql",
         },
         location: DiagnosticLocation {
             file_id: FileId {
-                id: 62,
+                id: 61,
             },
             offset: 18,
             length: 1,
@@ -42,7 +42,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 62,
+                        id: 61,
                     },
                     offset: 18,
                     length: 1,
@@ -57,11 +57,11 @@
     },
     ApolloDiagnostic {
         cache: {
-            62: "0062_root_operation_with_list.graphql",
+            61: "0062_root_operation_with_list.graphql",
         },
         location: DiagnosticLocation {
             file_id: FileId {
-                id: 62,
+                id: 61,
             },
             offset: 19,
             length: 6,
@@ -70,7 +70,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 62,
+                        id: 61,
                     },
                     offset: 19,
                     length: 6,
@@ -85,11 +85,11 @@
     },
     ApolloDiagnostic {
         cache: {
-            62: "0062_root_operation_with_list.graphql",
+            61: "0062_root_operation_with_list.graphql",
         },
         location: DiagnosticLocation {
             file_id: FileId {
-                id: 62,
+                id: 61,
             },
             offset: 25,
             length: 1,
@@ -98,7 +98,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 62,
+                        id: 61,
                     },
                     offset: 25,
                     length: 1,
@@ -113,11 +113,11 @@
     },
     ApolloDiagnostic {
         cache: {
-            62: "0062_root_operation_with_list.graphql",
+            61: "0062_root_operation_with_list.graphql",
         },
         location: DiagnosticLocation {
             file_id: FileId {
-                id: 62,
+                id: 61,
             },
             offset: 27,
             length: 1,
@@ -126,7 +126,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 62,
+                        id: 61,
                     },
                     offset: 27,
                     length: 1,
@@ -141,11 +141,11 @@
     },
     ApolloDiagnostic {
         cache: {
-            62: "0062_root_operation_with_list.graphql",
+            61: "0062_root_operation_with_list.graphql",
         },
         location: DiagnosticLocation {
             file_id: FileId {
-                id: 62,
+                id: 61,
             },
             offset: 0,
             length: 17,
@@ -154,7 +154,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 62,
+                        id: 61,
                     },
                     offset: 0,
                     length: 17,
diff --git a/crates/apollo-compiler/test_data/diagnostics/0063_extension_orphan.txt b/crates/apollo-compiler/test_data/diagnostics/0063_extension_orphan.txt
index a7bf950..6043d3d 100644
--- a/crates/apollo-compiler/test_data/diagnostics/0063_extension_orphan.txt
+++ b/crates/apollo-compiler/test_data/diagnostics/0063_extension_orphan.txt
@@ -1,11 +1,11 @@
 [
     ApolloDiagnostic {
         cache: {
-            63: "0063_extension_orphan.graphql",
+            62: "0063_extension_orphan.graphql",
         },
         location: DiagnosticLocation {
             file_id: FileId {
-                id: 63,
+                id: 62,
             },
             offset: 25,
             length: 52,
@@ -14,7 +14,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 63,
+                        id: 62,
                     },
                     offset: 39,
                     length: 1,
@@ -29,11 +29,11 @@
     },
     ApolloDiagnostic {
         cache: {
-            63: "0063_extension_orphan.graphql",
+            62: "0063_extension_orphan.graphql",
         },
         location: DiagnosticLocation {
             file_id: FileId {
-                id: 63,
+                id: 62,
             },
             offset: 78,
             length: 29,
@@ -42,7 +42,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 63,
+                        id: 62,
                     },
                     offset: 90,
                     length: 1,
@@ -57,11 +57,11 @@
     },
     ApolloDiagnostic {
         cache: {
-            63: "0063_extension_orphan.graphql",
+            62: "0063_extension_orphan.graphql",
         },
         location: DiagnosticLocation {
             file_id: FileId {
-                id: 63,
+                id: 62,
             },
             offset: 141,
             length: 23,
@@ -70,7 +70,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 63,
+                        id: 62,
                     },
                     offset: 154,
                     length: 1,
@@ -85,11 +85,11 @@
     },
     ApolloDiagnostic {
         cache: {
-            63: "0063_extension_orphan.graphql",
+            62: "0063_extension_orphan.graphql",
         },
         location: DiagnosticLocation {
             file_id: FileId {
-                id: 63,
+                id: 62,
             },
             offset: 165,
             length: 35,
@@ -98,7 +98,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 63,
+                        id: 62,
                     },
                     offset: 182,
                     length: 1,
@@ -113,11 +113,11 @@
     },
     ApolloDiagnostic {
         cache: {
-            63: "0063_extension_orphan.graphql",
+            62: "0063_extension_orphan.graphql",
         },
         location: DiagnosticLocation {
             file_id: FileId {
-                id: 63,
+                id: 62,
             },
             offset: 201,
             length: 31,
@@ -126,7 +126,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 63,
+                        id: 62,
                     },
                     offset: 214,
                     length: 1,
@@ -141,11 +141,11 @@
     },
     ApolloDiagnostic {
         cache: {
-            63: "0063_extension_orphan.graphql",
+            62: "0063_extension_orphan.graphql",
         },
         location: DiagnosticLocation {
             file_id: FileId {
-                id: 63,
+                id: 62,
             },
             offset: 233,
             length: 26,
@@ -154,7 +154,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 63,
+                        id: 62,
                     },
                     offset: 245,
                     length: 1,
diff --git a/crates/apollo-compiler/test_data/diagnostics/0064_extension_wrong_type.txt b/crates/apollo-compiler/test_data/diagnostics/0064_extension_wrong_type.txt
index 4fbf90d..67a4e94 100644
--- a/crates/apollo-compiler/test_data/diagnostics/0064_extension_wrong_type.txt
+++ b/crates/apollo-compiler/test_data/diagnostics/0064_extension_wrong_type.txt
@@ -1,11 +1,11 @@
 [
     ApolloDiagnostic {
         cache: {
-            64: "0064_extension_wrong_type.graphql",
+            63: "0064_extension_wrong_type.graphql",
         },
         location: DiagnosticLocation {
             file_id: FileId {
-                id: 64,
+                id: 63,
             },
             offset: 138,
             length: 6,
@@ -14,7 +14,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 64,
+                        id: 63,
                     },
                     offset: 138,
                     length: 6,
@@ -32,11 +32,11 @@
     },
     ApolloDiagnostic {
         cache: {
-            64: "0064_extension_wrong_type.graphql",
+            63: "0064_extension_wrong_type.graphql",
         },
         location: DiagnosticLocation {
             file_id: FileId {
-                id: 64,
+                id: 63,
             },
             offset: 208,
             length: 28,
@@ -45,7 +45,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 64,
+                        id: 63,
                     },
                     offset: 208,
                     length: 28,
@@ -55,7 +55,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 64,
+                        id: 63,
                     },
                     offset: 0,
                     length: 60,
@@ -69,7 +69,7 @@
             definition: Some(
                 DiagnosticLocation {
                     file_id: FileId {
-                        id: 64,
+                        id: 63,
                     },
                     offset: 0,
                     length: 60,
@@ -77,7 +77,7 @@
             ),
             extension: DiagnosticLocation {
                 file_id: FileId {
-                    id: 64,
+                    id: 63,
                 },
                 offset: 208,
                 length: 28,
@@ -86,11 +86,11 @@
     },
     ApolloDiagnostic {
         cache: {
-            64: "0064_extension_wrong_type.graphql",
+            63: "0064_extension_wrong_type.graphql",
         },
         location: DiagnosticLocation {
             file_id: FileId {
-                id: 64,
+                id: 63,
             },
             offset: 237,
             length: 45,
@@ -99,7 +99,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 64,
+                        id: 63,
                     },
                     offset: 237,
                     length: 45,
@@ -109,7 +109,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 64,
+                        id: 63,
                     },
                     offset: 94,
                     length: 29,
@@ -123,7 +123,7 @@
             definition: Some(
                 DiagnosticLocation {
                     file_id: FileId {
-                        id: 64,
+                        id: 63,
                     },
                     offset: 94,
                     length: 29,
@@ -131,7 +131,7 @@
             ),
             extension: DiagnosticLocation {
                 file_id: FileId {
-                    id: 64,
+                    id: 63,
                 },
                 offset: 237,
                 length: 45,
@@ -140,11 +140,11 @@
     },
     ApolloDiagnostic {
         cache: {
-            64: "0064_extension_wrong_type.graphql",
+            63: "0064_extension_wrong_type.graphql",
         },
         location: DiagnosticLocation {
             file_id: FileId {
-                id: 64,
+                id: 63,
             },
             offset: 283,
             length: 31,
@@ -153,7 +153,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 64,
+                        id: 63,
                     },
                     offset: 283,
                     length: 31,
@@ -163,7 +163,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 64,
+                        id: 63,
                     },
                     offset: 61,
                     length: 32,
@@ -177,7 +177,7 @@
             definition: Some(
                 DiagnosticLocation {
                     file_id: FileId {
-                        id: 64,
+                        id: 63,
                     },
                     offset: 61,
                     length: 32,
@@ -185,7 +185,7 @@
             ),
             extension: DiagnosticLocation {
                 file_id: FileId {
-                    id: 64,
+                    id: 63,
                 },
                 offset: 283,
                 length: 31,
@@ -194,11 +194,11 @@
     },
     ApolloDiagnostic {
         cache: {
-            64: "0064_extension_wrong_type.graphql",
+            63: "0064_extension_wrong_type.graphql",
         },
         location: DiagnosticLocation {
             file_id: FileId {
-                id: 64,
+                id: 63,
             },
             offset: 315,
             length: 39,
@@ -207,7 +207,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 64,
+                        id: 63,
                     },
                     offset: 315,
                     length: 39,
@@ -217,7 +217,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 64,
+                        id: 63,
                     },
                     offset: 154,
                     length: 29,
@@ -231,7 +231,7 @@
             definition: Some(
                 DiagnosticLocation {
                     file_id: FileId {
-                        id: 64,
+                        id: 63,
                     },
                     offset: 154,
                     length: 29,
@@ -239,7 +239,7 @@
             ),
             extension: DiagnosticLocation {
                 file_id: FileId {
-                    id: 64,
+                    id: 63,
                 },
                 offset: 315,
                 length: 39,
@@ -248,11 +248,11 @@
     },
     ApolloDiagnostic {
         cache: {
-            64: "0064_extension_wrong_type.graphql",
+            63: "0064_extension_wrong_type.graphql",
         },
         location: DiagnosticLocation {
             file_id: FileId {
-                id: 64,
+                id: 63,
             },
             offset: 355,
             length: 39,
@@ -261,7 +261,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 64,
+                        id: 63,
                     },
                     offset: 355,
                     length: 39,
@@ -271,7 +271,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 64,
+                        id: 63,
                     },
                     offset: 184,
                     length: 22,
@@ -285,7 +285,7 @@
             definition: Some(
                 DiagnosticLocation {
                     file_id: FileId {
-                        id: 64,
+                        id: 63,
                     },
                     offset: 184,
                     length: 22,
@@ -293,7 +293,7 @@
             ),
             extension: DiagnosticLocation {
                 file_id: FileId {
-                    id: 64,
+                    id: 63,
                 },
                 offset: 355,
                 length: 39,
diff --git a/crates/apollo-compiler/test_data/diagnostics/0065_subselection_of_enum.txt b/crates/apollo-compiler/test_data/diagnostics/0065_subselection_of_enum.txt
index ef830ab..35c4e21 100644
--- a/crates/apollo-compiler/test_data/diagnostics/0065_subselection_of_enum.txt
+++ b/crates/apollo-compiler/test_data/diagnostics/0065_subselection_of_enum.txt
@@ -1,11 +1,11 @@
 [
     ApolloDiagnostic {
         cache: {
-            65: "0065_subselection_of_enum.graphql",
+            64: "0065_subselection_of_enum.graphql",
         },
         location: DiagnosticLocation {
             file_id: FileId {
-                id: 65,
+                id: 64,
             },
             offset: 26,
             length: 13,
@@ -14,7 +14,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 65,
+                        id: 64,
                     },
                     offset: 26,
                     length: 13,
@@ -24,7 +24,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 65,
+                        id: 64,
                     },
                     offset: 230,
                     length: 36,
@@ -37,11 +37,11 @@
     },
     ApolloDiagnostic {
         cache: {
-            65: "0065_subselection_of_enum.graphql",
+            64: "0065_subselection_of_enum.graphql",
         },
         location: DiagnosticLocation {
             file_id: FileId {
-                id: 65,
+                id: 64,
             },
             offset: 42,
             length: 13,
@@ -50,7 +50,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 65,
+                        id: 64,
                     },
                     offset: 42,
                     length: 13,
@@ -60,7 +60,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 65,
+                        id: 64,
                     },
                     offset: 230,
                     length: 36,
@@ -73,11 +73,11 @@
     },
     ApolloDiagnostic {
         cache: {
-            65: "0065_subselection_of_enum.graphql",
+            64: "0065_subselection_of_enum.graphql",
         },
         location: DiagnosticLocation {
             file_id: FileId {
-                id: 65,
+                id: 64,
             },
             offset: 58,
             length: 13,
@@ -86,7 +86,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 65,
+                        id: 64,
                     },
                     offset: 58,
                     length: 13,
@@ -96,7 +96,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 65,
+                        id: 64,
                     },
                     offset: 230,
                     length: 36,
@@ -109,11 +109,11 @@
     },
     ApolloDiagnostic {
         cache: {
-            65: "0065_subselection_of_enum.graphql",
+            64: "0065_subselection_of_enum.graphql",
         },
         location: DiagnosticLocation {
             file_id: FileId {
-                id: 65,
+                id: 64,
             },
             offset: 74,
             length: 13,
@@ -122,7 +122,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 65,
+                        id: 64,
                     },
                     offset: 74,
                     length: 13,
@@ -132,7 +132,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 65,
+                        id: 64,
                     },
                     offset: 230,
                     length: 36,
@@ -145,11 +145,11 @@
     },
     ApolloDiagnostic {
         cache: {
-            65: "0065_subselection_of_enum.graphql",
+            64: "0065_subselection_of_enum.graphql",
         },
         location: DiagnosticLocation {
             file_id: FileId {
-                id: 65,
+                id: 64,
             },
             offset: 90,
             length: 13,
@@ -158,7 +158,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 65,
+                        id: 64,
                     },
                     offset: 90,
                     length: 13,
@@ -168,7 +168,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 65,
+                        id: 64,
                     },
                     offset: 230,
                     length: 36,
@@ -181,11 +181,11 @@
     },
     ApolloDiagnostic {
         cache: {
-            65: "0065_subselection_of_enum.graphql",
+            64: "0065_subselection_of_enum.graphql",
         },
         location: DiagnosticLocation {
             file_id: FileId {
-                id: 65,
+                id: 64,
             },
             offset: 106,
             length: 13,
@@ -194,7 +194,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 65,
+                        id: 64,
                     },
                     offset: 106,
                     length: 13,
@@ -204,7 +204,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 65,
+                        id: 64,
                     },
                     offset: 230,
                     length: 36,
diff --git a/crates/apollo-compiler/test_data/diagnostics/0066_subselection_of_scalar.txt b/crates/apollo-compiler/test_data/diagnostics/0066_subselection_of_scalar.txt
index 2c3e082..9f33898 100644
--- a/crates/apollo-compiler/test_data/diagnostics/0066_subselection_of_scalar.txt
+++ b/crates/apollo-compiler/test_data/diagnostics/0066_subselection_of_scalar.txt
@@ -1,11 +1,11 @@
 [
     ApolloDiagnostic {
         cache: {
-            66: "0066_subselection_of_scalar.graphql",
+            65: "0066_subselection_of_scalar.graphql",
         },
         location: DiagnosticLocation {
             file_id: FileId {
-                id: 66,
+                id: 65,
             },
             offset: 28,
             length: 13,
@@ -14,7 +14,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 66,
+                        id: 65,
                     },
                     offset: 28,
                     length: 13,
@@ -24,7 +24,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 66,
+                        id: 65,
                     },
                     offset: 232,
                     length: 67,
@@ -37,11 +37,11 @@
     },
     ApolloDiagnostic {
         cache: {
-            66: "0066_subselection_of_scalar.graphql",
+            65: "0066_subselection_of_scalar.graphql",
         },
         location: DiagnosticLocation {
             file_id: FileId {
-                id: 66,
+                id: 65,
             },
             offset: 44,
             length: 13,
@@ -50,7 +50,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 66,
+                        id: 65,
                     },
                     offset: 44,
                     length: 13,
@@ -60,7 +60,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 66,
+                        id: 65,
                     },
                     offset: 232,
                     length: 67,
@@ -73,11 +73,11 @@
     },
     ApolloDiagnostic {
         cache: {
-            66: "0066_subselection_of_scalar.graphql",
+            65: "0066_subselection_of_scalar.graphql",
         },
         location: DiagnosticLocation {
             file_id: FileId {
-                id: 66,
+                id: 65,
             },
             offset: 60,
             length: 13,
@@ -86,7 +86,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 66,
+                        id: 65,
                     },
                     offset: 60,
                     length: 13,
@@ -96,7 +96,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 66,
+                        id: 65,
                     },
                     offset: 232,
                     length: 67,
@@ -109,11 +109,11 @@
     },
     ApolloDiagnostic {
         cache: {
-            66: "0066_subselection_of_scalar.graphql",
+            65: "0066_subselection_of_scalar.graphql",
         },
         location: DiagnosticLocation {
             file_id: FileId {
-                id: 66,
+                id: 65,
             },
             offset: 76,
             length: 13,
@@ -122,7 +122,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 66,
+                        id: 65,
                     },
                     offset: 76,
                     length: 13,
@@ -132,7 +132,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 66,
+                        id: 65,
                     },
                     offset: 232,
                     length: 67,
@@ -145,11 +145,11 @@
     },
     ApolloDiagnostic {
         cache: {
-            66: "0066_subselection_of_scalar.graphql",
+            65: "0066_subselection_of_scalar.graphql",
         },
         location: DiagnosticLocation {
             file_id: FileId {
-                id: 66,
+                id: 65,
             },
             offset: 92,
             length: 13,
@@ -158,7 +158,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 66,
+                        id: 65,
                     },
                     offset: 92,
                     length: 13,
@@ -168,7 +168,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 66,
+                        id: 65,
                     },
                     offset: 232,
                     length: 67,
@@ -181,11 +181,11 @@
     },
     ApolloDiagnostic {
         cache: {
-            66: "0066_subselection_of_scalar.graphql",
+            65: "0066_subselection_of_scalar.graphql",
         },
         location: DiagnosticLocation {
             file_id: FileId {
-                id: 66,
+                id: 65,
             },
             offset: 108,
             length: 13,
@@ -194,7 +194,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 66,
+                        id: 65,
                     },
                     offset: 108,
                     length: 13,
@@ -204,7 +204,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 66,
+                        id: 65,
                     },
                     offset: 232,
                     length: 67,
diff --git a/crates/apollo-compiler/test_data/diagnostics/0067_subselection_of_interface.txt b/crates/apollo-compiler/test_data/diagnostics/0067_subselection_of_interface.txt
index d7cecdd..9616f8d 100644
--- a/crates/apollo-compiler/test_data/diagnostics/0067_subselection_of_interface.txt
+++ b/crates/apollo-compiler/test_data/diagnostics/0067_subselection_of_interface.txt
@@ -1,11 +1,11 @@
 [
     ApolloDiagnostic {
         cache: {
-            67: "0067_subselection_of_interface.graphql",
+            66: "0067_subselection_of_interface.graphql",
         },
         location: DiagnosticLocation {
             file_id: FileId {
-                id: 67,
+                id: 66,
             },
             offset: 31,
             length: 4,
@@ -14,7 +14,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 67,
+                        id: 66,
                     },
                     offset: 31,
                     length: 4,
@@ -24,7 +24,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 67,
+                        id: 66,
                     },
                     offset: 181,
                     length: 31,
@@ -37,11 +37,11 @@
     },
     ApolloDiagnostic {
         cache: {
-            67: "0067_subselection_of_interface.graphql",
+            66: "0067_subselection_of_interface.graphql",
         },
         location: DiagnosticLocation {
             file_id: FileId {
-                id: 67,
+                id: 66,
             },
             offset: 38,
             length: 4,
@@ -50,7 +50,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 67,
+                        id: 66,
                     },
                     offset: 38,
                     length: 4,
@@ -60,7 +60,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 67,
+                        id: 66,
                     },
                     offset: 181,
                     length: 31,
@@ -73,11 +73,11 @@
     },
     ApolloDiagnostic {
         cache: {
-            67: "0067_subselection_of_interface.graphql",
+            66: "0067_subselection_of_interface.graphql",
         },
         location: DiagnosticLocation {
             file_id: FileId {
-                id: 67,
+                id: 66,
             },
             offset: 45,
             length: 4,
@@ -86,7 +86,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 67,
+                        id: 66,
                     },
                     offset: 45,
                     length: 4,
@@ -96,7 +96,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 67,
+                        id: 66,
                     },
                     offset: 181,
                     length: 31,
@@ -109,11 +109,11 @@
     },
     ApolloDiagnostic {
         cache: {
-            67: "0067_subselection_of_interface.graphql",
+            66: "0067_subselection_of_interface.graphql",
         },
         location: DiagnosticLocation {
             file_id: FileId {
-                id: 67,
+                id: 66,
             },
             offset: 52,
             length: 4,
@@ -122,7 +122,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 67,
+                        id: 66,
                     },
                     offset: 52,
                     length: 4,
@@ -132,7 +132,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 67,
+                        id: 66,
                     },
                     offset: 181,
                     length: 31,
@@ -145,11 +145,11 @@
     },
     ApolloDiagnostic {
         cache: {
-            67: "0067_subselection_of_interface.graphql",
+            66: "0067_subselection_of_interface.graphql",
         },
         location: DiagnosticLocation {
             file_id: FileId {
-                id: 67,
+                id: 66,
             },
             offset: 59,
             length: 4,
@@ -158,7 +158,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 67,
+                        id: 66,
                     },
                     offset: 59,
                     length: 4,
@@ -168,7 +168,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 67,
+                        id: 66,
                     },
                     offset: 181,
                     length: 31,
@@ -181,11 +181,11 @@
     },
     ApolloDiagnostic {
         cache: {
-            67: "0067_subselection_of_interface.graphql",
+            66: "0067_subselection_of_interface.graphql",
         },
         location: DiagnosticLocation {
             file_id: FileId {
-                id: 67,
+                id: 66,
             },
             offset: 66,
             length: 4,
@@ -194,7 +194,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 67,
+                        id: 66,
                     },
                     offset: 66,
                     length: 4,
@@ -204,7 +204,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 67,
+                        id: 66,
                     },
                     offset: 181,
                     length: 31,
diff --git a/crates/apollo-compiler/test_data/diagnostics/0068_subselection_of_union.txt b/crates/apollo-compiler/test_data/diagnostics/0068_subselection_of_union.txt
index 5b3d842..0b821fb 100644
--- a/crates/apollo-compiler/test_data/diagnostics/0068_subselection_of_union.txt
+++ b/crates/apollo-compiler/test_data/diagnostics/0068_subselection_of_union.txt
@@ -1,11 +1,11 @@
 [
     ApolloDiagnostic {
         cache: {
-            68: "0068_subselection_of_union.graphql",
+            67: "0068_subselection_of_union.graphql",
         },
         location: DiagnosticLocation {
             file_id: FileId {
-                id: 68,
+                id: 67,
             },
             offset: 27,
             length: 4,
@@ -14,7 +14,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 68,
+                        id: 67,
                     },
                     offset: 27,
                     length: 4,
@@ -24,7 +24,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 68,
+                        id: 67,
                     },
                     offset: 257,
                     length: 26,
@@ -37,11 +37,11 @@
     },
     ApolloDiagnostic {
         cache: {
-            68: "0068_subselection_of_union.graphql",
+            67: "0068_subselection_of_union.graphql",
         },
         location: DiagnosticLocation {
             file_id: FileId {
-                id: 68,
+                id: 67,
             },
             offset: 34,
             length: 4,
@@ -50,7 +50,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 68,
+                        id: 67,
                     },
                     offset: 34,
                     length: 4,
@@ -60,7 +60,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 68,
+                        id: 67,
                     },
                     offset: 257,
                     length: 26,
@@ -73,11 +73,11 @@
     },
     ApolloDiagnostic {
         cache: {
-            68: "0068_subselection_of_union.graphql",
+            67: "0068_subselection_of_union.graphql",
         },
         location: DiagnosticLocation {
             file_id: FileId {
-                id: 68,
+                id: 67,
             },
             offset: 41,
             length: 4,
@@ -86,7 +86,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 68,
+                        id: 67,
                     },
                     offset: 41,
                     length: 4,
@@ -96,7 +96,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 68,
+                        id: 67,
                     },
                     offset: 257,
                     length: 26,
@@ -109,11 +109,11 @@
     },
     ApolloDiagnostic {
         cache: {
-            68: "0068_subselection_of_union.graphql",
+            67: "0068_subselection_of_union.graphql",
         },
         location: DiagnosticLocation {
             file_id: FileId {
-                id: 68,
+                id: 67,
             },
             offset: 48,
             length: 4,
@@ -122,7 +122,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 68,
+                        id: 67,
                     },
                     offset: 48,
                     length: 4,
@@ -132,7 +132,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 68,
+                        id: 67,
                     },
                     offset: 257,
                     length: 26,
@@ -145,11 +145,11 @@
     },
     ApolloDiagnostic {
         cache: {
-            68: "0068_subselection_of_union.graphql",
+            67: "0068_subselection_of_union.graphql",
         },
         location: DiagnosticLocation {
             file_id: FileId {
-                id: 68,
+                id: 67,
             },
             offset: 55,
             length: 4,
@@ -158,7 +158,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 68,
+                        id: 67,
                     },
                     offset: 55,
                     length: 4,
@@ -168,7 +168,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 68,
+                        id: 67,
                     },
                     offset: 257,
                     length: 26,
@@ -181,11 +181,11 @@
     },
     ApolloDiagnostic {
         cache: {
-            68: "0068_subselection_of_union.graphql",
+            67: "0068_subselection_of_union.graphql",
         },
         location: DiagnosticLocation {
             file_id: FileId {
-                id: 68,
+                id: 67,
             },
             offset: 62,
             length: 4,
@@ -194,7 +194,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 68,
+                        id: 67,
                     },
                     offset: 62,
                     length: 4,
@@ -204,7 +204,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 68,
+                        id: 67,
                     },
                     offset: 257,
                     length: 26,
diff --git a/crates/apollo-compiler/test_data/diagnostics/0069_subselection_of_object.txt b/crates/apollo-compiler/test_data/diagnostics/0069_subselection_of_object.txt
index a4d6bf6..1b38b61 100644
--- a/crates/apollo-compiler/test_data/diagnostics/0069_subselection_of_object.txt
+++ b/crates/apollo-compiler/test_data/diagnostics/0069_subselection_of_object.txt
@@ -1,11 +1,11 @@
 [
     ApolloDiagnostic {
         cache: {
-            69: "0069_subselection_of_object.graphql",
+            68: "0069_subselection_of_object.graphql",
         },
         location: DiagnosticLocation {
             file_id: FileId {
-                id: 69,
+                id: 68,
             },
             offset: 28,
             length: 4,
@@ -14,7 +14,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 69,
+                        id: 68,
                     },
                     offset: 28,
                     length: 4,
@@ -24,7 +24,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 69,
+                        id: 68,
                     },
                     offset: 178,
                     length: 26,
@@ -37,11 +37,11 @@
     },
     ApolloDiagnostic {
         cache: {
-            69: "0069_subselection_of_object.graphql",
+            68: "0069_subselection_of_object.graphql",
         },
         location: DiagnosticLocation {
             file_id: FileId {
-                id: 69,
+                id: 68,
             },
             offset: 35,
             length: 4,
@@ -50,7 +50,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 69,
+                        id: 68,
                     },
                     offset: 35,
                     length: 4,
@@ -60,7 +60,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 69,
+                        id: 68,
                     },
                     offset: 178,
                     length: 26,
@@ -73,11 +73,11 @@
     },
     ApolloDiagnostic {
         cache: {
-            69: "0069_subselection_of_object.graphql",
+            68: "0069_subselection_of_object.graphql",
         },
         location: DiagnosticLocation {
             file_id: FileId {
-                id: 69,
+                id: 68,
             },
             offset: 42,
             length: 4,
@@ -86,7 +86,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 69,
+                        id: 68,
                     },
                     offset: 42,
                     length: 4,
@@ -96,7 +96,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 69,
+                        id: 68,
                     },
                     offset: 178,
                     length: 26,
@@ -109,11 +109,11 @@
     },
     ApolloDiagnostic {
         cache: {
-            69: "0069_subselection_of_object.graphql",
+            68: "0069_subselection_of_object.graphql",
         },
         location: DiagnosticLocation {
             file_id: FileId {
-                id: 69,
+                id: 68,
             },
             offset: 49,
             length: 4,
@@ -122,7 +122,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 69,
+                        id: 68,
                     },
                     offset: 49,
                     length: 4,
@@ -132,7 +132,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 69,
+                        id: 68,
                     },
                     offset: 178,
                     length: 26,
@@ -145,11 +145,11 @@
     },
     ApolloDiagnostic {
         cache: {
-            69: "0069_subselection_of_object.graphql",
+            68: "0069_subselection_of_object.graphql",
         },
         location: DiagnosticLocation {
             file_id: FileId {
-                id: 69,
+                id: 68,
             },
             offset: 56,
             length: 4,
@@ -158,7 +158,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 69,
+                        id: 68,
                     },
                     offset: 56,
                     length: 4,
@@ -168,7 +168,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 69,
+                        id: 68,
                     },
                     offset: 178,
                     length: 26,
@@ -181,11 +181,11 @@
     },
     ApolloDiagnostic {
         cache: {
-            69: "0069_subselection_of_object.graphql",
+            68: "0069_subselection_of_object.graphql",
         },
         location: DiagnosticLocation {
             file_id: FileId {
-                id: 69,
+                id: 68,
             },
             offset: 63,
             length: 4,
@@ -194,7 +194,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 69,
+                        id: 68,
                     },
                     offset: 63,
                     length: 4,
@@ -204,7 +204,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 69,
+                        id: 68,
                     },
                     offset: 178,
                     length: 26,
diff --git a/crates/apollo-compiler/test_data/diagnostics/0028_self_referential_directive_definition.graphql b/crates/apollo-compiler/test_data/diagnostics/0070_self_referential_directive_definition.graphql
similarity index 100%
rename from crates/apollo-compiler/test_data/diagnostics/0028_self_referential_directive_definition.graphql
rename to crates/apollo-compiler/test_data/diagnostics/0070_self_referential_directive_definition.graphql
diff --git a/crates/apollo-compiler/test_data/diagnostics/0028_self_referential_directive_definition.txt b/crates/apollo-compiler/test_data/diagnostics/0070_self_referential_directive_definition.txt
similarity index 83%
rename from crates/apollo-compiler/test_data/diagnostics/0028_self_referential_directive_definition.txt
rename to crates/apollo-compiler/test_data/diagnostics/0070_self_referential_directive_definition.txt
index 8171ae4..6ff1ec4 100644
--- a/crates/apollo-compiler/test_data/diagnostics/0028_self_referential_directive_definition.txt
+++ b/crates/apollo-compiler/test_data/diagnostics/0070_self_referential_directive_definition.txt
@@ -1,11 +1,11 @@
 [
     ApolloDiagnostic {
         cache: {
-            28: "0028_self_referential_directive_definition.graphql",
+            69: "0070_self_referential_directive_definition.graphql",
         },
         location: DiagnosticLocation {
             file_id: FileId {
-                id: 28,
+                id: 69,
             },
             offset: 106,
             length: 15,
@@ -14,7 +14,7 @@
             Label {
                 location: DiagnosticLocation {
                     file_id: FileId {
-                        id: 28,
+                        id: 69,
                     },
                     offset: 106,
                     length: 15,
diff --git a/crates/apollo-parser/src/tests.rs b/crates/apollo-parser/src/tests.rs
index f1a8f50..e8fae81 100644
--- a/crates/apollo-parser/src/tests.rs
+++ b/crates/apollo-parser/src/tests.rs
@@ -1,6 +1,7 @@
 // The testing framework in this file is pretty much entirely copied from rust-analyzer's parser and lexer tests:
 // https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/syntax/src/tests.rs
 
+use indexmap::IndexMap;
 use std::{
     env,
     fmt::Write,
@@ -122,16 +123,48 @@ fn collect_graphql_files(root_dir: &Path, paths: &[&str]) -> Vec<(PathBuf, Strin
 
 /// Collects paths to all `.graphql` files from `dir` in a sorted `Vec<PathBuf>`.
 fn graphql_files_in_dir(dir: &Path) -> Vec<PathBuf> {
-    let mut acc = Vec::new();
-    for file in fs::read_dir(dir).unwrap() {
-        let file = file.unwrap();
-        let path = file.path();
-        if path.extension().unwrap_or_default() == "graphql" {
-            acc.push(path);
+    let mut paths = fs::read_dir(dir)
+        .unwrap()
+        .map(|file| {
+            let file = file?;
+            let path = file.path();
+            if path.extension().unwrap_or_default() == "graphql" {
+                Ok(Some(path))
+            } else {
+                Ok(None)
+            }
+        })
+        // Get rid of the `None`s
+        .filter_map(|result: std::io::Result<_>| result.transpose())
+        .collect::<Result<Vec<_>, _>>()
+        .unwrap();
+
+    paths.sort();
+
+    // Check for duplicate numbers.
+    let mut seen = IndexMap::new();
+    let next_number = paths.len() + 1;
+    for path in &paths {
+        let file_name = path.file_name().unwrap().to_string_lossy();
+        let (number, name): (usize, _) = match file_name.split_once('_') {
+            Some((number, name)) => match number.parse() {
+                Ok(number) => (number, name),
+                Err(err) => {
+                    panic!("Invalid test file name: {path:?} does not start with a number ({err})")
+                }
+            },
+            None => panic!("Invalid test file name: {path:?} does not start with a number"),
+        };
+
+        if let Some(existing) = seen.get(&number) {
+            let suggest = dir.join(format!("{next_number:03}_{name}"));
+            panic!("Conflicting test file: {path:?} has the same number as {existing:?}. Suggested name: {suggest:?}");
         }
+
+        seen.insert(number, path);
     }
-    acc.sort();
-    acc
+
+    paths
 }
 
 /// PathBuf of test fixtures directory.