forked from kcho2001/Chainbytes_Dapp_Frontend
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathquery.js
39 lines (34 loc) · 725 Bytes
/
query.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import { ApolloClient, InMemoryCache, gql } from "@apollo/client";
import React from "react";
import { AppRegistry } from "react-native";
// Initialize Apollo Client
export const client = new ApolloClient({
uri: "https://api.thegraph.com/subgraphs/name/jossduff/coffee-subgraph",
cache: new InMemoryCache(),
});
export const GET_CHECKINS = gql`
query {
workers {
id
daysUnpaid
}
}
`;
export const GET_WORKER_CHECKINS = (id) =>
gql`
query {
worker(id: "${id}") {
checkIns{
year
month
day
}
}
}
`;
const App = () => (
<ApolloProvider client={client}>
<app />
</ApolloProvider>
);
AppRegistry.registerComponent("MyApplication", () => App);