We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ea2a528 commit 0cf1ffdCopy full SHA for 0cf1ffd
src/services/Item.ts
@@ -1,11 +1,29 @@
1
-import { createClient } from "offix-client";
+import { createClient, VoyagerClient } from "offix-client";
2
+import { ADD_TASK } from "../graphQL/queries/graphql.queries";
3
4
export class ItemService {
5
+ client: any;
6
+
7
config = {
8
httpUrl: "http://localhost:4000/graphql",
9
wsUrl: "ws://localhost:4000/graphql"
10
};
11
12
createAClient = async () => {
13
+ if (this.client) {
14
+ this.client = await createClient(this.config);
15
+ }
16
+ return this.client;
17
+ };
18
19
+ getItems = async () => {
20
+ console.log("In method");
21
const client = await createClient(this.config);
22
+ const data = await client.query({
23
+ query: ADD_TASK,
24
+ fetchPolicy: "network-only",
25
+ errorPolicy: "none"
26
+ });
27
+ console.log("data", data);
28
29
}
0 commit comments