@@ -44,13 +44,13 @@ However, code-first development has tradeoffs:
4444
4545- You won't get automatic type definitions for your resolvers unless you generate
4646them manually or infer them through wrappers.
47- - Schema documentation, testing, and tool compatibility may require you to export
48- the schema to SDL first.
47+ - Schema documentation, testing, and tool compatibility may require you to provide
48+ a description of the schema in SDL first.
4949
5050You can still use type generation tools like GraphQL Code Generator in a code-first setup.
5151You just need to convert your schema into SDL.
5252
53- To export your schema:
53+ To produce an SDL description of your schema:
5454
5555``` ts
5656import { printSchema } from ' graphql' ;
@@ -60,13 +60,13 @@ import { writeFileSync } from 'fs';
6060writeFileSync (' ./schema.graphql' , printSchema (schema ));
6161```
6262
63- Once you've written the SDL, you can treat the project like a schema -first project
63+ Once you've written the SDL, you can treat the project like an SDL -first project
6464for type generation.
6565
6666## Schema-first development
6767
6868In a schema-first workflow, your GraphQL schema is written in SDL, for example, ` .graphql `
69- or ` .gql ` files. This serves as the source of truth for your server. This approach
69+ or ` .gql ` (discouraged) files. This serves as the source of truth for your server. This approach
7070emphasizes clarity because your schema is defined independently from your business logic.
7171
7272Schema-first development pairs well with type generation because the schema is
@@ -86,7 +86,7 @@ To get started, install the required packages:
8686npm install graphql @graphql-codegen/cli @eddeee888/gcg-typescript-resolver-files
8787```
8888
89- This scoped package is publish by a community maintainer and is widely used for GraphQL server
89+ This scoped package is published by a community maintainer and is widely used for GraphQL server
9090type generation.
9191
9292We recommend using the [ Server Preset] ( https://www.npmjs.com/package/@eddeee888/gcg-typescript-resolver-files ) for a
0 commit comments