Security News
Python Overtakes JavaScript as Top Programming Language on GitHub
Python becomes GitHub's top language in 2024, driven by AI and data science projects, while AI-powered security tools are gaining adoption.
@graphql-codegen/typescript-operations
Advanced tools
GraphQL Code Generator plugin for generating TypeScript types for GraphQL queries, mutations, subscriptions and fragments
The @graphql-codegen/typescript-operations package is a plugin for GraphQL Code Generator that generates TypeScript typings for GraphQL operations (queries, mutations, and subscriptions). It helps in creating type-safe and easy-to-use TypeScript types based on your GraphQL schema and operations, enhancing development efficiency and reducing runtime errors.
Type generation for queries
Generates TypeScript interfaces for the 'GetUsers' query, allowing for type-safe usage of query results.
query GetUsers {
users {
id
name
}
}
Type generation for mutations
Generates TypeScript types for the 'CreateUser' mutation, including the mutation function and its parameters, facilitating type-safe API interactions.
mutation CreateUser($input: CreateUserInput!) {
createUser(input: $input) {
id
name
}
}
Type generation for subscriptions
Generates TypeScript types for the 'OnUserCreated' subscription, enabling type-safe real-time data handling.
subscription OnUserCreated {
userCreated {
id
name
}
}
Similar to @graphql-codegen/typescript-operations, this package generates TypeScript types for your GraphQL schema. However, it focuses more on the schema side rather than operations, making it complementary rather than a direct alternative.
While not a code generation tool, Apollo Client is a comprehensive state management library for JavaScript that fully supports GraphQL. It can be used alongside @graphql-codegen/typescript-operations for a powerful, type-safe GraphQL client experience.
FAQs
GraphQL Code Generator plugin for generating TypeScript types for GraphQL queries, mutations, subscriptions and fragments
The npm package @graphql-codegen/typescript-operations receives a total of 1,805,659 weekly downloads. As such, @graphql-codegen/typescript-operations popularity was classified as popular.
We found that @graphql-codegen/typescript-operations demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 4 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
Python becomes GitHub's top language in 2024, driven by AI and data science projects, while AI-powered security tools are gaining adoption.
Security News
Dutch National Police and FBI dismantle Redline and Meta infostealer malware-as-a-service operations in Operation Magnus, seizing servers and source code.
Research
Security News
Socket is tracking a new trend where malicious actors are now exploiting the popularity of LLM research to spread malware through seemingly useful open source packages.