Security News
Introducing the Socket Python SDK
The initial version of the Socket Python SDK is now on PyPI, enabling developers to more easily interact with the Socket REST API in Python projects.
@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 2,389,279 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 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
The initial version of the Socket Python SDK is now on PyPI, enabling developers to more easily interact with the Socket REST API in Python projects.
Security News
Floating dependency ranges in npm can introduce instability and security risks into your project by allowing unverified or incompatible versions to be installed automatically, leading to unpredictable behavior and potential conflicts.
Security News
A new Rust RFC proposes "Trusted Publishing" for Crates.io, introducing short-lived access tokens via OIDC to improve security and reduce risks associated with long-lived API tokens.