You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be nice to be able to add custom transforms like it was possible in v12
in our project we used it to add some code in generated files
// our code is something likeimport{relayCompiler}from'relay-compiler';consttsPluginDefault=require('relay-compiler-language-typescript').default();const{ inputExtensions, outputExtension, findGraphQLTags, typeGenerator }=tsPluginDefault;constlangPlugin={
inputExtensions,
outputExtension,
findGraphQLTags,// in the formatModule we transform the ouput files to add some code specific to the requestformatModule: ourSpecificFormatModule,
typeGenerator,}awaitrelayCompiler({
...moreConfig,language: langPlugin,});
The text was updated successfully, but these errors were encountered:
I agree that it would be nice. The new compiler is implemented in Rust. Some searching led me to https://nullderef.com/blog/plugin-tech/. I'm not sure what the best approach for creating a plugin system for the new compiler might be. Optimizing compiler perf for large scale projects was one of the reasons for the Rust rewrite. We'd also need to think about performance implications and the sort of constrains we'd want for the plugin system.
As far as I'm aware, the relay team has no plans to investigate this space.
What sort of additional information are you looking to add? Maybe there's a simpler way to enable that without a proper plugin system for custom transforms.
We use graphql on the backend and we generate queries with relay-compiler, but for some queries we add some functions, mainly CRUD utils:
e.g. in this query :
It would be nice to be able to add custom transforms like it was possible in v12
in our project we used it to add some code in generated files
The text was updated successfully, but these errors were encountered: