@gymlib/codegen-swap-directive
TypeScript icon, indicating that this package has built-in type declarations

1.0.5 • Public • Published

What is this?

This graphql-codegen plugin is a wrapper around the existing [typescript](https://www.npmjs.com/package/ @graphql-codegen/typescript) plugin.

How to use?

You need to add the following directive

directive @swap(for: String) on FIELD_DEFINITION

on your SDL definitions.

Then you will have to add the plugin as a replacement for the typescript plugin.

Example

type SomeType {
  field1: SomeOtherType!
  field2: String! @swap(for: "SomeOtherType")
}

The output will look like this:

type SomeOtherType = /*...*/;
type SomeType = {
  field1: SomeOtherType;
  field2: SomeOtherType;
}

Readme

Keywords

none

Package Sidebar

Install

npm i @gymlib/codegen-swap-directive

Weekly Downloads

128

Version

1.0.5

License

MIT

Unpacked Size

8.9 kB

Total Files

7

Last publish

Collaborators

  • gymlib-user