functionland / fula-archived

Client-server stack for Web3! Turn your Raspberry Pi to a BAS server in minutes and enjoy the freedom of decentralized Web with a superior user experience!
https://fx.land
MIT License
4 stars 0 forks source link

If pass not valid query or value to box will fail with fatal error #79

Closed farhoud closed 2 years ago

farhoud commented 2 years ago

when i try to run a bad query with empty values server proccess end.

Step to create error:

...
const data = await fula.graphql(createMutation,{values:[{cid:'123'}]})

export const createMutation = `
  mutation addImage($values:JSON){
    create(input:{
      collection:"gallery",
      values: $values
    }){
      cid
    }
  }
`;

Log

Swarm listening on /dns4/wrtc-star1.par.dwebops.pub/tcp/443/wss/p2p-webrtc-star/p2p/12D3KooWPGsiSzfA8tx5oreRzJhNUKkDz7friokUmbTzSw7Btzaa
Swarm listening on /dns4/wrtc-star2.sjc.dwebops.pub/tcp/443/wss/p2p-webrtc-star/p2p/12D3KooWPGsiSzfA8tx5oreRzJhNUKkDz7friokUmbTzSw7Btzaa
/home/farhoud/workspace/functionland/box/apps/box/dist/index.js:17973
  Object.keys(res.data).forEach((key) => {
         ^

TypeError: Cannot convert undefined or null to object
    at Function.keys (<anonymous>)
    at selector (/home/farhoud/workspace/functionland/box/apps/box/dist/index.js:17973:10)
    at executeAndSelect (/home/farhoud/workspace/functionland/box/apps/box/dist/index.js:18003:10)
    at async /home/farhoud/workspace/functionland/box/apps/box/dist/index.js:18026:18
    at async handler2 (/home/farhoud/workspace/functionland/box/apps/box/dist/index.js:17716:18)
[nodemon] app crashed - waiting for file changes before starting...