File tree Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import logo from './logo.svg';
3
3
import './App.css' ;
4
4
5
5
import LambdaDemo from './LambdaDemo' ;
6
+ import GraphQLDemo from './GraphQLDemo' ;
6
7
7
8
const App = ( ) => {
8
9
return (
@@ -13,6 +14,7 @@ const App = () => {
13
14
Edit < code > src/App.js</ code > and save to reload.
14
15
</ p >
15
16
< LambdaDemo />
17
+ < GraphQLDemo />
16
18
</ header >
17
19
</ div >
18
20
) ;
Original file line number Diff line number Diff line change
1
+ import React from 'react' ;
2
+ import { useQuery } from '@apollo/react-hooks' ;
3
+ import { gql } from 'apollo-boost' ;
4
+
5
+ const GraphQLDemo = ( ) => {
6
+ const { data } = useQuery ( gql `
7
+ query {
8
+ hello
9
+ }
10
+ ` ) ;
11
+ return (
12
+ < div >
13
+ A greeting from the GraphQL server: { data ? data . hello : '' }
14
+ </ div >
15
+ ) ;
16
+ } ;
17
+
18
+ export default GraphQLDemo ;
You can’t perform that action at this time.
0 commit comments