-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathschema.js
106 lines (79 loc) · 1.97 KB
/
schema.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
import { gql } from 'apollo-server'
export const typeDefs = gql`
scalar Date
scalar ObjectID
type Query {
entries(where: EntriesWhereInput!): [Entry!]
entry(id: ObjectID!): Entry
}
input EntriesWhereInput {
"Unique Identifier for each row entry"
uid: Int
"Federal Information Processing Standards code that uniquely identifies counties within the USA"
fips: Int
"The name of the State within the USA"
state: String
"The name of the County within the USA"
county: String
}
type Entry {
id: ObjectID!
"Unique Identifier for each row entry"
uid: Int
country_iso2: String
country_iso3: String!
country_code: Int!
"Federal Information Processing Standards code that uniquely identifies counties within the USA"
fips: Int!
"The name of the County within the USA"
county: String
"The name of the State within the USA"
state: String
"The name of the Country (US)"
country: String!
combined_name: String!
population: Int!
loc: GeoJSONPoint!
date: Date!
"Aggregated confirmed case count"
confirmed: Int!
}
type GeoJSONPoint {
type: GeoJSONTypeName!
coordinates: [Float!]!
}
enum GeoJSONTypeName {
Point
}
`
const playgroundQuery = `# Play around with different variables in the "Query Variables"
# section at the bottom. For example, another way to query for
# Jefferson County Kentucky is by using the county's fips number
# (21111), instead of the state and county property:
#
# { "where": { "fips": 21111 } }
#
query entries($where: EntriesWhereInput!) {
entries(where: $where) {
id
combined_name
population
loc {
type
coordinates
}
date
confirmed
}
}`
const playgroundVariables = `{
"where": {
"state": "Kentucky",
"county": "Jefferson"
}
}`
export const defaultPlaygroundTabOptions = {
endpoint: 'http://localhost:4000/',
query: playgroundQuery,
variables: playgroundVariables,
}