useQuery returns undefined, But returns data on gql playground

前端 未结 3 610
北荒
北荒 2021-01-13 05:11
\"@apollo/react-hooks\": \"^3.1.3\",
\"apollo-client\": \"^2.6.8\",

Apollo client return undefined on react app but return the data on gql playgrou

3条回答
  •  谎友^
    谎友^ (楼主)
    2021-01-13 05:46

    It's kind of a late answer but I had the same issue where my playGround returned a correct response but not the useQuery hook.

    My problem was that the variable given to the query, in your case 'id', was of type String instead of Number.

提交回复
热议问题