{"id":23398422,"url":"https://github.com/apollo-elements/rollup-plugin-graphql","last_synced_at":"2025-04-08T19:36:46.260Z","repository":{"id":57098237,"uuid":"297903673","full_name":"apollo-elements/rollup-plugin-graphql","owner":"apollo-elements","description":"Import GraphQL Documents in your Modules","archived":false,"fork":false,"pushed_at":"2021-10-11T11:37:18.000Z","size":160,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-05-21T07:27:59.584Z","etag":null,"topics":["graphql","hacktoberfest","optimization","performance","rollup","rollup-plugin-graphql"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/apollo-elements.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-09-23T08:28:26.000Z","updated_at":"2020-10-03T18:54:33.000Z","dependencies_parsed_at":"2022-08-20T16:50:57.293Z","dependency_job_id":null,"html_url":"https://github.com/apollo-elements/rollup-plugin-graphql","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apollo-elements%2Frollup-plugin-graphql","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apollo-elements%2Frollup-plugin-graphql/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apollo-elements%2Frollup-plugin-graphql/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apollo-elements%2Frollup-plugin-graphql/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/apollo-elements","download_url":"https://codeload.github.com/apollo-elements/rollup-plugin-graphql/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247208457,"owners_count":20901570,"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":["graphql","hacktoberfest","optimization","performance","rollup","rollup-plugin-graphql"],"created_at":"2024-12-22T09:46:25.640Z","updated_at":"2025-04-08T19:36:46.239Z","avatar_url":"https://github.com/apollo-elements.png","language":"TypeScript","readme":"# @apollo-elements/rollup-plugin-graphql\n\n[![Actions Status](https://github.com/apollo-elements/rollup-plugin-graphql/workflows/main/badge.svg)](https://github.com/apollo-elements/rollup-plugin-graphql/actions)\n[![npm](https://img.shields.io/npm/v/@apollo-elements/rollup-plugin-graphql)](https://npm.im/@apollo-elements/rollup-plugin-graphql)\n\nImport GraphQL Documents in your Modules.\n\n```ts\nimport { ApolloQuery, html } from '@apollo-elements/lit-apollo';\nimport LaunchesQuery from './Launches.query.graphql';\n\nimport { LaunchesQueryData as Data, LaunchesQueryVariables as Variables } from '../codegen';\n\nclass LaunchesElement extends ApolloQuery\u003cData, Variables\u003e {\n  query = LaunchesQuery;\n\n  formatter = new Intl.ListFormat('en', { style: 'long', type: 'conjunction' });\n\n  render() {\n    const names =\n      (this.data?.launches ?? []).map(x =\u003e x.mission_name);\n\n    return html`\n      \u003cp ?hidden=\"${this.loading}\"\u003e\n        ${this.formatter.format(names)} recently launched!!\n      \u003c/p\u003e\n    `\n  }\n}\n```\n\n## Installation\n\n```bash\nnpm i -D @apollo-elements/rollup-plugin-graphql\n```\n\n```bash\nyarn add -D @apollo-elements/rollup-plugin-graphql\n```\n\n## Usage with Rollup\n\n```js\nimport { rollup } from 'rollup';\nimport graphql from '@apollo-elements/rollup-plugin-graphql';\n\nexport default {\n  input: 'main.js',\n  plugins: [\n    graphql()\n  ]\n}\n```\n\n## Usage with `@web/dev-server`\n\n```js\nimport { fromRollup } from '@web/dev-server-rollup';\nimport graphqlRollup from '@apollo-elements/rollup-plugin-graphql';\n\nconst graphql = fromRollup(graphqlRollup);\n\nexport default {\n  mimeTypes: {\n    '**/*.graphql': 'js;\n  },\n  plugins: [\n    graphql()\n  ]\n}\n```\n\n## Acknowledgements\n\nThis is based on the excellent [`graphql-mini-transforms`](https://github.com/Shopify/graphql-tools-web/tree/main/packages/graphql-mini-transforms) from Shopify. Prior art in `rollup-plugin-graphl` by Kamil Kisiela.\n\n## Why?\n\nThis plugin reduces bundle sizes by exporting simple `JSON.parse`-d objects.\n\nSee https://github.com/apollographql/graphql-tag/issues/249\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapollo-elements%2Frollup-plugin-graphql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fapollo-elements%2Frollup-plugin-graphql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapollo-elements%2Frollup-plugin-graphql/lists"}