If I can't use headers with env variables in tsconfig.json, do I need to run the generate CLI command first? #366
-
I'm trying to get a better sense of if and when I need to run So, let's say I have a next.js application, and I'm spinning up my development server; when would I need to run I have a
makes the most sense to me, but it appears to not be able to recognize the generated I'm also using Docker, and am wondering if it sounds right to run Edit: Created a related request for adding more examples like this one to the examples folder (#367) |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 6 replies
-
That depends, but basically never. You won't need to have either files present to start up a dev server. They're not runtime files, or generated runtime code, they're typings. So, neither will have to be present for your application to run. The schema will have to be present so that an output file can be generated at all. This can happen as part of the TypeScript plugin though. THe output file will hence be either generated by I don't really know why the above wouldn't work though, but it's worth checking whether you've got the right path set up for the schema file to be read. |
Beta Was this translation helpful? Give feedback.
In general, you'll need an SDL (i.e. schema) file, yes. If your schema is on a remote API, that does mean that you have to run
gql.tada generate schema
, if additional inputs are required for the API to deliver an introspection result successfully.The output typings files are an entirely separate topic. Once you switch over your
"schema"
configuration option in your settings to then use the local file, you won't have to necessarily generate this file manually. You can generate this manually, which is useful when you have separate processes that rely on it(Say, you don't commit it and are running
tsc
in your CI, or you commit it but want to check that it's up-to-date)What I'd point out i…