A tool for generating code based on a GraphQL schema and GraphQL operations (query/mutation/subscription), with flexible support for custom plugins.
Installations
npm install graphql-codegen-core
Releases
November 22, 2024
Published on 22 Nov 2024
October 28, 2024
Published on 28 Oct 2024
October 07, 2024
Published on 07 Oct 2024
July 28, 2024
Published on 28 Jul 2024
July 02, 2024
Published on 02 Jul 2024
June 30, 2024
Published on 30 Jun 2024
Developer
Developer Guide
Module System
CommonJS
Min. Node Version
Typescript Support
No
Node Version
NPM Version
Statistics
10,865 Stars
8,329 Commits
1,334 Forks
77 Watching
84 Branches
543 Contributors
Updated on 27 Nov 2024
Languages
TypeScript (83.43%)
MDX (14.86%)
JavaScript (1.23%)
Rust (0.48%)
Total Downloads
Cumulative downloads
Total Downloads
16,099,868
Last day
9.7%
4,896
Compared to previous day
Last week
22.5%
28,834
Compared to previous week
Last month
14.4%
102,118
Compared to previous month
Last year
8.9%
1,033,271
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Peer Dependencies
1
https://the-guild.dev/graphql/codegen
GraphQL Code Generator is a tool that generates code out of your GraphQL schema. Whether you are developing a frontend or backend, you can utilize GraphQL Code Generator to generate output from your GraphQL Schema and GraphQL Documents (query/mutation/subscription/fragment).
By analyzing the schema and documents and parsing it, GraphQL Code Generator can output code at a wide variety of formats, based on pre-defined templates or based on custom user-defined ones. Regardless of the language that you're using, GraphQL Code Generator has you covered.
GraphQL Code Generator lets you choose the output that you need, based on plugins, which are very flexible and customizable. You can also write your plugins to generate custom outputs that match your needs.
You can try this tool live on your browser and see some useful examples. Check out GraphQL Code Generator Live Examples.
We currently support and maintain these plugins (TypeScript, Flow, React, Angular, MongoDB, Stencil, Reason, and some more), and there is an active community that writes and maintains custom plugins.
Quick Start
You can find the complete instructions in GraphQL Code Generator website.
Start by installing the basic deps of GraphQL Codegen:
1yarn add graphql 2yarn add -D @graphql-codegen/cli
GraphQL Code Generator lets you setup everything by simply running the following command:
1yarn graphql-codegen init
Question by question, it will guide you through the whole process of setting up a schema, selecting plugins, picking a destination of a generated file, and a lot more.
If you wish to manually setup codegen, follow these instructions.
Links
Besides our docs page, feel free to go through our published Medium articles to get a better grasp of what GraphQL Code Generator is all about:
Contributing
If this is your first time contributing to this project, please do read our Contributor Workflow Guide before you get started off.
Feel free to open issues and pull requests. We're always welcome support from the community.
For a contribution guide specific to this project, please refer to: http://the-guild.dev/graphql/codegen/docs/custom-codegen/contributing.
Code of Conduct
Help us keep GraphQL Code Generator open and inclusive. Please read and follow our Code of Conduct as adopted from Contributor Covenant
License
MIT
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
22 commit(s) and 12 issue activity found in the last 90 days -- score normalized to 10
Reason
no binaries found in the repo
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: MIT License: LICENSE:0
Reason
Found 17/24 approved changesets -- score normalized to 7
Reason
dependency not pinned by hash detected -- score normalized to 1
Details
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:63: update your workflow using https://app.stepsecurity.io/secureworkflow/dotansimha/graphql-code-generator/main.yml/master?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/main.yml:65: update your workflow using https://app.stepsecurity.io/secureworkflow/dotansimha/graphql-code-generator/main.yml/master?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/main.yml:68: update your workflow using https://app.stepsecurity.io/secureworkflow/dotansimha/graphql-code-generator/main.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:96: update your workflow using https://app.stepsecurity.io/secureworkflow/dotansimha/graphql-code-generator/main.yml/master?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/main.yml:98: update your workflow using https://app.stepsecurity.io/secureworkflow/dotansimha/graphql-code-generator/main.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:125: update your workflow using https://app.stepsecurity.io/secureworkflow/dotansimha/graphql-code-generator/main.yml/master?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/main.yml:127: update your workflow using https://app.stepsecurity.io/secureworkflow/dotansimha/graphql-code-generator/main.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:135: update your workflow using https://app.stepsecurity.io/secureworkflow/dotansimha/graphql-code-generator/main.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:151: update your workflow using https://app.stepsecurity.io/secureworkflow/dotansimha/graphql-code-generator/main.yml/master?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/main.yml:152: update your workflow using https://app.stepsecurity.io/secureworkflow/dotansimha/graphql-code-generator/main.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:28: update your workflow using https://app.stepsecurity.io/secureworkflow/dotansimha/graphql-code-generator/main.yml/master?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/main.yml:30: update your workflow using https://app.stepsecurity.io/secureworkflow/dotansimha/graphql-code-generator/main.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:45: update your workflow using https://app.stepsecurity.io/secureworkflow/dotansimha/graphql-code-generator/main.yml/master?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/main.yml:47: update your workflow using https://app.stepsecurity.io/secureworkflow/dotansimha/graphql-code-generator/main.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/rust.yml:9: update your workflow using https://app.stepsecurity.io/secureworkflow/dotansimha/graphql-code-generator/rust.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/rust.yml:11: update your workflow using https://app.stepsecurity.io/secureworkflow/dotansimha/graphql-code-generator/rust.yml/master?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/rust.yml:15: update your workflow using https://app.stepsecurity.io/secureworkflow/dotansimha/graphql-code-generator/rust.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/website-integrity.yml:11: update your workflow using https://app.stepsecurity.io/secureworkflow/dotansimha/graphql-code-generator/website-integrity.yml/master?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/website-integrity.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/dotansimha/graphql-code-generator/website-integrity.yml/master?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/website-integrity.yml:42: update your workflow using https://app.stepsecurity.io/secureworkflow/dotansimha/graphql-code-generator/website-integrity.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/website.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/dotansimha/graphql-code-generator/website.yml/master?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/website.yml:21: update your workflow using https://app.stepsecurity.io/secureworkflow/dotansimha/graphql-code-generator/website.yml/master?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/website.yml:27: update your workflow using https://app.stepsecurity.io/secureworkflow/dotansimha/graphql-code-generator/website.yml/master?enable=pin
- Info: 0 out of 11 GitHub-owned GitHubAction dependencies pinned
- Info: 2 out of 14 third-party GitHubAction dependencies pinned
Reason
detected GitHub workflow tokens with excessive permissions
Details
- Warn: no topLevel permission defined: .github/workflows/main.yml:1
- Warn: no topLevel permission defined: .github/workflows/pr.yml:1
- Warn: no topLevel permission defined: .github/workflows/release.yml:1
- Warn: no topLevel permission defined: .github/workflows/rust.yml:1
- Warn: no topLevel permission defined: .github/workflows/website-integrity.yml:1
- Warn: no topLevel permission defined: .github/workflows/website.yml:1
- Info: no jobLevel write permissions found
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'master'
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 28 are checked with a SAST tool
Reason
31 existing vulnerabilities detected
Details
- Warn: Project is vulnerable to: RUSTSEC-2021-0139
- Warn: Project is vulnerable to: RUSTSEC-2021-0145 / GHSA-g98v-hv3f-hcfr
- Warn: Project is vulnerable to: RUSTSEC-2024-0375
- Warn: Project is vulnerable to: RUSTSEC-2020-0095
- Warn: Project is vulnerable to: RUSTSEC-2024-0384
- Warn: Project is vulnerable to: RUSTSEC-2023-0055 / GHSA-c2hm-mjxv-89r4
- Warn: Project is vulnerable to: GHSA-2326-pfpj-vx3h
- Warn: Project is vulnerable to: RUSTSEC-2023-0086
- Warn: Project is vulnerable to: RUSTSEC-2024-0370
- Warn: Project is vulnerable to: GHSA-c827-hfw6-qwvm
- Warn: Project is vulnerable to: GHSA-8hc4-vh64-cxmj
- Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275
- Warn: Project is vulnerable to: GHSA-f6v4-cf5j-vf3w
- Warn: Project is vulnerable to: GHSA-jchw-25xp-jwwc
- Warn: Project is vulnerable to: GHSA-cxjh-pqwp-8mfp
- Warn: Project is vulnerable to: GHSA-3wc5-fcw2-2329
- Warn: Project is vulnerable to: GHSA-64fm-8hw2-v72w
- Warn: Project is vulnerable to: GHSA-cvr6-37gx-v8wc
- Warn: Project is vulnerable to: GHSA-f98w-7cxr-ff2h
- Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv
- Warn: Project is vulnerable to: GHSA-c59h-r6p8-q9wc
- Warn: Project is vulnerable to: GHSA-fq54-2j52-jc42
- Warn: Project is vulnerable to: GHSA-g77x-44xx-532m
- Warn: Project is vulnerable to: GHSA-gp8f-8m3g-qvj9
- Warn: Project is vulnerable to: GHSA-9wv6-86v2-598j
- Warn: Project is vulnerable to: GHSA-7fh5-64p2-3v2j
- Warn: Project is vulnerable to: GHSA-gcx4-mw62-g8wm
- Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw
- Warn: Project is vulnerable to: GHSA-64vr-g452-qvp3
- Warn: Project is vulnerable to: GHSA-9cwx-2883-4wfx
- Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q
Score
4.2
/10
Last Scanned on 2024-11-25
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn MoreOther packages similar to graphql-codegen-core
@graphql-codegen/core
<p align="center"> <img src="https://github.com/dotansimha/graphql-code-generator/blob/master/logo.png?raw=true" /> </p>
@graphql-codegen/cli
<p align="center"> <img src="https://github.com/dotansimha/graphql-code-generator/blob/master/logo.png?raw=true" /> </p>
graphql-tool-utilities
Common utilities for GraphQL developer tools
@linear/sdk
The Linear Client SDK for interacting with the Linear GraphQL API