{"id":17672,"library":"graphql-cli-prepare","title":"GraphQL CLI Prepare Plugin","description":"graphql-cli-prepare is a plugin for the original `graphql-cli` command-line interface, designed to automate GraphQL schema bundling and binding generation. It leverages `graphql-import` to process `import` statements within GraphQL schemas, allowing for modular schema definitions. Additionally, it integrates with `graphql-static-binding` to generate type-safe bindings for use with older `graphql-yoga` and `graphcool-binding` setups, facilitating GraphQL query and mutation delegation in resolvers. The package's latest stable version is 1.4.19, last published in March 2018. Due to the rapid evolution of the GraphQL ecosystem and the explicit deprecation of `graphql-cli` itself in favor of `graphql-config` and `GraphQL Code Generator CLI`, this plugin is no longer actively maintained. It primarily functions by extending the `graphql-cli` with a `prepare` command and stores its configuration within `.graphqlconfig` files, an older configuration format.","status":"abandoned","version":"1.4.19","language":"javascript","source_language":"en","source_url":"https://github.com/graphql-cli/graphql-cli-prepare","tags":["javascript","graphql","graphql-cli","typescript"],"install":[{"cmd":"npm install graphql-cli-prepare","lang":"bash","label":"npm"},{"cmd":"yarn add graphql-cli-prepare","lang":"bash","label":"yarn"},{"cmd":"pnpm add graphql-cli-prepare","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"This package is a plugin for graphql-cli, which is required for its functionality.","package":"graphql-cli","optional":false},{"reason":"Used internally by graphql-cli-prepare for schema bundling and processing 'import' statements in GraphQL schemas.","package":"graphql-import","optional":false},{"reason":"Used internally by graphql-cli-prepare for generating type-safe bindings from GraphQL schemas.","package":"graphql-static-binding","optional":false},{"reason":"Used for configuration storage in .graphqlconfig files. The package itself is deprecated in favor of .graphqlrc.yml by newer GraphQL CLI versions.","package":"graphql-config","optional":false}],"imports":[],"quickstart":{"code":"npm install -g graphql-cli graphql-cli-prepare\n\n# Assuming you have a .graphqlconfig file set up for your project\n# and schema files with 'import' statements, e.g., in a 'schema' directory.\n# Example .graphqlconfig content (old format):\n# projects:\n#   app:\n#     schema: ./schema/app.graphql\n#     extensions:\n#       prepare:\n#         output: src/generated\n#         bundle: true\n#         bindings: false\n#   database:\n#     schema: ./schema/database.graphql\n#     extensions:\n#       prepare:\n#         output: src/generated\n#         bundle: false\n#         bindings: true\n#         generator: graphcool-ts\n\n# First-time setup for schema bundling, saving config\ngraphql prepare -p app -o src/generated --bundle --save\n\n# First-time setup for binding generation, saving config\ngraphql prepare -p database -o src/generated -g graphcool-ts --bindings --save\n\n# After initial setup, run without parameters to process all configured projects\ngraphql prepare\n\n# Output example:\n# √ Bundled schema for project app written to src/generated/app.graphql\n# √ Bindings for project database written to src/generated/database.ts","lang":"bash","description":"Demonstrates the installation and primary CLI usage for schema bundling and binding generation, including initial configuration and automated runs."},"warnings":[{"fix":"Migrate to `graphql-config` for project configuration and use `@graphql-codegen/cli` with relevant plugins (e.g., `@graphql-codegen/schema-ast`, `@graphql-codegen/typescript`) for schema bundling and code generation. `graphql-config` has a migration tool for old `.graphqlconfig` files.","message":"The core `graphql-cli` tool, which this plugin extends, has been deprecated and its `prepare` command removed in `graphql-cli` versions 4.x and higher. Modern GraphQL tooling, particularly `GraphQL Code Generator CLI` and `@graphql-tools`, offers a more robust and actively maintained approach for schema bundling and code generation.","severity":"breaking","affected_versions":">=1.0.0 (when used with graphql-cli >=4.x)"},{"fix":"Adopt modern GraphQL schema composition techniques, such as `@graphql-tools/load` and `@graphql-tools/merge`, or use federated GraphQL approaches (e.g., Apollo Federation) for complex schema architectures.","message":"The underlying `graphql-import` library used by this plugin for schema bundling is considered deprecated. Its functionality is often superseded by native GraphQL schema stitching capabilities or other tools that handle schema composition more effectively.","severity":"deprecated","affected_versions":">=1.0.0"},{"fix":"For type-safe clients and resolvers, consider using `GraphQL Code Generator` with plugins like `typescript-operations`, `typescript-resolvers`, or `typescript-graphql-request`. For client-side bindings, explore modern GraphQL clients like Apollo Client or Relay.","message":"The `graphql-static-binding` and `graphcool-binding` libraries, used for generating bindings, are outdated. The `graphql-yoga` framework, for which these bindings were generated, has also evolved significantly since this plugin's last release.","severity":"deprecated","affected_versions":">=1.0.0"},{"fix":"If migrating an older project, manually convert your `.graphqlconfig` to `.graphqlrc.yml` following the `graphql-config` migration guide or use the provided migration tool.","message":"This plugin relies on the `.graphqlconfig` file format for its configuration. Newer versions of GraphQL CLI and `graphql-config` utilize `.graphqlrc.yml` or similar modern formats, which are incompatible with the configurations saved by this plugin.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-23T00:00:00.000Z","next_check":"2026-07-22T00:00:00.000Z","problems":[{"fix":"Ensure you are using `graphql-cli` version 3.x or below, as the `prepare` command was removed in version 4.x. If using a newer `graphql-cli`, migrate to `@graphql-codegen/cli`. If using an older `graphql-cli`, ensure `graphql-cli-prepare` is globally or locally installed alongside it.","cause":"The `graphql-cli` installation is either too old, too new, or the plugin `graphql-cli-prepare` is not correctly installed or recognized.","error":"`graphql prepare` is not a valid command."},{"fix":"Install `graphql-import` explicitly: `npm install graphql-import` or `yarn add graphql-import`.","cause":"The `graphql-import` dependency, used internally by `graphql-cli-prepare`, is missing or not resolvable in your project.","error":"Error: Cannot find module 'graphql-import'"},{"fix":"Review your `.graphqlconfig` file for correct schema paths. Inspect your `.graphql` schema files for syntax errors or malformed `import` statements. Ensure all imported schemas are valid and accessible.","cause":"This error typically indicates an issue with the GraphQL schema files being bundled, such as incorrect syntax, missing type definitions, or problems with the `import` statements not resolving correctly.","error":"Error: Must provide name. You must provide a name for a GraphQL type, query or mutation."}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}