Virtual Field (Resolved) Input Values #9126
ggpwnkthx
started this conversation in
Feature requests
Replies: 2 comments 2 replies
-
I forgot to note that with the changes above, when using a custom |
Beta Was this translation helpful? Give feedback.
0 replies
-
I think we could extend |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Is the spirit of the virtual field type designed strictly for calculating an output? I've run into an situation where having a calculated output and allow the user to submit data in the context of that field would be appropriate.
I have found a simple workaround is to use this change:
keystone/packages/core/src/fields/types/virtual/index.ts
Lines 76 to 85 in bd33f07
keystone/packages/core/src/fields/types/virtual/index.ts
Lines 86 to 89 in bd33f07
And to change the existing
serialize
method defined here:keystone/packages/core/src/fields/types/virtual/views/index.tsx
Lines 40 to 51 in bd33f07
keystone/packages/core/src/fields/types/virtual/views/index.tsx
Lines 53 to 54 in bd33f07
This could definitely be fleshed out much better by defining actual
graphql.args
in the field schemas and handling those in the controller. I'm happy to tackle this, but I wanted to make sure this would make sense as a modification to the existingvirtual
field type or if a whole newdynamic
field type would be better.Beta Was this translation helpful? Give feedback.
All reactions