Currently, selecting a custom field with raw sql looks like this:
r.table(
db.post,
{
fields: {
preview: (q) =>
q.select({ preview: q.sql<string>`substr(text,1,100)` }),
This is too wordy, and, it breaks when a field is requested with an alias:
posts {
my_preview: preview # will not work
}
The syntax should rather be:
r.table(
db.post,
{
fields: {
preview: (q) => q.sql<string>`substr(text,1,100)`
with orchid-graphql wrapping the field select.
Currently, selecting a custom field with raw sql looks like this:
This is too wordy, and, it breaks when a field is requested with an alias:
The syntax should rather be:
with orchid-graphql wrapping the field select.