mui / toolpad

Toolpad: Full stack components and low-code builder for dashboards and internal apps.
https://mui.com/toolpad/
MIT License
1.27k stars 282 forks source link

Issue with fetch query preview #1067

Closed prakhargupta1 closed 2 years ago

prakhargupta1 commented 2 years ago

Duplicates

Latest version

Current behavior 😯

I have 2 queries in this app.

  1. fetch_target_url
  2. test_query

1st one complies to the API by taking some parameter while 2nd is a static URL. Both are same URLs eventually, but somehow 1st one doesn't give me a preview but 2nd one does. Can we troubleshoot this?

Another point of concern: For 2nd query which works fine, the network panel shows an alert icon and when clicked, shows some error. Can we check this too?

Expected behavior 🤔

Both should work the same way and show preview.

Steps to reproduce 🕹

Steps:

  1. Open the app
  2. Run the 2 queries separately

Context 🔦

No response

Your environment 🌎

No response

Janpot commented 2 years ago

Yes, your transform should return a function body.i.e. it has

(data) => {
  return (
    data.items
  )  ;
}

while it should have

return data.items;

We should show a better feedback when the transform function returns undefined. https://github.com/mui/mui-toolpad/issues/1083