typescript-relay-plugin

v0.1.1
Relay.QL plugin for Typescript

typescript-relay-plugin

A Typescript transformer to find and replace Relay.QL tagged template literals with the output generated by babel-relay-plugin. If your source files are written in Typescript, this can save you a parse and print step through babel and generally having it as a dependency.

Usage

import * as ts from "typescript"
import {getTransformer, loadSchema} from "typescript-relay-plugin"

const filePaths = ["..."]
const schemaPath = "/path/to/schema.json"
const program = ts.createProgram(filePaths, ts.getDefaultCompilerOptions())

program.emit(undefined, undefined, undefined, undefined, {
  before: [
    getTransformer(loadSchema(schemaPath))
  ]
})
npm i typescript-relay-plugin

Metadata

  • MIT
  • Whatever
  • Guntars Asmanis-Graham
  • released 4/23/2017

Downloads

Maintainers