Number of Types: 0 (0 client types)
See original GitHub issueIntended 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:
- Startup VS Code, make sure, your local server is NOT yet running
- The plugin will report an error in the Output with “ECONNREFUSED”, which makes sense, as the service is not yet running.
- Start the GraphQL service (we use an Apollo server)
- Click on this button on the bottom right of VS Code to show the plugin status:
- 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:
- Created 4 years ago
- Reactions:2
- Comments:7 (3 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
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
The VS Code command “Reload schema” does now correctly load the types. Therefore I consider this done. Thanks guys! 🙂