-
Notifications
You must be signed in to change notification settings - Fork 1
/
schema.graphql
70 lines (63 loc) · 1.69 KB
/
schema.graphql
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
"""
GraphQL schema for the Staten Island Supermarket Search app
"""
scalar DateTime
type Query {
"""
A hard-coded response with the name of the application.
"""
info: String!
"""
All supermarket organizations. These are immutable.
"""
organizations: [Organization!]!
organizationsByName(name: String!): [Organization]
organizationsByLocation(name: String!): [Organization]
organizationsByEvent(name: String!): [Organization]
organization(id: ID!): Organization
"""
Major supermarket events.
"""
events: [Event!]!
event(id: ID!): Event
"""
All Staten Island locations of supermarkets.
"""
locations: [Location!]!
location(id: ID!): Location
}
type Mutation {
createEvent(name: String, eventTime: DateTime!, description: String!, organizationId: ID!): Event!
updateEvent(id: ID!, name: String, eventTime: DateTime, description: String): Event!
deleteEvent(id: ID!): Event
"""
Creating a location will automatically retrieve the latitude and longitude from the Google Places API.
"""
createLocation(name: String!, address: String!, organizationId: ID!): Location!
"""
Updating a location will automatically retrieve the latitude and longitude from the Google Places API.
"""
updateLocation(id: ID!, name: String, latitude: Float, longitude: Float, address: String): Location!
deleteLocation(id: ID!): Location
}
type Organization {
id: ID!
name: String!
locations: [Location!]!
events: [Event!]!
}
type Location {
id: ID!
name: String!
address: String!
latitude: Float!
longitude: Float!
organization: Organization!
}
type Event {
id: ID!
name: String!
eventTime: DateTime!
description: String!
organization: Organization!
}