{"id":17231059,"url":"https://github.com/rishabh3112/graphql-tag-swc-plugin","last_synced_at":"2025-04-14T00:37:50.175Z","repository":{"id":97746354,"uuid":"533178519","full_name":"rishabh3112/graphql-tag-swc-plugin","owner":"rishabh3112","description":"SWC plugin to expand gql template literal during build itself","archived":false,"fork":false,"pushed_at":"2025-03-05T07:24:25.000Z","size":1279,"stargazers_count":17,"open_issues_count":3,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-27T14:52:24.832Z","etag":null,"topics":["gql","graphql","swc","swc-plugin"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/graphql-tag-swc-plugin","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rishabh3112.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-09-06T05:46:05.000Z","updated_at":"2025-03-05T07:24:29.000Z","dependencies_parsed_at":"2024-05-22T08:28:18.748Z","dependency_job_id":"67cbe0f6-769c-434d-8506-3b39b4092a84","html_url":"https://github.com/rishabh3112/graphql-tag-swc-plugin","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rishabh3112%2Fgraphql-tag-swc-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rishabh3112%2Fgraphql-tag-swc-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rishabh3112%2Fgraphql-tag-swc-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rishabh3112%2Fgraphql-tag-swc-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rishabh3112","download_url":"https://codeload.github.com/rishabh3112/graphql-tag-swc-plugin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248803811,"owners_count":21164122,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["gql","graphql","swc","swc-plugin"],"created_at":"2024-10-15T04:54:30.203Z","updated_at":"2025-04-14T00:37:50.154Z","avatar_url":"https://github.com/rishabh3112.png","language":"JavaScript","funding_links":["https://github.com/sponsors/rishabh3112"],"categories":[],"sub_categories":[],"readme":"# graphql-tag-swc-plugin\n\n[![NPM Downloads](https://img.shields.io/npm/d18m/graphql-tag-swc-plugin?style=for-the-badge\u0026logo=npm)](https://www.npmjs.com/package/graphql-tag-swc-plugin)\n![GitHub Repo stars](https://img.shields.io/github/stars/rishabh3112/graphql-tag-swc-plugin?style=for-the-badge\u0026logo=github)\n[![](https://img.shields.io/static/v1?label=Sponsor%20Project\u0026message=%E2%9D%A4\u0026color=%23fe8e86\u0026style=for-the-badge)](https://github.com/sponsors/rishabh3112)\n\n\nSWC plugin alternative to `babel-plugin-graphql-tag`.\n\n\n## Installation\n\n```\nnpm install -D graphql-tag-swc-plugin\n```\n\n## Usage\n\n### SWC\n\nAdd following to swc config (below with default values):\n\n```\njsc: {\n  experimental: {\n    plugins: [\n      [\"graphql-tag-swc-plugin\",\n        {\n          importSources: [\"@apollo/client\", \"graphql-tag\"],\n          gqlTagIdentifiers: [\"gql\"]\n        },\n      ],\n    ],\n  },\n},\n```\n\n### Next js\n\nAdd following to next config (below with default values):\n\n```\nexperimental: {\n  swcPlugins: [\n    [\"graphql-tag-swc-plugin\",\n      {\n        importSources: [\"@apollo/client\", \"graphql-tag\"],\n        gqlTagIdentifiers: [\"gql\"]\n      },\n    ],\n  ],\n},\n```\n\n## Configuration\n\nFollowing props are accepted by plugin currently, inline with babel alternative:\n\n1.  `importSources`:\n    \u003e default: `[\"@apollo/client\", \"graphql-tag\"]`\n\nimport paths from where gql tag is imported for which plugin should compile graphql\n\n2. `gqlTagIdentifiers`:\n   \u003e default: `[\"gql\"]`\n\nIdentifier by which graphql-tag will be imported.\nExample: Here `import { gql } from \"@apollo/client`, `\"gql\"` is the identifier.\n\n3. `strip`:\n   \u003e default: `false`\n\nIf true, it pre-process graphql input to remove redundant (like whitespace and comments) characters by passing it through apollo_parser's lexer. This results in smaller AST in some cases and smaller footprint in bundle size.\n\n## Contribution\n\nAll contributions are welcome!\nFor any bug / feature request please create a Pull request with fixture for the same whenever possible.\n\n### Pre-requisites\n\nHere is list of topics and resources to quickly get you up to contributing!\n\n1. Rust: https://www.rust-lang.org/learn\n\n2. AST and Visitors: https://notairy.vercel.app/note/ast and https://patshaughnessy.net/2022/1/22/visiting-an-abstract-syntax-tree\n\n3. SWC: https://swc.rs/\n\n### Architecture\n\nHere is the basic code walkthrough (updated at v0.1.4)\n![code walkthrough](https://github.com/rishabh3112/graphql-tag-swc-plugin/raw/master/assets/code_walkthrough.png)\n\n## Authors\n\n- @rishabh3112 - Rishabh Chawla\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frishabh3112%2Fgraphql-tag-swc-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frishabh3112%2Fgraphql-tag-swc-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frishabh3112%2Fgraphql-tag-swc-plugin/lists"}