question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can't fetch schema in packaged app, works in dev mode

See original GitHub issue

Describe the bug Sometime last year prior to October, Insomnia (binary) was no longer able to fetch the schema from a graphql server that it previously worked fine with.

The GraphQLEditor component shows a small modal saying Failed to fetch schema: list.reduce is not a function

At the same time though, the schema is resolved without issue in the GraphQL playground provided by the server, the Altair GraphQL app (though they’re using a “GraphQL Event Stream protocol” for schema fetching, I thought it worth mentioning), and I can run the introspection query manually in Insomnia and get a valid response:

Introspection Query
query schema {
  __schema {
    types {
      name
    }
  }
}

query type {
  __type(name: "List") {
    name
    kind
    fields {
      name
      type {
        name
        kind
        ofType {
          name
          kind
        }
      }
    }
  }
}

query IntrospectionQuery {
      __schema {
        queryType { name }
        mutationType { name }
        subscriptionType { name }
        types {
          ...FullType
        }
        directives {
          name
          description
          locations
          args {
            ...InputValue
          }
        }
      }
    }

    fragment FullType on __Type {
      kind
      name
      description
      fields(includeDeprecated: true) {
        name
        description
        args {
          ...InputValue
        }
        type {
          ...TypeRef
        }
        isDeprecated
        deprecationReason
      }
      inputFields {
        ...InputValue
      }
      interfaces {
        ...TypeRef
      }
      enumValues(includeDeprecated: true) {
        name
        description
        isDeprecated
        deprecationReason
      }
      possibleTypes {
        ...TypeRef
      }
    }

    fragment InputValue on __InputValue {
      name
      description
      type { ...TypeRef }
      defaultValue
    }

    fragment TypeRef on __Type {
      kind
      name
      ofType {
        kind
        name
        ofType {
          kind
          name
          ofType {
            kind
            name
            ofType {
              kind
              name
              ofType {
                kind
                name
                ofType {
                  kind
                  name
                  ofType {
                    kind
                    name
                  }
                }
              }
            }
          }
        }
      }
    }
Response
{
  "data": {
    "__type": {
      "name": "List",
      "kind": "OBJECT",
      "fields": {
        "0": {
          "name": "id",
          "type": {
            "name": {},
            "kind": "NON_NULL",
            "ofType": {
              "name": "Int",
              "kind": "SCALAR"
            }
          }
        },
        "1": {
          "name": "datePublished",
          "type": {
            "name": {},
            "kind": "NON_NULL",
            "ofType": {
              "name": "String",
              "kind": "SCALAR"
            }
          }
        },
        "2": {
          "name": "dateUpdated",
          "type": {
            "name": {},
            "kind": "NON_NULL",
            "ofType": {
              "name": "String",
              "kind": "SCALAR"
            }
          }
        },
        "3": {
          "name": "modified",
          "type": {
            "name": {},
            "kind": "NON_NULL",
            "ofType": {
              "name": "String",
              "kind": "SCALAR"
            }
          }
        },
        "4": {
          "name": "content",
          "type": {
            "name": {},
            "kind": "NON_NULL",
            "ofType": {
              "name": "String",
              "kind": "SCALAR"
            }
          }
        },
        "5": {
          "name": "excerpt",
          "type": {
            "name": {},
            "kind": "NON_NULL",
            "ofType": {
              "name": "String",
              "kind": "SCALAR"
            }
          }
        },
        "6": {
          "name": "title",
          "type": {
            "name": {},
            "kind": "NON_NULL",
            "ofType": {
              "name": "String",
              "kind": "SCALAR"
            }
          }
        },
        "7": {
          "name": "status",
          "type": {
            "name": {},
            "kind": "NON_NULL",
            "ofType": {
              "name": "String",
              "kind": "SCALAR"
            }
          }
        },
        "8": {
          "name": "commentStatus",
          "type": {
            "name": {},
            "kind": "NON_NULL",
            "ofType": {
              "name": "String",
              "kind": "SCALAR"
            }
          }
        },
        "9": {
          "name": "name",
          "type": {
            "name": {},
            "kind": "NON_NULL",
            "ofType": {
              "name": "String",
              "kind": "SCALAR"
            }
          }
        },
        "10": {
          "name": "link",
          "type": {
            "name": {},
            "kind": "NON_NULL",
            "ofType": {
              "name": "String",
              "kind": "SCALAR"
            }
          }
        },
        "11": {
          "name": "guid",
          "type": {
            "name": {},
            "kind": "NON_NULL",
            "ofType": {
              "name": "String",
              "kind": "SCALAR"
            }
          }
        },
        "12": {
          "name": "type",
          "type": {
            "name": {},
            "kind": "NON_NULL",
            "ofType": {
              "name": "String",
              "kind": "SCALAR"
            }
          }
        },
        "13": {
          "name": "commentCount",
          "type": {
            "name": {},
            "kind": "NON_NULL",
            "ofType": {
              "name": "Int",
              "kind": "SCALAR"
            }
          }
        },
        "14": {
          "name": "metaTitle",
          "type": {
            "name": "String",
            "kind": "SCALAR",
            "ofType": {}
          }
        },
        "15": {
          "name": "metaDescription",
          "type": {
            "name": "String",
            "kind": "SCALAR",
            "ofType": {}
          }
        },
        "16": {
          "name": "rssStructuredContent",
          "type": {
            "name": "String",
            "kind": "SCALAR",
            "ofType": {}
          }
        },
        "17": {
          "name": "structuredSummary",
          "type": {
            "name": "String",
            "kind": "SCALAR",
            "ofType": {}
          }
        },
        "18": {
          "name": "listType",
          "type": {
            "name": "String",
            "kind": "SCALAR",
            "ofType": {}
          }
        },
        "19": {
          "name": "listSections",
          "type": {
            "name": {},
            "kind": "LIST",
            "ofType": {
              "name": "ListSection",
              "kind": "OBJECT"
            }
          }
        },
        "20": {
          "name": "authors",
          "type": {
            "name": {},
            "kind": "LIST",
            "ofType": {
              "name": "Author",
              "kind": "OBJECT"
            }
          }
        },
        "21": {
          "name": "heroImage",
          "type": {
            "name": "HeroImage",
            "kind": "OBJECT",
            "ofType": {}
          }
        },
        "22": {
          "name": "featuredImage",
          "type": {
            "name": "FeaturedImage",
            "kind": "OBJECT",
            "ofType": {}
          }
        },
        "23": {
          "name": "update",
          "type": {
            "name": "Update",
            "kind": "OBJECT",
            "ofType": {}
          }
        },
        "24": {
          "name": "images",
          "type": {
            "name": {},
            "kind": "LIST",
            "ofType": {
              "name": "String",
              "kind": "SCALAR"
            }
          }
        },
        "25": {
          "name": "previewImages",
          "type": {
            "name": {},
            "kind": "LIST",
            "ofType": {
              "name": "PreviewImage",
              "kind": "OBJECT"
            }
          }
        },
        "26": {
          "name": "structuredContent",
          "type": {
            "name": {},
            "kind": "NON_NULL",
            "ofType": {
              "name": "String",
              "kind": "SCALAR"
            }
          }
        },
        "27": {
          "name": "relatedTermSlugs",
          "type": {
            "name": {},
            "kind": "NON_NULL",
            "ofType": {
              "name": {},
              "kind": "LIST"
            }
          }
        },
        "28": {
          "name": "fromSweethome",
          "type": {
            "name": {},
            "kind": "NON_NULL",
            "ofType": {
              "name": "Boolean",
              "kind": "SCALAR"
            }
          }
        },
        "29": {
          "name": "relatedContent",
          "type": {
            "name": {},
            "kind": "NON_NULL",
            "ofType": {
              "name": {},
              "kind": "LIST"
            }
          }
        }
      }
    }
  }
}

