-
Notifications
You must be signed in to change notification settings - Fork 339
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] Added transfer-field transform #3041
Conversation
|
how am i able to test this? |
The easiest way is to just create a unit test with you use case. You don't need to write any assert statements instead use the snapshot feature on the resulting Schema as this weil give you the whole signs in easily readable format. In order to run the unit tests for a specific transform you might have to run npm Install in the transform root (I don't remember if that was required but I think so) |
i can't get it to install all dependencies, wether with npm, yarn nor pnpm. |
This repo uses "yarn" workspaces so you should run "yarn install" in the root directory of this repo once. Then you should run "yarn build" to make examples work with the built code from the same repo. We have this contributor guide referred in the README but we'd love to improve it together if it doesn't look helpful enough :/ |
@ardatan thanks! that worked. I think i was mixing stuff up with gqtys repo where i'm currently contributing something. @ntziolis i was able to test your transfrom last night and i'm able to move fields from mutation to queris with the soap handler. To your open question, wouldn't it allready be possible to use the replace-fields transform on the transfered field? |
Hi @ntziolis, I've looked at your implementation and you've done a good job. I wanted to try playing with this to see how I would implement it, in order to push myself and see how things could be achieved differently. With little time spent on it, there is plenty more to do before this becomes ready, especially given the wide functionality that I have in mind. You can especially see how I am adding some tests (they're not functioning yet, like in proper TDD) that explain what my plans are for this transform. Will appreciate it if you can take a look and let me know your thoughts. I am sorry if this seems to somehow step over your work, which is certainly good and well functioning. |
@santino No apologies needed. I'm work & travelling until the 12th so my responses might be a bit slow. I like the idea to extend the transfer to other parts of the schema. In fact after writing the transfer-field the only use case I could come up with that didn't overlap with hoist-field was moving fields from one root field to another (Mutation to Query etc.). Which felt a little light on usefulness. I will have a closer at your code and especially at the unit tests you called out to understand where you want to take this. One thing that is front and center for me is that whatever configuration we come up with should be easy to understand and near self explanatory (similar or the other transforms).
|
@Lappihuan You should be able to use any other bare transform after using transfer-field. That said the intent is to "replace" the replace-field transform with smaller more focused transforms. The transfer-field transform being one of them. So once we have those smaller transforms in place santino suggested to retire depreceate replace-fields transform. |
39e5048
to
7ef75ea
Compare
Closing, superseded by #3185 |
Description
This is an initial version of a transfer field transform.
Thigs left todo:
removeObjectFields
+appendObjectFields
move as much init logic into ctor as possibleremoveObjectFields
+appendObjectFields
Open questions:
Addresses parts of #2975
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
I have started adding unit tests, but def. will add more before the PR will be merged.
Checklist:
Further comments
@santino Please let me know what you think about the general approach.