Repository: graphql-rust/juniper (language: rust)

Issue:
Introspection schemas are invalid and break with apollo CLI
The `DirectiveLocation::InlineFragmet` enum value has the invalid literal value "INLINE_SPREAD" which is against the standard (supposed to be INLINE_FRAGMENT).

This trips up third party tools.

===
Original report:

The apollo cli for generating a `schema.json` via introspection query fails at the moment.

The error is:

```
RESULT
 { errors:
   [ { Error: Expected a value of type "__DirectiveLocation" but received: "INLINE_SPREAD"
         at completeLeafValue (/home/theduke/.config/yarn/global/node_modules/graphql/execution/execute.js:644:11)
         at completeValue (/home/theduke/.config/yarn/global/node_modules/graphql/execution/execute.js:587:12)
         at completeValue (/home/theduke/.config/yarn/global/node_modules/graphql/execution/execute.js:565:21)
         at completeValueCatchingError (/home/theduke/.config/yarn/global/node_modul
es/graphql/execution/execute.js:503:19)
         at /home/theduke/.config/yarn/global/node_modules/graphql/execution/execute.js:623:25
         at Array.forEach (<anonymous>)
         at forEach (/home/theduke/.config/yarn/global/node_modules/iterall/index.js:83:25)
         at completeListValue (/home/theduke/.config/yarn/global/node_modules/graphql/execution/execute.js:619:24)
         at completeValue (/home/theduke/.config/yarn/global/node_modules/graphql/execution/execute.js:581:12)
         at completeValue (/home/theduke/.config/yarn/global/node_modules/graphql/execution/execute.js:565:21)
       message:
        'Expected a value of type "__DirectiveLocation" but received: "INLINE_SPREAD"',
       locations: [ { line: 13, column: 11 } ],
       path: [ '__schema', 'directives', 0, 'locations', 2 ] } ],
  data: null }
```


Discussion / hints:

Fix patch:
diff --git a/juniper/CHANGELOG.md b/juniper/CHANGELOG.md
index 4cba30732..891e64c40 100644
--- a/juniper/CHANGELOG.md
+++ b/juniper/CHANGELOG.md
@@ -2,6 +2,9 @@
 
 - The minimum required Rust version is now `1.30.0`.
 - The `ScalarValue` custom derive has been renamed to `GraphQLScalarValue`.
+- Fix introspection query validity
+    The DirectiveLocation::InlineFragment had an invalid literal value,
+    which broke third party tools like apollo cli.
 
 # [0.11.1] 2018-12-19
 
diff --git a/juniper/src/schema/model.rs b/juniper/src/schema/model.rs
index 2a4fab8be..acd47cffc 100644
--- a/juniper/src/schema/model.rs
+++ b/juniper/src/schema/model.rs
@@ -67,7 +67,7 @@ pub enum DirectiveLocation {
     FragmentDefinition,
     #[graphql(name = "FRAGMENT_SPREAD")]
     FragmentSpread,
-    #[graphql(name = "INLINE_SPREAD")]
+    #[graphql(name = "INLINE_FRAGMENT")]
     InlineFragment,
 }
 


Test patch:
diff --git a/juniper/src/tests/introspection_tests.rs b/juniper/src/tests/introspection_tests.rs
index 21be4771b..4c44cffe8 100644
--- a/juniper/src/tests/introspection_tests.rs
+++ b/juniper/src/tests/introspection_tests.rs
@@ -140,6 +140,50 @@ fn test_introspection_documentation() {
     );
 }
 
+#[test]
+fn test_introspection_directives() {
+    let q = r#"
+        query IntrospectionQuery {
+          __schema {
+            directives {
+              name
+              locations
+            }
+          }
+        }
+    "#;
+
+    let database = Database::new();
+    let schema = RootNode::new(&database, EmptyMutation::<Database>::new());
+
+    let result = ::execute(q, None, &schema, &Variables::new(), &database).unwrap();
+
+    let expected = graphql_value!({
+        "__schema": {
+            "directives": [
+                {
+                    "name": "skip",
+                    "locations": [
+                        "FIELD",
+                        "FRAGMENT_SPREAD",
+                        "INLINE_FRAGMENT",
+                    ],
+                },
+                {
+                    "name": "include",
+                    "locations": [
+                        "FIELD",
+                        "FRAGMENT_SPREAD",
+                        "INLINE_FRAGMENT",
+                    ],
+                },
+            ],
+        },
+    });
+
+    assert_eq!(result, (expected, vec![]));
+}
+
 #[test]
 fn test_introspection_possible_types() {
     let doc = r#"