forked from apollographql-education/s2w-w13-playground
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlistings.graphql
68 lines (61 loc) · 1.5 KB
/
listings.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
extend schema
@link(url: "https://specs.apollo.dev/federation/v2.10", import: ["@key"])
@link(
url: "https://specs.apollo.dev/connect/v0.1"
import: ["@connect", "@source"]
)
@source(
name: "v1"
http: { baseURL: "https://rt-airlock-services-listing.herokuapp.com" }
)
type Query {
"A curated array of listings to feature on the homepage"
featuredListings: [Listing!]!
@connect(
source: "v1"
http: { GET: "/featured-listings" }
selection: """
id
title
"""
)
# # EXERCISE: LISTING DETAILS
# "A specific listing"
# listing(id: ID!): Listing
}
"A particular intergalactic location available for booking"
type Listing {
id: ID!
"The listing's title"
title: String!
# # EXERCISE: FEATURED LISTINGS
# "The number of beds available"
# numOfBeds: Int
# "The cost per night"
# costPerNight: Float
# "Indicates whether listing is closed for bookings (on hiatus)"
# closed: Boolean
# # EXERCISE: LISTING AMENITIES
# "The amenities available for this listing"
# amenities: [Amenity!]!
}
# # EXERCISE: LISTING AMENITIES
# type Amenity {
# id: ID!
# "The amenity category the amenity belongs to"
# category: String!
# "The amenity's name"
# name: String!
# }
# # EXERCISE: MUTATIONS
# input CreateListingInput {
# title: String!
# numOfBeds: Int
# costPerNight: Float
# }
# type CreateListingResponse {
# listing: Listing
# }
# type Mutation {
# createListing(input: CreateListingInput!): CreateListingResponse
# }