diff --git a/crates/apollo-compiler/test_data/diagnostics/0119_nested_subselection_issue_916.graphql b/crates/apollo-compiler/test_data/diagnostics/0119_nested_subselection_issue_916.graphql new file mode 100644 index 000000000..115bb48f4 --- /dev/null +++ b/crates/apollo-compiler/test_data/diagnostics/0119_nested_subselection_issue_916.graphql @@ -0,0 +1,8 @@ +type Query { + me: User +} +type User { + name: String +} + +query Invalid { me { name { reviews { body } } } } diff --git a/crates/apollo-compiler/test_data/diagnostics/0119_nested_subselection_issue_916.txt b/crates/apollo-compiler/test_data/diagnostics/0119_nested_subselection_issue_916.txt new file mode 100644 index 000000000..efac43664 --- /dev/null +++ b/crates/apollo-compiler/test_data/diagnostics/0119_nested_subselection_issue_916.txt @@ -0,0 +1,10 @@ +Error: field selection of scalar type `String` must not have subselections + ╭─[0119_nested_subselection_issue_916.graphql:8:22] + │ + 8 │ query Invalid { me { name { reviews { body } } } } + │ ────────────┬──────────── + │ ╰────────────── remove subselections here + │ + │ Note: path to the field: `query Invalid → me → name` +───╯ + diff --git a/crates/apollo-compiler/test_data/serializer/diagnostics/0119_nested_subselection_issue_916.graphql b/crates/apollo-compiler/test_data/serializer/diagnostics/0119_nested_subselection_issue_916.graphql new file mode 100644 index 000000000..bf8b1d441 --- /dev/null +++ b/crates/apollo-compiler/test_data/serializer/diagnostics/0119_nested_subselection_issue_916.graphql @@ -0,0 +1,17 @@ +type Query { + me: User +} + +type User { + name: String +} + +query Invalid { + me { + name { + reviews { + body + } + } + } +}