Skip to content

Commit

Permalink
use correct function in React querying example; add missing dependency (
Browse files Browse the repository at this point in the history
  • Loading branch information
stefan-girlich authored Oct 10, 2022
1 parent 729f772 commit ac58cb3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pages/en/querying/querying-from-an-application.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -109,13 +109,13 @@ import React, { useEffect } from 'react'
import { ExampleQueryDocument, ExampleQueryQuery, execute } from '../.graphclient'

function App() {
const [data, setData] = React.useState<ExampleQueryQuery>()
const [result, setResult] = React.useState<ExampleQueryQuery>()

useEffect(() => {
execute(ExampleQueryDocument, {}).then((result) => {
setData(result?.data)
})
}, [])
}, [setResult])
return (
<div className="App">
<header className="App-header">
Expand Down

0 comments on commit ac58cb3

Please sign in to comment.