-
My Rails DB has a model But the image URLs are not in the database -- they're generated dynamically in Rails by a method of the I'd like to be able to return those image URLs via GraphQL. Is there a way to serve a field whose value is generated dynamically? I've found a few issues and SO threads that seem to refer to this, but it's not clear to me how a field can call a method outside GraphQL. If I call So far, my GraphQL fields come directly from the database: :id, :notes, :created_at, etc. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Oof! 🤭🙃 so that's why there is that convention to name your type ImageType... to avoid class name conflicts! Problem solved. |
Beta Was this translation helpful? Give feedback.
-
In Ruby, you can explicitly reference top-level constants by prefixing them with |
Beta Was this translation helpful? Give feedback.
Oof! 🤭🙃 so that's why there is that convention to name your type ImageType... to avoid class name conflicts!
I figured the namespace would take care of it but not here.
Problem solved.