Open mle-moni opened 2 years ago
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 :
query getMissionQuery(
$id: MissionId!
) @generateCRUD {
EU {
findOne {
Mission(id: $id) {
SOME_FIELD
SOME_OTHER_FIELD
}
}
}
}
we would generate the functions: createMission
, readMission
, updateMission
and deleteMission
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