Skip to content

Commit

Permalink
docs(website): mention type checking of config
Browse files Browse the repository at this point in the history
  • Loading branch information
uhyo committed Apr 29, 2023
1 parent bae5bce commit 675d619
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions website/src/app/(docs)/configuration/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,27 @@ export default function GettingStarted() {
<code>.graphqlrc.cjs</code>
</li>
</ol>

<h4>Using JavaScript configuration files</h4>
<p>
When using JavaScript configuration files, a ES Module configuration
file should default-export the configuration object. A CommonJS
configuration file should assign the configuration object to{" "}
<code>module.exports</code>.
</p>
<p>Also you can use JSDoc for type checking and auto-completion.</p>
<Highlight language="js">
{`/**
* @type {import("@nitrogql/cli").NitrogqlConfig}
*/
const config = {
schema: "./schema/*.graphql",
documents: ["./app/**/*.graphql", "./common/**/*.graphql"],
// ...
};
export default config;`}
</Highlight>

<h3 id="schema-operations">schema and operations</h3>
<p>
Expand Down

0 comments on commit 675d619

Please sign in to comment.