{"id":47816,"library":"graphql-codegen-add","title":"GraphQL Code Generator Add","description":"A plugin for GraphQL Code Generator that adds custom content to generated output files. It is part of the GraphQL Code Generator ecosystem (v0.18.x, now legacy; replaced by v2+ with `@graphql-codegen/add`). This plugin appends or prepends arbitrary code snippets to generated files, useful for adding imports, utilities, or type extensions. It is often used in conjunction with other plugins to enhance generated TypeScript typings for client and server sides. The package is in maintenance mode; users should migrate to the v2 package (`@graphql-codegen/add`).","status":"maintenance","version":"0.18.2","language":"javascript","source_language":"en","source_url":"git@github.com:dotansimha/graphql-code-generator","tags":["javascript","typescript"],"install":[{"cmd":"npm install graphql-codegen-add","lang":"bash","label":"npm"},{"cmd":"yarn add graphql-codegen-add","lang":"bash","label":"yarn"},{"cmd":"pnpm add graphql-codegen-add","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"The plugin is used via graphql-codegen.yml configuration, not directly imported in application code.","symbol":"default (plugin)","correct":"import AddPlugin from 'graphql-codegen-add';"}],"quickstart":{"code":"// Configure in graphql-codegen.yml\noverwrite: true\nschema: \"http://localhost:4000/graphql\"\ndocuments: \"src/**/*.graphql\"\ngenerates:\n  src/generated/graphql.ts:\n    plugins:\n      - typescript\n      - typescript-operations\n      - graphql-codegen-add:\n          content: \"// THIS IS A GENERATED FILE - DO NOT EDIT\"\n    config:\n      maybeValue: T | undefined","lang":"typescript","description":"Example graphql-codegen.yml configuration showing how to use the add plugin to prepend a comment to generated TypeScript typings."},"warnings":[{"fix":"Replace in package.json: 'graphql-codegen-add' with '@graphql-codegen/add' and update imports/config accordingly.","message":"Package 'graphql-codegen-add' is deprecated. Use '@graphql-codegen/add' instead.","severity":"deprecated","affected_versions":">=0.1.0"},{"fix":"Ensure content is a string in graphql-codegen.yml.","message":"The 'content' option must be passed as a string, not an array or object.","severity":"gotcha","affected_versions":">=0.1.0"}],"env_vars":null,"search_vec":"'/add':38,93 'ad':52 'add':4,12 'append':41 'arbitrari':44 'client':73 'code':2,9,25,45 'codegen':37,92 'conjunct':63 'content':14 'custom':13 'ecosystem':27 'enhanc':68 'extens':57 'file':18,49 'generat':3,10,16,26,48,69 'graphql':1,8,24,36,91 'graphql-codegen':35,90 'import':53 'javascript':94 'legaci':30 'mainten':81 'migrat':85 'mode':82 'often':60 'output':17 'packag':78,89 'part':21 'plugin':6,40,66 'prepend':43 'replac':31 'server':75 'side':76 'snippet':46 'type':56,71 'typescript':70,95 'use':50,61 'user':83 'util':54 'v0.18.x':28 'v2':33,88","created_at":"2026-06-07T16:53:27.702837+00:00","updated_at":"2026-06-07T16:53:27.702837+00:00","problems":[{"fix":"Run: npm install graphql-codegen-add","cause":"Package not installed or misspelled name.","error":"Cannot find module 'graphql-codegen-add'"},{"fix":"Ensure you are using graphql-codegen v0.18.x, or migrate to @graphql-codegen/add for v2+.","cause":"GraphQL Code Generator version mismatch; plugin is for older version.","error":"Plugin graphql-codegen-add not found"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"git@github.com:dotansimha/graphql-code-generator","github":"git@github.com:dotansimha/graphql-code-generator","docs":null,"changelog":null,"pypi":null,"npm":"graphql-codegen-add","openapi_spec":null,"status_page":null,"smithery":null,"categories":["devops"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-07","next_check":"2026-09-05","install_tag":null}}