Repository: kamilkisiela/graphql-inspector
Pull request #354 (2019-06-14 14:07:56)

Mention --header in docs


Patch:
diff --git a/docs/essentials/coverage.md b/docs/essentials/coverage.md
index 3718e2e3..9a273507 100644
--- a/docs/essentials/coverage.md
+++ b/docs/essentials/coverage.md
@@ -22,8 +22,9 @@ Run the following command:
 - `-s, --silent`- Do not render any stats in the terminal (_default: false_)
 - `-w, --write 
` - Write a file with coverage stats (_disabled by default_)
 - `-d, --deprecated` - Fail on deprecated usage (_default: false_)
-- `-r, --require <s...>` - require modules
+- `-r, --require 
` - require a module
 - `-t, --token 
` - an access token
+- `-h, --header 
` - set http header (`--header 'Auth: Basic 123')
 
 **Output**
 
diff --git a/docs/essentials/diff.md b/docs/essentials/diff.md
index 32026df3..7e4d5dca 100644
--- a/docs/essentials/diff.md
+++ b/docs/essentials/diff.md
@@ -19,8 +19,9 @@ Run the following command:
 
 **Flags**
 
-- `-r, --require <s...>` - require modules
+- `-r, --require 
` - require a module
 - `-t, --token 
` - an access token
+- `-h, --header 
` - set http header (`--header 'Auth: Basic 123')
 
 **Output**
 
diff --git a/docs/essentials/introspect.md b/docs/essentials/introspect.md
index ec1934fc..87d46d4b 100644
--- a/docs/essentials/introspect.md
+++ b/docs/essentials/introspect.md
@@ -19,8 +19,9 @@ It supports .graphql, .gql and .json extensions.
 **Flags**
 
 - `-w, --write 
` - overwrite the output (_default: graphql.schema.json_)
-- `-r, --require <s...>` - require modules
+- `-r, --require 
` - require a module
 - `-t, --token 
` - an access token
+- `-h, --header 
` - set http header (`--header 'Auth: Basic 123')
 
 **Output**
 
diff --git a/docs/essentials/serve.md b/docs/essentials/serve.md
index f5d6304c..7aae029b 100644
--- a/docs/essentials/serve.md
+++ b/docs/essentials/serve.md
@@ -16,8 +16,9 @@ Run the following command:
 
 **Flags**
 
-- `-r, --require <s...>` - require modules
+- `-r, --require 
` - require a module
 - `-t, --token 
` - an access token
+- `-h, --header 
` - set http header (`--header 'Auth: Basic 123')
 
 **Output**
 
diff --git a/docs/essentials/similar.md b/docs/essentials/similar.md
index fbbdbc32..ed3fe6e9 100644
--- a/docs/essentials/similar.md
+++ b/docs/essentials/similar.md
@@ -21,8 +21,9 @@ Run the following command:
 - `-n, --type 
` - Check only a single type (_checks all types by default_)
 - `-t, --threshold <n>` - Threshold of similarity ratio (_default: 0.4_)
 - `-w, --write 
` - Write a file with results
-- `-r, --require <s...>` - require modules
+- `-r, --require 
` - require a module
 - `-t, --token 
` - an access token
+- `-h, --header 
` - set http header (`--header 'Auth: Basic 123')
 
 **Output**
 
diff --git a/docs/essentials/validate.md b/docs/essentials/validate.md
index a1148c19..3f430524 100644
--- a/docs/essentials/validate.md
+++ b/docs/essentials/validate.md
@@ -21,8 +21,9 @@ Run the following command:
 
 - `-d, --deprecated` - Fail on deprecated usage (default: _false_)
 - `--noStrictFragments` - Do not fail on duplicated fragment names (default: _false_)
-- `-r, --require <s...>` - require modules
+- `-r, --require 
` - require a module
 - `-t, --token 
` - an access token
+- `-h, --header 
` - set http header (`--header 'Auth: Basic 123')
 
 **Output**
 
diff --git a/packages/core/src/coverage/index.ts b/packages/core/src/coverage/index.ts
index 82bb088c..6b1972c3 100644
--- a/packages/core/src/coverage/index.ts
+++ b/packages/core/src/coverage/index.ts
@@ -61,7 +61,7 @@ export function coverage(
       const fieldDef = typeInfo.getFieldDef();
       const parent = typeInfo.getParentType();
 
-      if (parent && fieldDef) {
+      if (parent && fieldDef && fieldDef.name !== '__typename') {
         const locations =
           coverage.types[parent.name].children[fieldDef.name].locations[
             source.name


Test patch:
diff --git a/packages/core/__tests__/coverage/coverage.ts b/packages/core/__tests__/coverage/coverage.ts
index 6f987c68..ad008e84 100644
--- a/packages/core/__tests__/coverage/coverage.ts
+++ b/packages/core/__tests__/coverage/coverage.ts
@@ -33,6 +33,7 @@ describe('coverage', () => {
       query getPost {
         post {
           id
+          __typename
           title
         }
       }