### Install SOFA with bun Source: https://the-guild.dev/graphql/mesh/docs/guides/sofa Install the SOFA plugin using bun. ```bash bun add @graphql-yoga/plugin-sofa ``` -------------------------------- ### Install SOFA with yarn Source: https://the-guild.dev/graphql/mesh/docs/guides/sofa Install the SOFA plugin using yarn. ```bash yarn add @graphql-yoga/plugin-sofa ``` -------------------------------- ### Install Federation Transform (bun) Source: https://the-guild.dev/graphql/mesh/docs/transforms/federation Install the `@graphql-mesh/transform-federation` package using bun. ```bash bun add @graphql-mesh/transform-federation ``` -------------------------------- ### Install maxTokens Plugin with bun Source: https://the-guild.dev/graphql/mesh/docs/plugins/max-tokens Install the maxTokens plugin using bun. ```bash bun add @escape.tech/graphql-armor-max-tokens ``` -------------------------------- ### Install SOFA with npm Source: https://the-guild.dev/graphql/mesh/docs/guides/sofa Install the SOFA plugin using npm. ```bash npm i @graphql-yoga/plugin-sofa ``` -------------------------------- ### Node.js `package.json` for `mesh start` Source: https://the-guild.dev/graphql/mesh/docs/getting-started/deploy-mesh-gateway Configure `package.json` to run `mesh build` before `mesh start`. This ensures the gateway schema is built during deployment and reduces server start time. ```json { "scripts": { "start": "mesh start", "build": "mesh build" } } ``` -------------------------------- ### Install SOFA with pnpm Source: https://the-guild.dev/graphql/mesh/docs/guides/sofa Install the SOFA plugin using pnpm. ```bash pnpm add @graphql-yoga/plugin-sofa ``` -------------------------------- ### Install Auth0 Package with bun Source: https://the-guild.dev/graphql/mesh/docs/guides/auth0 Install the @envelop/auth0 package using bun. ```bash bun add @envelop/auth0 ``` -------------------------------- ### Install Mock Plugin Source: https://the-guild.dev/graphql/mesh/docs/plugins/mock Install the mock plugin using your preferred package manager. ```bash npm i @graphql-mesh/plugin-mock ``` ```bash pnpm add @graphql-mesh/plugin-mock ``` ```bash yarn add @graphql-mesh/plugin-mock ``` ```bash bun add @graphql-mesh/plugin-mock ``` -------------------------------- ### Install Resolvers Composition Transform (bun) Source: https://the-guild.dev/graphql/mesh/docs/transforms/resolvers-composition Install the `resolvers-composition` transform using bun. ```bash bun add @graphql-mesh/transform-resolvers-composition ``` -------------------------------- ### Start GraphQL Mesh Server Source: https://the-guild.dev/graphql/mesh/docs/guides/auth0 Start the GraphQL Mesh development server using the `yarn start` command. This command initiates the Mesh server, making the GraphQL endpoint available. ```bash start > yarn yarn run v1.22.10 $ mesh dev ``` -------------------------------- ### Install Federation Transform (yarn) Source: https://the-guild.dev/graphql/mesh/docs/transforms/federation Install the `@graphql-mesh/transform-federation` package using yarn. ```bash yarn add @graphql-mesh/transform-federation ``` -------------------------------- ### Install Naming Convention Transform (bun) Source: https://the-guild.dev/graphql/mesh/docs/transforms/naming-convention Install the naming-convention transform using bun. ```bash bun add @graphql-mesh/transform-naming-convention ``` -------------------------------- ### Start Single Source Mesh Gateway Source: https://the-guild.dev/graphql/mesh/docs/getting-started/your-first-mesh-gateway Command to start the GraphQL Mesh gateway for a single source configuration. Ensure you have the necessary dependencies installed. ```bash yarn start-single-source ``` -------------------------------- ### Install Federation Transform (npm) Source: https://the-guild.dev/graphql/mesh/docs/transforms/federation Install the `@graphql-mesh/transform-federation` package using npm. ```bash npm i @graphql-mesh/transform-federation ``` -------------------------------- ### Install Federation Transform (pnpm) Source: https://the-guild.dev/graphql/mesh/docs/transforms/federation Install the `@graphql-mesh/transform-federation` package using pnpm. ```bash pnpm add @graphql-mesh/transform-federation ``` -------------------------------- ### Basic Live Query Setup Source: https://the-guild.dev/graphql/mesh/docs/plugins/live-queries Configure the Live Queries plugin to automatically update query results when specific mutations are called. This example invalidates `Query.todos` when `Mutation.addTodo` is executed. ```graphql query getTodos { todos { id content } } ``` ```yaml additionalTypeDefs: | directive @live on QUERY plugins: - liveQuery: invalidations: - field: Mutation.addTodo invalidate: - Query.todos ``` ```graphql query getTodos @live { todos { id content } } ``` -------------------------------- ### Install Naming Convention Transform (npm) Source: https://the-guild.dev/graphql/mesh/docs/transforms/naming-convention Install the naming-convention transform using npm. ```bash npm i @graphql-mesh/transform-naming-convention ``` -------------------------------- ### Install GraphQL Handler (bun) Source: https://the-guild.dev/graphql/mesh/docs/handlers/graphql Install the GraphQL handler package using bun. ```bash bun add @graphql-mesh/graphql ``` -------------------------------- ### Install Deduplicate Request Plugin with bun Source: https://the-guild.dev/graphql/mesh/docs/plugins/deduplicate-request Install the plugin using bun. ```bash bun add @graphql-mesh/plugin-deduplicate-request ``` -------------------------------- ### Install File Cache (bun) Source: https://the-guild.dev/graphql/mesh/docs/cache/file Install the file cache strategy using bun. ```bash bun add @graphql-mesh/cache-file ``` -------------------------------- ### Install Resolvers Composition Transform (yarn) Source: https://the-guild.dev/graphql/mesh/docs/transforms/resolvers-composition Install the `resolvers-composition` transform using yarn. ```bash yarn add @graphql-mesh/transform-resolvers-composition ``` -------------------------------- ### Install CLI and OpenAPI Packages for bun Source: https://the-guild.dev/graphql/mesh/docs/guides/hive Install @graphql-mesh/cli, @graphql-mesh/openapi, and graphql packages using bun. ```bash bun add @graphql-mesh/cli @graphql-mesh/openapi graphql ``` -------------------------------- ### Install maxTokens Plugin with yarn Source: https://the-guild.dev/graphql/mesh/docs/plugins/max-tokens Install the maxTokens plugin using yarn. ```bash yarn add @escape.tech/graphql-armor-max-tokens ``` -------------------------------- ### Install maxTokens Plugin with npm Source: https://the-guild.dev/graphql/mesh/docs/plugins/max-tokens Install the maxTokens plugin using npm. ```bash npm i @escape.tech/graphql-armor-max-tokens ``` -------------------------------- ### Install Supergraph Package for bun Source: https://the-guild.dev/graphql/mesh/docs/guides/hive Install the @graphql-mesh/supergraph package using bun. ```bash bun add @graphql-mesh/supergraph ``` -------------------------------- ### Install HTTP Details Extensions Plugin Source: https://the-guild.dev/graphql/mesh/docs/plugins/http-details-extensions Install the plugin using your preferred package manager. ```bash npm i @graphql-mesh/plugin-http-details-extensions ``` ```bash pnpm add @graphql-mesh/plugin-http-details-extensions ``` ```bash yarn add @graphql-mesh/plugin-http-details-extensions ``` ```bash bun add @graphql-mesh/plugin-http-details-extensions ``` -------------------------------- ### Install Auth0 Package with yarn Source: https://the-guild.dev/graphql/mesh/docs/guides/auth0 Install the @envelop/auth0 package using yarn. ```bash yarn add @envelop/auth0 ``` -------------------------------- ### Install Hive Plugin for bun Source: https://the-guild.dev/graphql/mesh/docs/guides/hive Install the @graphql-mesh/plugin-hive package using bun. ```bash bun add @graphql-mesh/plugin-hive ``` -------------------------------- ### Install gRPC Handler with bun Source: https://the-guild.dev/graphql/mesh/docs/handlers/grpc Install the gRPC handler package using bun. ```bash bun add @graphql-mesh/grpc ``` -------------------------------- ### Install Max Depth Plugin with bun Source: https://the-guild.dev/graphql/mesh/docs/plugins/max-depth Install the `graphql-armor-max-depth` plugin using bun. ```bash bun add @escape.tech/graphql-armor-max-depth ``` -------------------------------- ### Install Mongoose Handler with bun Source: https://the-guild.dev/graphql/mesh/docs/handlers/mongoose Install the Mongoose handler package using bun. ```bash bun add @graphql-mesh/mongoose ``` -------------------------------- ### Install Naming Convention Transform (yarn) Source: https://the-guild.dev/graphql/mesh/docs/transforms/naming-convention Install the naming-convention transform using yarn. ```bash yarn add @graphql-mesh/transform-naming-convention ``` -------------------------------- ### Install GraphQL Handler (yarn) Source: https://the-guild.dev/graphql/mesh/docs/handlers/graphql Install the GraphQL handler package using yarn. ```bash yarn add @graphql-mesh/graphql ``` -------------------------------- ### Install Auth0 Package with pnpm Source: https://the-guild.dev/graphql/mesh/docs/guides/auth0 Install the @envelop/auth0 package using pnpm. ```bash pnpm add @envelop/auth0 ``` -------------------------------- ### Install Prometheus Plugin Source: https://the-guild.dev/graphql/mesh/docs/plugins/prometheus Install the Prometheus plugin and the prom-client library using your preferred package manager. ```bash npm i @graphql-mesh/plugin-prometheus prom-client ``` ```bash pnpm add @graphql-mesh/plugin-prometheus prom-client ``` ```bash yarn add @graphql-mesh/plugin-prometheus prom-client ``` ```bash bun add @graphql-mesh/plugin-prometheus prom-client ``` -------------------------------- ### Install OpenAPI Handler Source: https://the-guild.dev/graphql/mesh/docs/handlers/openapi Install the OpenAPI handler library using npm, pnpm, yarn, or bun. ```bash npm i @graphql-mesh/openapi ``` ```bash pnpm add @graphql-mesh/openapi ``` ```bash yarn add @graphql-mesh/openapi ``` ```bash bun add @graphql-mesh/openapi ``` -------------------------------- ### Install Resolvers Composition Transform (npm) Source: https://the-guild.dev/graphql/mesh/docs/transforms/resolvers-composition Install the `resolvers-composition` transform using npm. ```bash npm i @graphql-mesh/transform-resolvers-composition ``` -------------------------------- ### Install Naming Convention Transform (pnpm) Source: https://the-guild.dev/graphql/mesh/docs/transforms/naming-convention Install the naming-convention transform using pnpm. ```bash pnpm add @graphql-mesh/transform-naming-convention ``` -------------------------------- ### Install Prefix Transform with bun Source: https://the-guild.dev/graphql/mesh/docs/transforms/prefix Install the prefix transform package using bun. ```bash bun add @graphql-mesh/transform-prefix ``` -------------------------------- ### Install Live Queries Plugin Source: https://the-guild.dev/graphql/mesh/docs/plugins/live-queries Install the Live Queries plugin using your preferred package manager. ```bash npm i @graphql-mesh/plugin-live-query ``` ```bash pnpm add @graphql-mesh/plugin-live-query ``` ```bash yarn add @graphql-mesh/plugin-live-query ``` ```bash bun add @graphql-mesh/plugin-live-query ``` -------------------------------- ### Install File Cache (yarn) Source: https://the-guild.dev/graphql/mesh/docs/cache/file Install the file cache strategy using yarn. ```bash yarn add @graphql-mesh/cache-file ``` -------------------------------- ### Install Auth0 Package with npm Source: https://the-guild.dev/graphql/mesh/docs/guides/auth0 Install the @envelop/auth0 package using npm. ```bash npm i @envelop/auth0 ``` -------------------------------- ### Install LocalForage Cache with bun Source: https://the-guild.dev/graphql/mesh/docs/cache/localforage Install the LocalForage cache package using bun. ```bash bun add @graphql-mesh/cache-localforage ``` -------------------------------- ### Install Resolvers Composition Transform (pnpm) Source: https://the-guild.dev/graphql/mesh/docs/transforms/resolvers-composition Install the `resolvers-composition` transform using pnpm. ```bash pnpm add @graphql-mesh/transform-resolvers-composition ``` -------------------------------- ### Install Supergraph Package for yarn Source: https://the-guild.dev/graphql/mesh/docs/guides/hive Install the @graphql-mesh/supergraph package using yarn. ```bash yarn add @graphql-mesh/supergraph ``` -------------------------------- ### Install Redis Cache with bun Source: https://the-guild.dev/graphql/mesh/docs/cache/redis Install the Redis cache package using bun. ```bash bun add @graphql-mesh/cache-redis ``` -------------------------------- ### Install File Cache (npm) Source: https://the-guild.dev/graphql/mesh/docs/cache/file Install the file cache strategy using npm. ```bash npm i @graphql-mesh/cache-file ``` -------------------------------- ### Install Mongoose Handler with npm Source: https://the-guild.dev/graphql/mesh/docs/handlers/mongoose Install the Mongoose handler package using npm. ```bash npm i @graphql-mesh/mongoose ``` -------------------------------- ### Install GraphQL Handler (npm) Source: https://the-guild.dev/graphql/mesh/docs/handlers/graphql Install the GraphQL handler package using npm. ```bash npm i @graphql-mesh/graphql ``` -------------------------------- ### Start Production Server Source: https://the-guild.dev/graphql/mesh/docs/cli-commands Serves a GraphQL server using built artifacts, recommended for production. It does not rely on sources to build the schema. Optionally specify a port. ```bash yarn graphql-mesh start --port 4002 ``` -------------------------------- ### Start Local Development Server Source: https://the-guild.dev/graphql/mesh/docs/cli-commands Serves a GraphQL server with a GraphQL interface for local testing. Optionally specify a port. ```bash yarn graphql-mesh dev --port 4002 ``` -------------------------------- ### Sample Response Data for Book Query Source: https://the-guild.dev/graphql/mesh/docs/getting-started/sources-with-no-definition Example JSON response for a GET /books/:id request, used by the jsonSchema handler to infer the GraphQL type. ```json { "id": "1", "title": "Dune", "authorId": "0", "categoryId": "0" } ``` -------------------------------- ### Install gRPC Handler with pnpm Source: https://the-guild.dev/graphql/mesh/docs/handlers/grpc Install the gRPC handler package using pnpm. ```bash pnpm add @graphql-mesh/grpc ``` -------------------------------- ### Install gRPC Handler with yarn Source: https://the-guild.dev/graphql/mesh/docs/handlers/grpc Install the gRPC handler package using yarn. ```bash yarn add @graphql-mesh/grpc ``` -------------------------------- ### Install gRPC Handler with npm Source: https://the-guild.dev/graphql/mesh/docs/handlers/grpc Install the gRPC handler package using npm. ```bash npm i @graphql-mesh/grpc ``` -------------------------------- ### Install File Cache (pnpm) Source: https://the-guild.dev/graphql/mesh/docs/cache/file Install the file cache strategy using pnpm. ```bash pnpm add @graphql-mesh/cache-file ``` -------------------------------- ### Install Type Merging Transform (bun) Source: https://the-guild.dev/graphql/mesh/docs/transforms/type-merging Install the Type Merging transform using bun. ```bash bun add @graphql-mesh/transform-type-merging ``` -------------------------------- ### Install Rate Limit Plugin Source: https://the-guild.dev/graphql/mesh/docs/plugins/rate-limit Install the rate limit plugin using your preferred package manager. ```bash npm i @graphql-mesh/plugin-rate-limit ``` ```bash pnpm add @graphql-mesh/plugin-rate-limit ``` ```bash yarn add @graphql-mesh/plugin-rate-limit ``` ```bash bun add @graphql-mesh/plugin-rate-limit ``` -------------------------------- ### Install CLI and OpenAPI Packages for yarn Source: https://the-guild.dev/graphql/mesh/docs/guides/hive Install @graphql-mesh/cli, @graphql-mesh/openapi, and graphql packages using yarn. ```bash yarn add @graphql-mesh/cli @graphql-mesh/openapi graphql ``` -------------------------------- ### Install MySQL Handler Source: https://the-guild.dev/graphql/mesh/docs/handlers/mysql Install the MySQL handler library using npm, pnpm, yarn, or bun. ```bash npm i @graphql-mesh/mysql ``` ```bash pnpm add @graphql-mesh/mysql ``` ```bash yarn add @graphql-mesh/mysql ``` ```bash bun add @graphql-mesh/mysql ``` -------------------------------- ### Install maxTokens Plugin with pnpm Source: https://the-guild.dev/graphql/mesh/docs/plugins/max-tokens Install the maxTokens plugin using pnpm. ```bash pnpm add @escape.tech/graphql-armor-max-tokens ``` -------------------------------- ### Install Federation Plugin Source: https://the-guild.dev/graphql/mesh/docs/handlers/postgraphile Install the Federation plugin for PostGraphile using npm, pnpm, yarn, or bun. ```bash npm i @graphile/federation ``` ```bash pnpm add @graphile/federation ``` ```bash yarn add @graphile/federation ``` ```bash bun add @graphile/federation ``` -------------------------------- ### Start the Mesh Gateway Source: https://the-guild.dev/graphql/mesh/docs/guides/combine-many-sources Run this command to start the GraphQL Mesh gateway after configuring multiple sources. ```bash yarn start-multiple-sources ``` -------------------------------- ### Install Deduplicate Request Plugin with yarn Source: https://the-guild.dev/graphql/mesh/docs/plugins/deduplicate-request Install the plugin using yarn. ```bash yarn add @graphql-mesh/plugin-deduplicate-request ``` -------------------------------- ### Install Deduplicate Request Plugin with pnpm Source: https://the-guild.dev/graphql/mesh/docs/plugins/deduplicate-request Install the plugin using pnpm. ```bash pnpm add @graphql-mesh/plugin-deduplicate-request ``` -------------------------------- ### Install Deduplicate Request Plugin with npm Source: https://the-guild.dev/graphql/mesh/docs/plugins/deduplicate-request Install the plugin using npm. ```bash npm i @graphql-mesh/plugin-deduplicate-request ``` -------------------------------- ### Install Hive Plugin for yarn Source: https://the-guild.dev/graphql/mesh/docs/guides/hive Install the @graphql-mesh/plugin-hive package using yarn. ```bash yarn add @graphql-mesh/plugin-hive ``` -------------------------------- ### Install Hive Plugin for pnpm Source: https://the-guild.dev/graphql/mesh/docs/guides/hive Install the @graphql-mesh/plugin-hive package using pnpm. ```bash pnpm add @graphql-mesh/plugin-hive ``` -------------------------------- ### Install Supergraph Package for pnpm Source: https://the-guild.dev/graphql/mesh/docs/guides/hive Install the @graphql-mesh/supergraph package using pnpm. ```bash pnpm add @graphql-mesh/supergraph ``` -------------------------------- ### Install Block Field Suggestions Plugin with bun Source: https://the-guild.dev/graphql/mesh/docs/plugins/block-field-suggestions Install the plugin using bun. This is the first step in configuring the plugin. ```bash bun add @escape.tech/graphql-armor-block-field-suggestions ``` -------------------------------- ### Install Mesh CLI with bun Source: https://the-guild.dev/graphql/mesh/docs/getting-started/installation Installs the core Mesh CLI package and the graphql dependency using bun. ```bash bun add @graphql-mesh/cli graphql ``` -------------------------------- ### Install Supergraph Package for npm Source: https://the-guild.dev/graphql/mesh/docs/guides/hive Install the @graphql-mesh/supergraph package using npm. ```bash npm i @graphql-mesh/supergraph ``` -------------------------------- ### Install Tuql Handler with bun Source: https://the-guild.dev/graphql/mesh/docs/handlers/tuql Install the Tuql handler library using bun. This is the first step to integrate SQLite databases with GraphQL Mesh. ```bash bun add @graphql-mesh/tuql ``` -------------------------------- ### Install Tuql Handler with npm Source: https://the-guild.dev/graphql/mesh/docs/handlers/tuql Install the Tuql handler library using npm. This is the first step to integrate SQLite databases with GraphQL Mesh. ```bash npm i @graphql-mesh/tuql ``` -------------------------------- ### Install Snapshot Plugin with bun Source: https://the-guild.dev/graphql/mesh/docs/plugins/snapshot Install the snapshot plugin using bun. This command adds the necessary package to your project's dependencies. ```bash bun add @graphql-mesh/plugin-snapshot ``` -------------------------------- ### Install Mongoose Handler with yarn Source: https://the-guild.dev/graphql/mesh/docs/handlers/mongoose Install the Mongoose handler package using yarn. ```bash yarn add @graphql-mesh/mongoose ``` -------------------------------- ### Install Mongoose Handler with pnpm Source: https://the-guild.dev/graphql/mesh/docs/handlers/mongoose Install the Mongoose handler package using pnpm. ```bash pnpm add @graphql-mesh/mongoose ``` -------------------------------- ### Install OData Handler with bun Source: https://the-guild.dev/graphql/mesh/docs/handlers/odata Install the OData handler library using bun. This is the first step to integrate OData services with GraphQL Mesh. ```bash bun add @graphql-mesh/odata ``` -------------------------------- ### Install PostGraphile Handler Source: https://the-guild.dev/graphql/mesh/docs/handlers/postgraphile Install the PostGraphile handler library using npm, pnpm, yarn, or bun. ```bash npm i @graphql-mesh/postgraphile ``` ```bash pnpm add @graphql-mesh/postgraphile ``` ```bash yarn add @graphql-mesh/postgraphile ``` ```bash bun add @graphql-mesh/postgraphile ``` -------------------------------- ### Install Prefix Transform with yarn Source: https://the-guild.dev/graphql/mesh/docs/transforms/prefix Install the prefix transform package using yarn. ```bash yarn add @graphql-mesh/transform-prefix ``` -------------------------------- ### Install Apache Thrift Handler Source: https://the-guild.dev/graphql/mesh/docs/handlers/thrift Install the Apache Thrift handler library using npm, pnpm, yarn, or bun. ```bash npm i @graphql-mesh/thrift ``` ```bash pnpm add @graphql-mesh/thrift ``` ```bash yarn add @graphql-mesh/thrift ``` ```bash bun add @graphql-mesh/thrift ``` -------------------------------- ### Install Prefix Transform with pnpm Source: https://the-guild.dev/graphql/mesh/docs/transforms/prefix Install the prefix transform package using pnpm. ```bash pnpm add @graphql-mesh/transform-prefix ``` -------------------------------- ### Install Prefix Transform with npm Source: https://the-guild.dev/graphql/mesh/docs/transforms/prefix Install the prefix transform package using npm. ```bash npm i @graphql-mesh/transform-prefix ``` -------------------------------- ### Install Max Depth Plugin with yarn Source: https://the-guild.dev/graphql/mesh/docs/plugins/max-depth Install the `graphql-armor-max-depth` plugin using yarn. ```bash yarn add @escape.tech/graphql-armor-max-depth ``` -------------------------------- ### Install Max Depth Plugin with pnpm Source: https://the-guild.dev/graphql/mesh/docs/plugins/max-depth Install the `graphql-armor-max-depth` plugin using pnpm. ```bash pnpm add @escape.tech/graphql-armor-max-depth ``` -------------------------------- ### Install Max Depth Plugin with npm Source: https://the-guild.dev/graphql/mesh/docs/plugins/max-depth Install the `graphql-armor-max-depth` plugin using npm. ```bash npm i @escape.tech/graphql-armor-max-depth ``` -------------------------------- ### Install OData Handler with npm Source: https://the-guild.dev/graphql/mesh/docs/handlers/odata Install the OData handler library using npm. This is the first step to integrate OData services with GraphQL Mesh. ```bash npm i @graphql-mesh/odata ``` -------------------------------- ### Install Neo4j Handler with bun Source: https://the-guild.dev/graphql/mesh/docs/handlers/neo4j Install the Neo4j handler library using bun. This command is suitable for users who prefer the bun runtime. ```bash bun add @graphql-mesh/neo4j ``` -------------------------------- ### Install New Relic Plugin with bun Source: https://the-guild.dev/graphql/mesh/docs/plugins/new-relic Install the New Relic plugin and the New Relic agent using bun. ```bash bun add @graphql-mesh/plugin-newrelic newrelic ``` -------------------------------- ### Install GraphQL Handler (pnpm) Source: https://the-guild.dev/graphql/mesh/docs/handlers/graphql Install the GraphQL handler package using pnpm. ```bash pnpm add @graphql-mesh/graphql ``` -------------------------------- ### Install Block Field Suggestions Plugin with npm Source: https://the-guild.dev/graphql/mesh/docs/plugins/block-field-suggestions Install the plugin using npm. This is the first step in configuring the plugin. ```bash npm i @escape.tech/graphql-armor-block-field-suggestions ```