Skip to content

Commit 0cf1ffd

Browse files
Update item service
1 parent ea2a528 commit 0cf1ffd

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

src/services/Item.ts

+19-1
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,29 @@
1-
import { createClient } from "offix-client";
1+
import { createClient, VoyagerClient } from "offix-client";
2+
import { ADD_TASK } from "../graphQL/queries/graphql.queries";
23

34
export class ItemService {
5+
client: any;
6+
47
config = {
58
httpUrl: "http://localhost:4000/graphql",
69
wsUrl: "ws://localhost:4000/graphql"
710
};
11+
812
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");
921
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);
1028
};
1129
}

0 commit comments

Comments
 (0)