Allow writing values but not reading them back in graphql

I have sensitive fields that I want to allow setting in create/update but don't want them to be read back. I was able to make them return null with this
read :non_sensitive_info do
prepare build(deselect: [:cacertfile])
end
read :non_sensitive_info do
prepare build(deselect: [:cacertfile])
end
however I would like the schema to reflect those can't be selected, is there a way to do this? hide_fields also removes them from create/update
4 Replies
ZachDaniel
ZachDaniel2y ago
Interesting…we may need to add an option for hiding the fields only on the type not the input You could hide the fields, add arguments and use set_attribute potentially. Might want a custom change that actually checks if the argument is provided
michaelst
michaelstOP2y ago
that takes me back to the other conversation always having to the pass the value or it gets set to null with set_attribute
ZachDaniel
ZachDaniel2y ago
So you don’t overwrite with nil values
michaelst
michaelstOP2y ago
hahaha yep I will do that

Did you find this page helpful?