
Security News
Crates.io Implements Trusted Publishing Support
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
@sdl-codegen/node
Advanced tools
GraphQL .d.ts file generation for SDL-first projects
This project is for creating the .d.ts
files for codebases where you have SDL like:
export const schema = gql`
type Game {
id: ID!
homeTeamID: Int!
awayTeamID: Int!
homeTeamScore: Int!
awayTeamScore: Int!
}
type Query {
games: [Game!]! @skipAuth
upcomingGames: [Game!]! @skipAuth
game(id: ID!): Game @requireAuth
}
`
Then separately, you write functions like:
export const games = () => db.game.findMany({ orderBy: { startDateTime: "asc" } })
export const upcomingGames = () => db.game.findMany({ isCompleted: false, startDateTime: { gt: new Date() } })
export const game = ({ id }) => db.game.findUnique({ where: { id } })
This repo will create .d.ts
files which very accurately, and very concisely represent the runtime for these functions. It's goal is to take all of the possible logic which might happen in the TypeScript type system, and pre-bake that into the output of the .d.ts files.
You could think of it as a smaller, more singular focused version of the mature and well-featured graphql-codgen.
This repo provides the APIs for building a codegen for framework authors or confident tool builders, and the goal is not to provide a CLI for a generalized use-case.
This app is architected as a pipeline of sorts. Here's the rough stages:
It's still a bit of a work in progress to have these discrete steps, but it's getting there.
See .github/CONTRIBUTING.md
, then .github/DEVELOPMENT.md
.
Thanks!
Make a commit like: git commit --allow-empty -m "feat: Prepare for release"
FAQs
GraphQL .d.ts file generation for SDL-first projects
We found that @sdl-codegen/node demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
Research
/Security News
Undocumented protestware found in 28 npm packages disrupts UI for Russian-language users visiting Russian and Belarusian domains.
Research
/Security News
North Korean threat actors deploy 67 malicious npm packages using the newly discovered XORIndex malware loader.