-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handle non-src dirs for TypeScript documents #10792
Conversation
@ddimaria: Thank you for submitting a pull request! Before we can merge it, you'll need to sign the Apollo Contributor License Agreement here: https://contribute.apollographql.com/ |
👷 Deploy request for apollo-client-docs pending review.Visit the deploys page to approve it
|
|
@@ -44,6 +44,8 @@ export default config; | |||
|
|||
> There are multiple ways to [specify a schema](https://www.the-guild.dev/graphql/codegen/docs/config-reference/schema-field#root-level) in your `codegen.ts`, so pick whichever way works best for your project setup. | |||
|
|||
> Your `documents` might exist in directories other than `src` and may include `ts` files, please adjust accordingly. To catch everything, consider implementing: `documents: ['**/*.{ts,tsx}']`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it might be more discoverable to people to have this as a comment in the above code example.
For example:
const config: CodegenConfig = {
schema: '<URL_OF_YOUR_GRAPHQL_API>',
+ // this assumes that all your source files are in a top-level `src/` directory - you might need to adjust this to your file structure
+ documents: ['src/**/*.{ts,tsx}'],
- documents: ['src/**/*.tsx'],
generates: {
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've applied these suggestions to get this PR out.
Do you mean that because there is now a top-level Generally, it can't be said enough: please be very careful with anything regarding the |
The static typing docs don't include documents outside of the
src
folder and.ts
files. I made a note beneath the code block. The error messages generated aren't overly helpful:This will be problematic for anyone upgrading to using the App Router in NextJS v13.