avenger icon indicating copy to clipboard operation
avenger copied to clipboard

Make clear you can't pass multiple parameters to a query

Open giuscri opened this issue 5 years ago • 1 comments

From the docs, it's not clear what to do when the query is implemented accepting multiple arguments.

Say I have a function and a React component:

  • function dogs(breed: string, color: string)
  • <Dogs />

It should be made clear that the correct way to pass breed and color to the function is not

<Dogs queries={{ restaurantsByLocation: ("labrador", "black") }} />

Instead, you need to change the function signature into

function dogs(hint: { breed: string, color: string})

and pass value from the component as

<Dogs queries={{ dogs: { breed: "labrador", color: "black" } }} />

giuscri avatar Nov 21 '19 14:11 giuscri

@giuscri could you suggest a good place to add such a hint in the current README?

giogonzo avatar Mar 19 '20 09:03 giogonzo