Closed sannajammeh closed 1 week ago
I'm not a big fan of this and have recently I think left a comment with more explanation on this.
It's relatively simple to write a script with the existing CLI commands to pull the schema (it's not exactly best practice to keep pulling the schema from a live API indefinitely and repeatedly) This can also be done with the CLI's JS utilities, which can be imported directly.
Further, it's not like we'd be adding just environment variables support, since we're talking about loading them into the LSP. We'd also have to resolve a dotenv file, which isn't exactly something I think is expected to be happening in the TSServer process, and this would also further open us up to more requests, since this is non-standard to then alter the dotenv location, etc etc
It's an open-ended request that doesn't really resolve the root problem that you could attempt to resolve with what exists already: having a local SDL file, as per: https://gql-tada.0no.co/get-started/workflows#downloading-schemas
Sorry if that's not exactly the answer you're looking for but hope this makes sense
Closing since there hasn't been more follow-up to this. Let me know if there's further questions around this ✌️
Summary
We work heavily with GraphQL schemas locked down behind
Authorization
headers and would like URL introspection to work without having to gitignoretsconfig.json
. Take the following schema config:Proposed Solution
We propose the LSP being able to load
.env.local
&.env
files so this is possible:Implement
dotenv
env parsing as a step before introspectingRequirements