Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@graphql-codegen/import-types-preset

Package Overview
Dependencies
Maintainers
4
Versions
2997
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@graphql-codegen/import-types-preset

GraphQL Code Generator preset for importing types to operation file

  • 3.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
4
Created

What is @graphql-codegen/import-types-preset?

@graphql-codegen/import-types-preset is a preset for GraphQL Code Generator that allows you to import types from other files. This is particularly useful when you want to share types across different parts of your application or when you want to keep your type definitions organized in separate files.

What are @graphql-codegen/import-types-preset's main functionalities?

Importing Types from Other Files

This feature allows you to import types from a specified path. In this example, types are imported from the '../types' directory.

```json
{
  "generates": {
    "./src/generated-types.ts": {
      "plugins": [
        "typescript",
        "typescript-operations"
      ],
      "preset": "import-types",
      "presetConfig": {
        "typesPath": "../types"
      }
    }
  }
}
```

Customizing Import Paths

This feature allows you to customize the namespace for imported types. In this example, the types are imported under the 'MyTypes' namespace.

```json
{
  "generates": {
    "./src/generated-types.ts": {
      "plugins": [
        "typescript",
        "typescript-operations"
      ],
      "preset": "import-types",
      "presetConfig": {
        "typesPath": "../types",
        "importTypesNamespace": "MyTypes"
      }
    }
  }
}
```

Other packages similar to @graphql-codegen/import-types-preset

FAQs

Package last updated on 25 Sep 2023

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc