Repository: kamilkisiela/graphql-inspector (ts)

Issue:
coverage error if __typename is in the query
It seems that coverage throws error if the query contains the field `__typename` in the following line:
https://github.com/kamilkisiela/graphql-inspector/blob/e87c322703f305323cff947a156a5709877978c7/packages/core/src/coverage/index.ts#L66

Do you think it is OK to simple ignore it?

Pull request description:
fix coverage error if __typename is in the query
Fix #352 


Patch:
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
         }
       }