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.

Number of Types: 0 (0 client types)

See original GitHub issue

Intended outcome:

Apollo GraphQL plugin for VS Code should load the available GQL types from my local service and merge them with the local types, even if the service is started AFTER VS Code. At least the “Reload schema” command should help.

------------------------------
🚀 Apollo GraphQL v1.7.4
------------------------------
✅ Service Loaded!
🆔 Service ID: test
🏷 Schema Tag: current
📈 Number of Types: 184 (22 client types)

Actual outcome:

The plugin loads successfully but recognizes 0 types.

------------------------------
🚀 Apollo GraphQL v1.7.4
------------------------------
✅ Service Loaded!
🆔 Service ID: test
🏷 Schema Tag: current
📈 Number of Types: 0 (0 client types)

How to reproduce the issue:

  1. Startup VS Code, make sure, your local server is NOT yet running
  2. The plugin will report an error in the Output with “ECONNREFUSED”, which makes sense, as the service is not yet running.
  3. Start the GraphQL service (we use an Apollo server)
  4. Click on this button on the bottom right of VS Code to show the plugin status: image
  5. You will see the actual outcome with 0 loaded types.

Some notes:

  • The plugin works as intended, if we start the service BEFORE we start VS Code.
  • The command “Apollo: Reload Schema” does not fix the issue. Still 0 types are loaded.
  • Editing the apollo.config.js (just open it and press save) triggers the plugin to reload properly.

My config looks like this:

module.exports = {
  client: {
    name: 'my-client',
    service: {
      name: 'test',
      url: 'http://localhost:3010/graphql',
    },
  },
};

Versions

  • Apollo GraphQL v1.7.4

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
JakeDawkinscommented, Jul 18, 2019

Ah, good catch! Reloading the schema should definitely fix it, and ideally, we’d be able to load client types with no remote schema. I think that’s failing because we merge local with remote schemas, so if there’s no remote schema, merging fails.

I’m not sure if we can do anything about the ECONNREFUSED error, although I’m interested in the possibility of polling/clicking a button to refresh without manually calling reload schema

0reactions
patricknickcommented, Mar 10, 2020

The VS Code command “Reload schema” does now correctly load the types. Therefore I consider this done. Thanks guys! 🙂

Read more comments on GitHub >

github_iconTop Results From Across the Web

A stronger (typed) React Apollo - Apollo GraphQL Blog
For TypeScript users, a follow up article will go through the improvements to types for React Apollo and similar examples.
Read more >
Common Open Policy Service (COPS) Protocol
M-Types, Reason Sub-Codes, and Error Sub-codes; Client-type = 0 Flags and Error-SubCodes. Flags. COPS-PR Object S-Num, S-Types, and Error- ...
Read more >
Data types | BigQuery - Google Cloud
0 or -0 — All zero values are considered equal when sorting. Positive numbers; +inf. Groupable data types. Groupable data types can generally...
Read more >
The Transport Layer Security (TLS) Protocol Version 1.2
Numbers The basic numeric data type is an unsigned byte (uint8). ... A public-key-encrypted element is encoded as an opaque vector <0..2^16-1>, where...
Read more >
Kafka 3.3 Documentation
This distributed placement of your data is very important for scalability because it allows client applications to both read and write the data...
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