如何在中继13中扩展ts语言插件



在我们的项目中,我们使用relay-compiler和relay-compiler-language-typescript来为生成的查询添加一些代码。

我们想升级到中继13。

如何替换我们使用relay-compiler-language-typescript的部分代码?

import { relayCompiler } from 'relay-compiler';

// how can we replace this
const tsPluginDefault = require('relay-compiler-language-typescript').default();
const { inputExtensions, outputExtension, findGraphQLTags, typeGenerator } = tsPluginDefault;

const specificFormatModule = ourSpecificThings // we add some code to the generated output files 
const langPlugin = {
inputExtensions,
outputExtension,
findGraphQLTags,
formatModule: specificFormatModule,
typeGenerator,
}
await relayCompiler({
...moreConfig,
language: langPlugin,
});

一个中继贡献者在discord上回答我说中继13还不支持添加自定义转换

最新更新