{"id":20519413,"url":"https://github.com/newbeea/nuxt3-graphql-codegen-module","last_synced_at":"2025-10-18T10:13:36.090Z","repository":{"id":44845409,"uuid":"441425894","full_name":"newbeea/nuxt3-graphql-codegen-module","owner":"newbeea","description":null,"archived":false,"fork":false,"pushed_at":"2023-03-20T07:58:10.000Z","size":54,"stargazers_count":3,"open_issues_count":4,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-27T16:11:11.539Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/newbeea.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-12-24T09:38:23.000Z","updated_at":"2024-07-04T07:19:47.000Z","dependencies_parsed_at":"2022-08-28T04:55:07.454Z","dependency_job_id":null,"html_url":"https://github.com/newbeea/nuxt3-graphql-codegen-module","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/newbeea%2Fnuxt3-graphql-codegen-module","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/newbeea%2Fnuxt3-graphql-codegen-module/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/newbeea%2Fnuxt3-graphql-codegen-module/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/newbeea%2Fnuxt3-graphql-codegen-module/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/newbeea","download_url":"https://codeload.github.com/newbeea/nuxt3-graphql-codegen-module/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248809047,"owners_count":21164896,"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":[],"created_at":"2024-11-15T22:13:24.006Z","updated_at":"2025-10-18T10:13:31.050Z","avatar_url":"https://github.com/newbeea.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @nuxt3/graphql-codegen-module\n\nNuxt3 module for graphql code generator\n\n\n## Installation\n\n```bash\nnpm i -D @nuxt3/graphql-codegen-module @graphql-codegen/cli graphql\n```\ninstall graphql code generator plugin like @graphql-codegen/typescript @graphql-codegen/typescript-operations @graphql-codegen/typescript-vue-apollo\n\n## Configuration\n```js\n// nuxt.config.js\nimport '@nuxt3/graphql-codegen-module' // import to remove config warning, not necessary\nexport default {\n  buildModules: [\n    '@nuxt3/graphql-codegen-module'\n  ],\n  graphqlCodegen: {\n  }\n}\n```\n## Demo\n[nuxt3-apollo-starter](https://github.com/newbeea/nuxt3-apollo-starter)\n## Usage\nwrite codegen.yml in root folder\nFor example:\n```\nschema: generated/schema.graphql\ndocuments: graphql/**/*.graphql\ngenerates:\n  generated/schema.d.ts:\n    plugins:\n      - typescript\n  generated/operations.ts:\n    config:\n      documentMode: documentNode\n    plugins:\n      - typescript\n      - typescript-operations\n      - typescript-vue-apollo\n```\nCode will be generated to generated/operations.ts:\n```\n// types\n// operation code\n// like:\n/**\n * __useCountryQuery__\n *\n * To run a query within a Vue component, call `useCountryQuery` and pass it any options that fit your needs.\n * When your component renders, `useCountryQuery` returns an object from Apollo Client that contains result, loading and error properties\n * you can use to render your UI.\n *\n * @param options that will be passed into the query, supported options are listed on: https://v4.apollo.vuejs.org/guide-composable/query.html#options;\n *\n * @example\n * const { result, loading, error } = useCountryQuery();\n */\nexport function useCountryQuery(options: VueApolloComposable.UseQueryOptions\u003cCountryQuery, CountryQueryVariables\u003e | VueCompositionApi.Ref\u003cVueApolloComposable.UseQueryOptions\u003cCountryQuery, CountryQueryVariables\u003e\u003e | ReactiveFunction\u003cVueApolloComposable.UseQueryOptions\u003cCountryQuery, CountryQueryVariables\u003e\u003e = {}) {\n  return VueApolloComposable.useQuery\u003cCountryQuery, CountryQueryVariables\u003e(CountryDocument, {}, options);\n}\nexport type CountryQueryCompositionFunctionResult = VueApolloComposable.UseQueryReturn\u003cCountryQuery, CountryQueryVariables\u003e;\n\n\n```\n\nyou can use it with [@nuxt3/apollo-module](https://github.com/newbeea/nuxt3-apollo-module) like this:\n\n```\nimport { useCountryQuery } from '@/generated/operations'\nconst { result, loading, error } = await useCountryQuery()\n\n```\n\n## Dev\n\n```\npnpm i\n```\n\n```\npnpm run build\n```\n\n\n\n## License\n\nMIT License © 2021-PRESENT [Phil xu](https://github.com/newbeea)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnewbeea%2Fnuxt3-graphql-codegen-module","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnewbeea%2Fnuxt3-graphql-codegen-module","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnewbeea%2Fnuxt3-graphql-codegen-module/lists"}