You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: readme.md
+41-1Lines changed: 41 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,47 @@ Provides an Apollo GraphQL client on Reactium.GraphQL singleton in Reactium proj
4
4
5
5
## Install
6
6
7
-
`npx reactium install @reactium/graphql`
7
+
```sh
8
+
npx reactium install @reactium/graphql
9
+
```
10
+
11
+
## Usage
12
+
13
+
See [Apollo Client (React)](https://www.apollographql.com/docs/react) documentation for full details.
14
+
15
+
This plugin already sets up the Apollo client as a context provider for the Reactium application, so you can begin using the `gql` with React hooks immediately.
16
+
17
+
```jsx
18
+
import { gql, useQuery } from'@apollo/client';
19
+
importReactfrom'react';
20
+
21
+
constGET_USERS=gql`
22
+
queryGetUsers {
23
+
users {
24
+
id
25
+
name
26
+
email
27
+
}
28
+
}
29
+
`;
30
+
31
+
exportconstUsersList= () => {
32
+
const { loading, error, data } =useQuery(GET_USERS);
0 commit comments