forked from e888mon/Chainbytes_Dapp_Frontend
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathquery.js
More file actions
41 lines (36 loc) · 757 Bytes
/
query.js
File metadata and controls
41 lines (36 loc) · 757 Bytes
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
40
41
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.studio.thegraph.com/query/44596/coffee-subgraph/v0.0.3",
cache: new InMemoryCache(),
});
export const GET_CHECKINS = gql`
query {
workers {
id
daysUnpaid
}
}
`;
export const GET_WORKER_CHECKINS = (id) =>
gql`
query {
worker(id: "${id}") {
daysWorked
daysUnpaid
checkIns{
year
month
day
}
}
}
`;
const App = () => (
<ApolloProvider client={client}>
<app />
</ApolloProvider>
);
AppRegistry.registerComponent("MyApplication", () => App);