Tag: msw
-
@apollo/client local-only field is not resolved when working with service worker
0 I have problems getting local-only fields via typePolicies to work in my app. My setup is the following: This is one of my queries: export const GET_ALL_DEBT_TOKENS = gql` query GetDebtTokens { getDebtTokens { totalSupplyUSD totalReserve totalReserve24hAgo token { address symbol priceUSD @client priceUSD24hAgo } } } `; And this is the config to…
-
Vue, Vitest and MSW: Mocking and testing a GraphQL query result in composable not possible
0 I made a simple dummy application as in the end it will fit in a much bigger enterprise application, but I first made a proof of concept to make sure it works… and it doesn’t yet! I’m at a loss why this is. I’ve followed the documentation on https://mswjs.io/ for getting the mock in…
-
Unexpected error object with mock-service-worker and react-query with graphql
0 I’m writing a test where I expect an error message to show. This is the component I’m testing: export const CourseOverview = () => { const { data, isError, error, isSuccess } = useGetCourses(); if (isError) { return <div>{error.message}</div>; } if (isSuccess) { return ( <CourseAccordion items={data.courses} /> ); } return <div>Loading…</div>; }; useGetCourses…