The real notable thing is that this issue is not present when running the app in dev mode.

While running npm run app-start: insomnia_schema

To Reproduce Steps to reproduce the behavior:

  1. ¯\(ツ)

Expected behavior Schema should be fetched

Screenshots From Oct 1, in a post in Slack: Screen Shot 2020-10-01 at 10 36 37 AM

Desktop (please complete the following information):

  • OS: macOS 10.15.7
  • Installation Method: binary tested both via homebrew and npm run app-build:smoke (same behavior), dev mode run via npm run app-start
  • App version:
    • via homebrew: 7.1.1
    • via npm scripts, pulled develop today (eb4ae99)

Additional context Relevant GraphQL server dependencies:

"apollo-server-express": "^2.1.0",
"express": "^4.16.3",
"graphql": "^0.13.2",

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
runofthemillcommented, Nov 3, 2021

The issue was with my plugin, and the plugin has been patched. Thanks for @develohpanda’s help in Slack (thread)

0reactions
runofthemillcommented, Nov 2, 2021

my colleague stumbled upon this bug and realized it doesn’t happen when the plugin I created is disabled!

I think I just need to not have the plugin do anything on introspection requests, but I’m not sure how to check for that in the response context 🤔

Read more comments on GitHub >

github_iconTop Results From Across the Web

"Could not find schema information for the attribute/element ...
In Visual Studio, open your app.config or web.config file. · Go to the "XML" menu and select "Create Schema". This action should create...
Read more >
Developer tools - Apollo GraphQL Docs
While your app is in dev mode, the Apollo Client Devtools will appear as an "Apollo" tab in your web browser inspector. To...
Read more >
Loading GraphQL Schemas from Different Sources
Schema and document loading doesn't work non Node.js environments, and if you are using a bundler like webpack, rollup or Vite, ...
Read more >
Troubleshoot installation issues with the App Installer file - MSIX
appinstaller file schema and the distribution protocol. Windows 10 1909 and earlier: The device must be enabled for Developer Mode or ...
Read more >
Development Mode and Production Mode | Looker
Open the Develop menu and disable the Development Mode toggle. Switching in and out of Development Mode with enhanced navigation. If your admin ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found