apollographql / apollographql/apollo-tooling

VSCode: local schema doesn't work + weird caching issues

Open
#1,106 1 comment 6 reactions 0 assignees View on GitHub
:spiral_notepad: component - vscode
Dominant language
TypeScript
Stars
3k
Forks
460
PR merge metrics
No merged PRs in 30d

Description

**Intended outcome:**

- I wanna use apollo tooling to write queries within my typescript files
- local schema is used created by fetching schema from server via apollo cli
`apollo service:download --endpoint=http://localhost:8000/graphql schema-twisto.json`

**Actual outcome:**

1. getting weird errors ( looks like vscode plugin does some weird caching )

![image](https://user-images.githubusercontent.com/1223799/54193935-607eb300-44bb-11e9-9f1c-91d626556f3f.png)

If I change the path to non existent and back, plugin will get stuck on the same error:

![bug-apollo-client-weird-cache](https://user-images.githubusercontent.com/1223799/54194137-d4b95680-44bb-11e9-8b7d-14f7ed4e473d.gif)

2. If I explicitly reload code and reload the schema, errors are gone but, another one occurs ( **config is loaded 3 times** )

![bug-apollo-client-loaded-3-times](https://user-images.githubusercontent.com/1223799/54194454-96706700-44bc-11e9-8250-c33fddb51c8f.gif)

3. plugin doesn't work and still uses the old schema

![bug-apollo-client-using-old-schema](https://user-images.githubusercontent.com/1223799/54194888-96249b80-44bd-11e9-8228-55849dc9256d.gif)

**How to reproduce the issue:**

**Versions**
apollo vscode plugin: 1.5.2

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the issue with the Apollo VSCode plugin 1.5.2 and the locally downloaded schema from the documented apollo service:download command. Investigate the schema reload and caching behavior shown in the supplied recordings; done means the local schema is used after updates, errors do not persist, and the config is loaded once.

Written by the indexing model from the issue text.

Assessment

Tech stack
graphql, typescript, vscode
Domain
developer-experience, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.