Repository navigation
Conversation
🦋 Changeset detectedLatest commit: 108e77f The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
@simowe awesome work! have you tested this with both URL schema and file schema? also, please add a changeset summarizing the work as per the bot comment lastly, there is one failing test, if you can try to fix it locally |
| // These ignore node_modules and .git by default | ||
| workspace.createFileSystemWatcher( | ||
| '**/{*.graphql,*.graphqls,*.gql,*.js,*.mjs,*.cjs,*.esm,*.es,*.es6,*.jsx,*.ts,*.tsx,*.vue,*.svelte,*.cts,*.mts}', | ||
| '**/{*.graphql,*.graphqls,*.gql,*.js,*.mjs,*.cjs,*.esm,*.es,*.es6,*.jsx,*.ts,*.tsx,*.vue,*.svelte,*.cts,*.mts,*.json}', |
There was a problem hiding this comment.
| '**/{*.graphql,*.graphqls,*.gql,*.js,*.mjs,*.cjs,*.esm,*.es,*.es6,*.jsx,*.ts,*.tsx,*.vue,*.svelte,*.cts,*.mts,*.json}', | |
| '**/*.{graphql,graphqls,gql,js,mjs,cjs,esm,es,es6,jsx,ts,tsx,vue,svelte,cts,mts,json}', |
@acao I think this can be simplified to ?
There was a problem hiding this comment.
also es, esm and es6 extension should be removed 😅 never saw that somebody use it
There was a problem hiding this comment.
| '**/{*.graphql,*.graphqls,*.gql,*.js,*.mjs,*.cjs,*.esm,*.es,*.es6,*.jsx,*.ts,*.tsx,*.vue,*.svelte,*.cts,*.mts,*.json}', | |
| '**/*.{graphql,graphqls,gql,js,mjs,cjs,jsx,ts,tsx,vue,svelte,cts,mts,json}', |
There was a problem hiding this comment.
@B2o5T it would need to be tested manually, vscode uses it's own library for glob expansion
There was a problem hiding this comment.
@B2o5T same re: these unusual seeming extensions - however, they were requested by users earlier this year and last, and there were lots of emoji reacts 🤷🏻♀️ anecdotal experience isn't always enough to evaluate userland haha
there really is no reason not to be exhaustive and inclusive here, since it doesn't hurt anything
Thanks for the feedback! I've fixed the failing test and added the changeset. This PR will only reload the schema when the local schema file itself is changed, no other events trigger a reload. Therefore a URL schema will be unaffected by this. I'm not sure how to best handle a URL schema. Possibly polling on a set interval or reloading the schema whenever any file changes? |
|
@simowe this is the tricky part about URL schemas - we have to (hope) assume the introspection request is configured with cache headers, or just make a fresh request every time we need the schema. More intricate polling mechanisms would be nice but there are no standards for this, just many userland implementations |
|
@simowe I think this is fine for now. we can solve the problem for url schemas later. thank you! |
Summay
Currently, the schema is cached permanently and never reloaded. This makes it very awkward when you're developing the graphql api and the front-end at the same time, as the auto completion and validation will rely on incorrect data.
Notes
I found a function named
_invalidateSchemaCacheForProjectthat did what I needed, however it's not actually used anywhere. I assume this was removed by accident, so I found somewhere I think is appropriate to invoke it.Changes