Skip to content

Commit

Permalink
examples(front-end): fix react-query query cache key
Browse files Browse the repository at this point in the history
  • Loading branch information
charlypoly committed Nov 2, 2022
1 parent 3860304 commit 5cd6d06
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions examples/front-end/react/tanstack-react-query/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,12 @@ const allFilmsWithVariablesQueryDocument = graphql(/* GraphQL */ `
`);

function App() {
const { data } = useQuery(['films'], async () =>
request('https://swapi-graphql.netlify.app/.netlify/functions/index', allFilmsWithVariablesQueryDocument, {
first: 10,
})
const { data } = useQuery(['films', { first: 10 }] as const, async ({ queryKey }) =>
request(
'https://swapi-graphql.netlify.app/.netlify/functions/index',
allFilmsWithVariablesQueryDocument,
queryKey[1]
)
);

return (
Expand Down

0 comments on commit 5cd6d06

Please sign in to comment.