Socket
Socket
Sign inDemoInstall

@graphql-codegen/typescript-operations

Package Overview
Dependencies
198
Maintainers
4
Versions
5658
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @graphql-codegen/typescript-operations

GraphQL Code Generator plugin for generating TypeScript types for GraphQL queries, mutations, subscriptions and fragments


Version published
Weekly downloads
2.7M
decreased by-2.46%
Maintainers
4
Install size
21.3 MB
Created
Weekly downloads
 

Package description

What is @graphql-codegen/typescript-operations?

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.

What are @graphql-codegen/typescript-operations's main functionalities?

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
  }
}

Other packages similar to @graphql-codegen/typescript-operations

FAQs

Last updated on 22 Feb 2024

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc