### Install Dependencies for Quick Start Source: https://the-guild.dev/graphql/codegen/plugins/typescript/typescript-validation-schema Install GraphQL, Zod, and the necessary GraphQL Code Generator packages for a quick start. ```bash npm i graphql zod npm i -D @graphql-codegen/cli @graphql-codegen/typescript graphql-codegen-typescript-validation-schema ``` -------------------------------- ### Install typescript-react-query with bun Source: https://the-guild.dev/graphql/codegen/plugins/typescript/typescript-react-query Install the plugin using bun. ```bash bun add --dev @graphql-codegen/typescript-react-query ``` -------------------------------- ### Add Descriptions and Examples to OCLIF Commands Source: https://the-guild.dev/graphql/codegen/plugins/typescript/typescript-oclif Use the @oclif directive with description and example keys to provide metadata for your GraphQL mutations. Multiple examples require separate 'example' keys. ```graphql mutation CreateAuthor($name: String!) @oclif( description: "Create a new author" example: "cli author:create --name Alice" example: "cli author:create --name Bob" ) { createAuthor(input: { name: $name }) { name } } ``` -------------------------------- ### Install Client Preset with bun Source: https://the-guild.dev/graphql/codegen/plugins/presets/preset-client Install the client preset package using bun. ```bash bun add --dev @graphql-codegen/client-preset ``` -------------------------------- ### Install typescript-react-query with npm Source: https://the-guild.dev/graphql/codegen/plugins/typescript/typescript-react-query Install the plugin using npm. ```bash npm i -D @graphql-codegen/typescript-react-query ``` -------------------------------- ### Install Client Preset with npm Source: https://the-guild.dev/graphql/codegen/plugins/presets/preset-client Install the client preset package using npm. ```bash npm i -D @graphql-codegen/client-preset ``` -------------------------------- ### Installation Source: https://the-guild.dev/graphql/codegen/plugins/presets/import-types-preset Install the import-types-preset package using your preferred package manager. ```APIDOC ## Installation Install the import-types-preset package using your preferred package manager. ### npm ```bash npm i -D @graphql-codegen/import-types-preset ``` ### pnpm ```bash pnpm add -D @graphql-codegen/import-types-preset ``` ### yarn ```bash yarn add --dev @graphql-codegen/import-types-preset ``` ### bun ```bash bun add --dev @graphql-codegen/import-types-preset ``` ``` -------------------------------- ### Install @graphql-codegen/add with bun Source: https://the-guild.dev/graphql/codegen/plugins/other/add Install the add plugin using bun. ```bash bun add --dev @graphql-codegen/add ``` -------------------------------- ### Install Client Preset with pnpm Source: https://the-guild.dev/graphql/codegen/plugins/presets/preset-client Install the client preset package using pnpm. ```bash pnpm add -D @graphql-codegen/client-preset ``` -------------------------------- ### GraphQL Client Integration Example Source: https://the-guild.dev/graphql/codegen/plugins/c-sharp/c-sharp-operations Example demonstrating how to use the generated C# operations with GraphQL.Client, including setting up the client and sending a query. This example uses Newtonsoft.Json for serialization. ```csharp using GraphQL.Client.Http; using GraphQL.Client.Serializer.Newtonsoft; ... using var client = new GraphQLHttpClient("https://gqlserver", new NewtonsoftJsonSerializer()); var response = await client.SendQueryAsync(UsersGQL.Request()); ``` -------------------------------- ### Install Client Preset with yarn Source: https://the-guild.dev/graphql/codegen/plugins/presets/preset-client Install the client preset package using yarn. ```bash yarn add --dev @graphql-codegen/client-preset ``` -------------------------------- ### Install TypeScript Plugin with bun Source: https://the-guild.dev/graphql/codegen/plugins/typescript/typescript Install the TypeScript plugin using bun. ```bash bun add --dev @graphql-codegen/typescript ``` -------------------------------- ### Install typescript-react-query with yarn Source: https://the-guild.dev/graphql/codegen/plugins/typescript/typescript-react-query Install the plugin using yarn. ```bash yarn add --dev @graphql-codegen/typescript-react-query ``` -------------------------------- ### Install typescript-react-query with pnpm Source: https://the-guild.dev/graphql/codegen/plugins/typescript/typescript-react-query Install the plugin using pnpm. ```bash pnpm add -D @graphql-codegen/typescript-react-query ``` -------------------------------- ### Install Packages with bun Source: https://the-guild.dev/graphql/codegen/docs/getting-started/installation Installs all necessary packages after configuration using bun. ```bash bun install ``` -------------------------------- ### Install Time Plugin with bun Source: https://the-guild.dev/graphql/codegen/plugins/other/time Install the time plugin using bun. ```bash bun add --dev @graphql-codegen/time ``` -------------------------------- ### Install typescript-graphql-request with bun Source: https://the-guild.dev/graphql/codegen/plugins/typescript/typescript-graphql-request Install the plugin using bun. ```bash bun add --dev @graphql-codegen/typescript-graphql-request ``` -------------------------------- ### Install graphql-codegen-typescript-mock-data with bun Source: https://the-guild.dev/graphql/codegen/plugins/typescript/typescript-mock-data Install the plugin as a development dependency using bun. ```bash bun add --dev graphql-codegen-typescript-mock-data ``` -------------------------------- ### Install GraphQL Yoga (bun) Source: https://the-guild.dev/graphql/codegen/docs/guides/api-testing Install the GraphQL Yoga package using bun. ```bash bun add graphql-yoga ``` -------------------------------- ### Install Packages with npm Source: https://the-guild.dev/graphql/codegen/docs/getting-started/installation Installs all necessary packages after configuration using npm. ```bash npm install ``` -------------------------------- ### Install @graphql-codegen/add with yarn Source: https://the-guild.dev/graphql/codegen/plugins/other/add Install the add plugin using yarn. ```bash yarn add --dev @graphql-codegen/add ``` -------------------------------- ### Install import-types preset with bun Source: https://the-guild.dev/graphql/codegen/plugins/presets/import-types-preset Install the preset as a development dependency using bun. ```bash bun add --dev @graphql-codegen/import-types-preset ``` -------------------------------- ### Install TypedDocumentNode Plugin with bun Source: https://the-guild.dev/graphql/codegen/plugins/typescript/typed-document-node Install the typed-document-node plugin using bun. ```bash bun add --dev @graphql-codegen/typed-document-node ``` -------------------------------- ### Install Time Plugin with pnpm Source: https://the-guild.dev/graphql/codegen/plugins/other/time Install the time plugin using pnpm. ```bash pnpm add -D @graphql-codegen/time ``` -------------------------------- ### Install Packages with pnpm Source: https://the-guild.dev/graphql/codegen/docs/getting-started/installation Installs all necessary packages after configuration using pnpm. ```bash pnpm install ``` -------------------------------- ### Install typescript-apollo-client-helpers with bun Source: https://the-guild.dev/graphql/codegen/plugins/typescript/typescript-apollo-client-helpers Install the plugin as a development dependency using bun. ```bash bun add --dev @graphql-codegen/typescript-apollo-client-helpers ``` -------------------------------- ### Install Time Plugin with yarn Source: https://the-guild.dev/graphql/codegen/plugins/other/time Install the time plugin using yarn. ```bash yarn add --dev @graphql-codegen/time ``` -------------------------------- ### Install C# Operations Plugin with bun Source: https://the-guild.dev/graphql/codegen/plugins/c-sharp/c-sharp-operations Install the c-sharp-operations plugin using bun. ```bash bun add --dev @graphql-codegen/c-sharp-operations ``` -------------------------------- ### Install Time Plugin with npm Source: https://the-guild.dev/graphql/codegen/plugins/other/time Install the time plugin using npm. ```bash npm i -D @graphql-codegen/time ``` -------------------------------- ### Install Packages with yarn Source: https://the-guild.dev/graphql/codegen/docs/getting-started/installation Installs all necessary packages after configuration using yarn. ```bash yarn install ``` -------------------------------- ### GraphQL Yoga with Typed Resolvers Source: https://the-guild.dev/graphql/codegen/docs/getting-started Integrate typed resolvers with GraphQL Yoga by using this setup. This example requires `graphql-yoga` and a valid `schema.graphql` file. ```typescript import { readFileSync } from 'node:fs' import { createServer } from 'node:http' import { createYoga, createSchema } from 'graphql-yoga' import { Resolvers } from './resolvers-types' const typeDefs = readFileSync('./schema.graphql', 'utf8') const resolvers: Resolvers = { Query: { // typed resolvers! } } const schema = createSchema({ typeDefs, resolvers }) const yoga = createYoga({ schema }) const server = createServer(yoga) server.listen(4000, () => { console.log('GraphQL Server is listening on http://localhost:4000/graphql'); }) ``` -------------------------------- ### Install GraphQL Yoga (yarn) Source: https://the-guild.dev/graphql/codegen/docs/guides/api-testing Install the GraphQL Yoga package using yarn. ```bash yarn add graphql-yoga ``` -------------------------------- ### TypeScript Support with `ts-node` Source: https://the-guild.dev/graphql/codegen/docs/config-reference/require-field To use TypeScript files directly, install `ts-node` and specify its register export in your config. This enables the use of TypeScript in your codegen setup. ```typescript import { CodegenConfig } from '@graphql-codegen/cli' const config: CodegenConfig = { // ... require: ['ts-node/register'] // ... } export default config ``` -------------------------------- ### Install KitQL Client and Codegen (bun) Source: https://the-guild.dev/graphql/codegen/docs/guides/svelte Install the necessary KitQL packages using bun. ```bash bun add @kitql/client bun add --dev @kitql/graphql-codegen ``` -------------------------------- ### GraphQL Query for Infinite Query Example Source: https://the-guild.dev/graphql/codegen/plugins/typescript/typescript-react-query A sample GraphQL query demonstrating fields that can be used with infinite queries, including pagination parameters like `range` and `starting`. ```graphql query AnimalsQuery($catsRange: Int, $catsStarting: Int, $dogsRange: Int, $dogsStarting: Int) { cats(range: $catsRange, starting: $catsStarting) { # … } dogs(range: $dogsRange, starting: $dogsStarting) { # … } } ``` -------------------------------- ### Install C# Operations Plugin with npm Source: https://the-guild.dev/graphql/codegen/plugins/c-sharp/c-sharp-operations Install the c-sharp-operations plugin using npm. ```bash npm i -D @graphql-codegen/c-sharp-operations ``` -------------------------------- ### Accessing Fragment Type by Importing Source: https://the-guild.dev/graphql/codegen/plugins/presets/preset-client Example of how to get a Fragment's type by directly importing it from the generated files. The type is named based on the fragment name with a 'Fragment' suffix. ```typescript import { FilmItemFragment } from './gql' const allFilmsWithVariablesQueryDocument = graphql(/* GraphQL */ ` query allFilmsWithVariablesQuery($first: Int!) { allFilms(first: $first) { edges { node { ...FilmItem } } } } `) function myFilmHelper(film: FilmItemFragment) { // ... } ``` -------------------------------- ### Install KitQL Client and Codegen (npm) Source: https://the-guild.dev/graphql/codegen/docs/guides/svelte Install the necessary KitQL packages using npm. ```bash npm i @kitql/client npm i -D @kitql/graphql-codegen ``` -------------------------------- ### Install graphql-codegen-apollo-next-ssr with bun Source: https://the-guild.dev/graphql/codegen/plugins/typescript/typescript-apollo-next Install the Apollo Next.js SSR plugin using bun. ```bash bun add --dev graphql-codegen-apollo-next-ssr ``` -------------------------------- ### Prepare Environment with npm Source: https://the-guild.dev/graphql/codegen/plugins/java/java-apollo-android Initialize npm, install GraphQL, and the codegen CLI with the Java Apollo Android plugin. ```bash npm init --yes npm install graphql npm install -D @graphql-codegen/cli @graphql-codegen/java-apollo-android ``` -------------------------------- ### Install KitQL Client and Codegen (yarn) Source: https://the-guild.dev/graphql/codegen/docs/guides/svelte Install the necessary KitQL packages using yarn. ```bash yarn add @kitql/client yarn add --dev @kitql/graphql-codegen ``` -------------------------------- ### Prepare Environment with bun Source: https://the-guild.dev/graphql/codegen/plugins/java/java-apollo-android Initialize bun, install GraphQL, and the codegen CLI with the Java Apollo Android plugin. ```bash bun init --yes bun add graphql bun add --dev @graphql-codegen/cli @graphql-codegen/java-apollo-android ``` -------------------------------- ### Initialize project and install Kotlin codegen dependencies with bun Source: https://the-guild.dev/graphql/codegen/plugins/java/kotlin Initializes a new bun project and installs the necessary GraphQL codegen CLI and Kotlin plugin. ```bash bun init --yes bun add graphql bun add --dev @graphql-codegen/cli @graphql-codegen/kotlin ``` -------------------------------- ### Install import-types preset with pnpm Source: https://the-guild.dev/graphql/codegen/plugins/presets/import-types-preset Install the preset as a development dependency using pnpm. ```bash pnpm add -D @graphql-codegen/import-types-preset ``` -------------------------------- ### Install typescript-graphql-request with yarn Source: https://the-guild.dev/graphql/codegen/plugins/typescript/typescript-graphql-request Install the plugin using yarn. ```bash yarn add --dev @graphql-codegen/typescript-graphql-request ``` -------------------------------- ### Install C# Operations Plugin with yarn Source: https://the-guild.dev/graphql/codegen/plugins/c-sharp/c-sharp-operations Install the c-sharp-operations plugin using yarn. ```bash yarn add --dev @graphql-codegen/c-sharp-operations ``` -------------------------------- ### Install KitQL Client and Codegen (pnpm) Source: https://the-guild.dev/graphql/codegen/docs/guides/svelte Install the necessary KitQL packages using pnpm. ```bash pnpm add @kitql/client pnpm add -D @kitql/graphql-codegen ``` -------------------------------- ### Install typescript-graphql-request with pnpm Source: https://the-guild.dev/graphql/codegen/plugins/typescript/typescript-graphql-request Install the plugin using pnpm. ```bash pnpm add -D @graphql-codegen/typescript-graphql-request ``` -------------------------------- ### Install import-types preset with npm Source: https://the-guild.dev/graphql/codegen/plugins/presets/import-types-preset Install the preset as a development dependency using npm. ```bash npm i -D @graphql-codegen/import-types-preset ``` -------------------------------- ### Install typescript-graphql-request with npm Source: https://the-guild.dev/graphql/codegen/plugins/typescript/typescript-graphql-request Install the plugin using npm. ```bash npm i -D @graphql-codegen/typescript-graphql-request ``` -------------------------------- ### Prepare Environment with yarn Source: https://the-guild.dev/graphql/codegen/plugins/java/java-apollo-android Initialize yarn, install GraphQL, and the codegen CLI with the Java Apollo Android plugin. ```bash yarn init --yes yarn add graphql yarn add --dev @graphql-codegen/cli @graphql-codegen/java-apollo-android ``` -------------------------------- ### Install flow-resolvers with bun Source: https://the-guild.dev/graphql/codegen/plugins/flow/flow-resolvers Install the flow-resolvers plugin as a development dependency using bun. ```bash bun add --dev @graphql-codegen/flow-resolvers ``` -------------------------------- ### GraphQL Query Example Source: https://the-guild.dev/graphql/codegen/plugins/typescript/typescript-stencil-apollo Example of a GraphQL query that can be used with the plugin. ```graphql query Test { feed { id commentCount repository { full_name html_url owner { avatar_url } } } } ``` -------------------------------- ### Install Server Preset with bun Source: https://the-guild.dev/graphql/codegen/docs/guides/graphql-server-apollo-yoga-with-server-preset Install the GraphQL Code Generator CLI and the TypeScript resolver files preset using bun. ```bash bun add --dev @graphql-codegen/cli @eddeee888/gcg-typescript-resolver-files ``` -------------------------------- ### Installation Source: https://the-guild.dev/graphql/codegen/plugins/typescript/typescript-apollo-client-helpers Install the @graphql-codegen/typescript-apollo-client-helpers package using your preferred package manager. ```bash npm i -D @graphql-codegen/typescript-apollo-client-helpers ``` ```bash pnpm add -D @graphql-codegen/typescript-apollo-client-helpers ``` ```bash yarn add --dev @graphql-codegen/typescript-apollo-client-helpers ``` ```bash bun add --dev @graphql-codegen/typescript-apollo-client-helpers ``` -------------------------------- ### Install Nhost JavaScript SDK with bun Source: https://the-guild.dev/graphql/codegen/plugins/typescript/typescript-nhost Install the Nhost JavaScript SDK using bun. ```bash bun add @nhost/nhost-js ``` -------------------------------- ### Install GraphQL Yoga (pnpm) Source: https://the-guild.dev/graphql/codegen/docs/guides/api-testing Install the GraphQL Yoga package using pnpm. ```bash pnpm add graphql-yoga ``` -------------------------------- ### Initialize project and install Kotlin codegen dependencies with npm Source: https://the-guild.dev/graphql/codegen/plugins/java/kotlin Initializes a new npm project and installs the necessary GraphQL codegen CLI and Kotlin plugin. ```bash npm init --yes npm install graphql npm install -D @graphql-codegen/cli @graphql-codegen/kotlin ``` -------------------------------- ### Install import-types preset with yarn Source: https://the-guild.dev/graphql/codegen/plugins/presets/import-types-preset Install the preset as a development dependency using yarn. ```bash yarn add --dev @graphql-codegen/import-types-preset ``` -------------------------------- ### Install @graphql-codegen/add with pnpm Source: https://the-guild.dev/graphql/codegen/plugins/other/add Install the add plugin using pnpm. ```bash pnpm add -D @graphql-codegen/add ``` -------------------------------- ### Install Fragment Matcher Plugin with bun Source: https://the-guild.dev/graphql/codegen/plugins/other/fragment-matcher Install the fragment-matcher plugin as a development dependency using bun. ```bash bun add --dev @graphql-codegen/fragment-matcher ``` -------------------------------- ### Install @graphql-codegen/add with npm Source: https://the-guild.dev/graphql/codegen/plugins/other/add Install the add plugin using npm. ```bash npm i -D @graphql-codegen/add ``` -------------------------------- ### Install graphql-codegen-reason-client with bun Source: https://the-guild.dev/graphql/codegen/plugins/other/reason-client Install the Reason Client plugin as a development dependency using bun. ```bash bun add --dev graphql-codegen-reason-client ``` -------------------------------- ### Prepare Environment with pnpm Source: https://the-guild.dev/graphql/codegen/plugins/java/java-apollo-android Initialize pnpm, install GraphQL, and the codegen CLI with the Java Apollo Android plugin. ```bash pnpm init --yes pnpm add graphql pnpm add -D @graphql-codegen/cli @graphql-codegen/java-apollo-android ``` -------------------------------- ### TypeScript Operations One-File Setup Migration Source: https://the-guild.dev/graphql/codegen/docs/migration/operations-and-client-preset-from-5-0 Migrate from a setup requiring the `typescript` plugin to using only `typescript-operations`. This new setup generates only necessary Input, Enum, and Operation types. ```typescript const config: CodegenConfig = { // ... generates: { 'src/graphql/types.generated.ts': { plugins: ['typescript', 'typescript-operations'], plugins: ['typescript-operations'] } } } ``` -------------------------------- ### Initialize project and install Kotlin codegen dependencies with pnpm Source: https://the-guild.dev/graphql/codegen/plugins/java/kotlin Initializes a new pnpm project and installs the necessary GraphQL codegen CLI and Kotlin plugin. ```bash pnpm init --yes pnpm add graphql pnpm add -D @graphql-codegen/cli @graphql-codegen/kotlin ``` -------------------------------- ### Install TypeScript Plugin with yarn Source: https://the-guild.dev/graphql/codegen/plugins/typescript/typescript Install the TypeScript plugin using yarn. ```bash yarn add --dev @graphql-codegen/typescript ``` -------------------------------- ### Install TypeScript Plugin with pnpm Source: https://the-guild.dev/graphql/codegen/plugins/typescript/typescript Install the TypeScript plugin using pnpm. ```bash pnpm add -D @graphql-codegen/typescript ``` -------------------------------- ### Install TypeScript Plugin with npm Source: https://the-guild.dev/graphql/codegen/plugins/typescript/typescript Install the TypeScript plugin using npm. ```bash npm i -D @graphql-codegen/typescript ``` -------------------------------- ### Install GraphQL Modules Preset with bun Source: https://the-guild.dev/graphql/codegen/plugins/graphql-modules-preset Install the preset as a development dependency using bun. ```bash bun add --dev @graphql-codegen/graphql-modules-preset ``` -------------------------------- ### Install GraphQL Language Server Plugin (bun) Source: https://the-guild.dev/graphql/codegen/docs/guides/vanilla-typescript Install the graphqlsp plugin for TypeScript language server auto-completion using bun. ```bash bun add --dev @0no-co/graphqlsp ``` -------------------------------- ### Install graphql-codegen-typescript-mock-data with yarn Source: https://the-guild.dev/graphql/codegen/plugins/typescript/typescript-mock-data Install the plugin as a development dependency using yarn. ```bash yarn add --dev graphql-codegen-typescript-mock-data ``` -------------------------------- ### Install graphql-codegen-typescript-mock-data with pnpm Source: https://the-guild.dev/graphql/codegen/plugins/typescript/typescript-mock-data Install the plugin as a development dependency using pnpm. ```bash pnpm add -D graphql-codegen-typescript-mock-data ``` -------------------------------- ### Install graphql-codegen-typescript-mock-data with npm Source: https://the-guild.dev/graphql/codegen/plugins/typescript/typescript-mock-data Install the plugin as a development dependency using npm. ```bash npm i -D graphql-codegen-typescript-mock-data ``` -------------------------------- ### Install graphql-codegen-svelte-apollo with pnpm Source: https://the-guild.dev/graphql/codegen/plugins/typescript-svelte-apollo Install the plugin as a development dependency using pnpm. ```bash pnpm add -D graphql-codegen-svelte-apollo ``` -------------------------------- ### Install graphql-codegen-svelte-apollo with npm Source: https://the-guild.dev/graphql/codegen/plugins/typescript-svelte-apollo Install the plugin as a development dependency using npm. ```bash npm i -D graphql-codegen-svelte-apollo ``` -------------------------------- ### Install TypedDocumentNode Plugin with yarn Source: https://the-guild.dev/graphql/codegen/plugins/typescript/typed-document-node Install the typed-document-node plugin using yarn. ```bash yarn add --dev @graphql-codegen/typed-document-node ``` -------------------------------- ### Install SWC Plugin for Client Preset (bun) Source: https://the-guild.dev/graphql/codegen/plugins/presets/preset-client Install the SWC plugin for the client preset using bun. This is a separate package required for SWC integration. ```bash bun add --dev @swc-contrib/plugin-graphql-codegen-client-preset ``` -------------------------------- ### Install Dependencies with bun Source: https://the-guild.dev/graphql/codegen/docs/guides/flutter-freezed Install the necessary packages for GraphQL Code Generator and the flutter-freezed plugin using bun. ```bash bun add graphql bun add --dev typescript @graphql-codegen/cli @graphql-codegen/flutter-freezed ``` -------------------------------- ### Install TypedDocumentNode Plugin with pnpm Source: https://the-guild.dev/graphql/codegen/plugins/typescript/typed-document-node Install the typed-document-node plugin using pnpm. ```bash pnpm add -D @graphql-codegen/typed-document-node ``` -------------------------------- ### Multi-File Setup with Import Types Preset (Old) Source: https://the-guild.dev/graphql/codegen/docs/migration/operations-and-client-preset-from-5-0 This configuration demonstrates the older multi-file setup using the `typescript` plugin for base types and `import-types` preset for operation-specific types. ```typescript const config: CodegenConfig = { // ... generates: { 'src/graphql/base-types.generated.ts': { plugins: ['typescript'] }, 'src/project-1/types.generated.ts': { documents: 'src/project-1/**/*.graphql.ts', preset: 'import-types', plugins: ['typescript-operations'], presetConfig: { typesPath: '../graphql/base-types.generated.ts' } }, 'src/project-2/types.generated.ts': { documents: 'src/project-2/**/*.graphql.ts', preset: 'import-types', plugins: ['typescript-operations'], presetConfig: { typesPath: '../graphql/base-types.generated.ts' } } } } ``` -------------------------------- ### Install TypedDocumentNode Plugin with npm Source: https://the-guild.dev/graphql/codegen/plugins/typescript/typed-document-node Install the typed-document-node plugin using npm. ```bash npm i -D @graphql-codegen/typed-document-node ``` -------------------------------- ### Install TypeScript Generic SDK with bun Source: https://the-guild.dev/graphql/codegen/plugins/typescript/typescript-generic-sdk Install the plugin as a development dependency using bun. ```bash bun add --dev @graphql-codegen/typescript-generic-sdk ``` -------------------------------- ### Install typescript-apollo-client-helpers with yarn Source: https://the-guild.dev/graphql/codegen/plugins/typescript/typescript-apollo-client-helpers Install the plugin as a development dependency using yarn. ```bash yarn add --dev @graphql-codegen/typescript-apollo-client-helpers ``` -------------------------------- ### Install typescript-apollo-client-helpers with pnpm Source: https://the-guild.dev/graphql/codegen/plugins/typescript/typescript-apollo-client-helpers Install the plugin as a development dependency using pnpm. ```bash pnpm add -D @graphql-codegen/typescript-apollo-client-helpers ``` -------------------------------- ### Install typescript-apollo-client-helpers with npm Source: https://the-guild.dev/graphql/codegen/plugins/typescript/typescript-apollo-client-helpers Install the plugin as a development dependency using npm. ```bash npm i -D @graphql-codegen/typescript-apollo-client-helpers ``` -------------------------------- ### Install Relay Operation Optimizer with bun Source: https://the-guild.dev/graphql/codegen/plugins/typescript/relay-operation-optimizer Install the plugin as a development dependency using bun. ```bash bun add --dev @graphql-codegen/relay-operation-optimizer ``` -------------------------------- ### Install Fragment Matcher Plugin with npm Source: https://the-guild.dev/graphql/codegen/plugins/other/fragment-matcher Install the fragment-matcher plugin as a development dependency using npm. ```bash npm i -D @graphql-codegen/fragment-matcher ``` -------------------------------- ### Initialize project and install Kotlin codegen dependencies with yarn Source: https://the-guild.dev/graphql/codegen/plugins/java/kotlin Initializes a new yarn project and installs the necessary GraphQL codegen CLI and Kotlin plugin. ```bash yarn init --yes yarn add graphql yarn add --dev @graphql-codegen/cli @graphql-codegen/kotlin ``` -------------------------------- ### Install Server Preset with npm Source: https://the-guild.dev/graphql/codegen/docs/guides/graphql-server-apollo-yoga-with-server-preset Install the GraphQL Code Generator CLI and the TypeScript resolver files preset using npm. ```bash npm i -D @graphql-codegen/cli @eddeee888/gcg-typescript-resolver-files ``` -------------------------------- ### Install GraphQL Code Generator with bun Source: https://the-guild.dev/graphql/codegen/docs/migration/apollo-tooling Install the core CLI, TypeScript operations plugin, and near-operation file preset using bun. ```bash bun add --dev @graphql-codegen/cli @graphql-codegen/typescript-operations @graphql-codegen/near-operation-file-preset ``` -------------------------------- ### Install GraphQL and Codegen CLI with bun Source: https://the-guild.dev/graphql/codegen/docs/guides/react-vue Installs the necessary packages for GraphQL and the GraphQL Code Generator CLI using bun. ```bash bun add graphql bun add --dev typescript @graphql-codegen/cli @parcel/watcher ``` -------------------------------- ### Install graphql-codegen-reason-client with yarn Source: https://the-guild.dev/graphql/codegen/plugins/other/reason-client Install the Reason Client plugin as a development dependency using yarn. ```bash yarn add --dev graphql-codegen-reason-client ``` -------------------------------- ### Install Nhost JavaScript SDK with npm Source: https://the-guild.dev/graphql/codegen/plugins/typescript/typescript-nhost Install the Nhost JavaScript SDK using npm. ```bash npm i --save @nhost/nhost-js ``` -------------------------------- ### Install GraphQL Codegen CLI and TypeScript Nhost Plugin with bun Source: https://the-guild.dev/graphql/codegen/plugins/typescript/typescript-nhost Install the GraphQL Codegen CLI and the Nhost TypeScript plugin using bun. ```bash bun add --dev @graphql-codegen/cli @graphql-codegen/typescript-nhost ``` -------------------------------- ### GraphQL Schema Example Source: https://the-guild.dev/graphql/codegen/plugins/typescript/typescript-fabbrica An example GraphQL schema defining Book and Author types. ```graphql # schema.graphql type Book { id: ID! title: String! author: Author! } type Author { id: ID! name: String! books: [Book!]! } ``` -------------------------------- ### Install graphql-sock Source: https://the-guild.dev/graphql/codegen/plugins/typescript/typescript-resolvers Install the graphql-sock peer dependency before enabling support for the @semanticNonNull directive. ```bash npm install -D graphql-sock ``` ```bash pnpm add -D graphql-sock ``` ```bash yarn add --dev graphql-sock ``` ```bash bun add --dev graphql-sock ``` -------------------------------- ### Install with bun Source: https://the-guild.dev/graphql/codegen/docs/migration/operations-and-client-preset-from-5-0 Use this command to install the latest versions of the GraphQL Codegen CLI, typescript-operations, and client-preset using bun. ```bash bun add --dev @graphql-codegen/cli@latest @graphql-codegen/typescript-operations@latest @graphql-codegen/client-preset@latest ``` -------------------------------- ### Install TypeScript Resolvers Plugin with bun Source: https://the-guild.dev/graphql/codegen/plugins/typescript/typescript-resolvers Install the @graphql-codegen/typescript-resolvers plugin using bun. ```bash bun add --dev @graphql-codegen/typescript-resolvers ``` -------------------------------- ### Install TypeScript Resolvers Plugin with yarn Source: https://the-guild.dev/graphql/codegen/plugins/typescript/typescript-resolvers Install the @graphql-codegen/typescript-resolvers plugin using yarn. ```bash yarn add --dev @graphql-codegen/typescript-resolvers ``` -------------------------------- ### Install TypeScript Resolvers Plugin with pnpm Source: https://the-guild.dev/graphql/codegen/plugins/typescript/typescript-resolvers Install the @graphql-codegen/typescript-resolvers plugin using pnpm. ```bash pnpm add -D @graphql-codegen/typescript-resolvers ``` -------------------------------- ### Install TypeScript Resolvers Plugin with npm Source: https://the-guild.dev/graphql/codegen/plugins/typescript/typescript-resolvers Install the @graphql-codegen/typescript-resolvers plugin using npm. ```bash npm i -D @graphql-codegen/typescript-resolvers ```