Created
August 17, 2016 04:36
-
-
Save holmesal/3b05b02740d47157432fa309ce25ff20 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { GraphQLObjectType, GraphQLString, GraphQLInt, GraphQLList } from 'graphql'; | |
import { globalIdField } from 'graphql-relay'; | |
import CityDayType from '../../CityDay/types/CityDay'; | |
import AccommodationPlacementType from '../../Supplier/types/AccommodationPlacement'; | |
export default new GraphQLObjectType({ | |
name: 'CityBooking', | |
description: 'The city booking object in Quickplan', | |
fields: () => ({ | |
id: globalIdField('CityBooking', city => city._key), | |
_key: { | |
type: GraphQLString, | |
description: 'Unique city booking ID.' | |
}, | |
cityCode: { | |
type: GraphQLString | |
}, | |
startDay: { | |
type: GraphQLInt, | |
resolve: cityBooking => controller.getCountryBookingById(cityBooking.countryId).then(countryBooking => return countryBooking.startDay); | |
}, | |
durationNights: { | |
type: GraphQLInt | |
}, | |
cityOrder: { | |
type: GraphQLInt | |
}, | |
cityDays: { | |
type: new GraphQLList(CityDayType) | |
}, | |
accommodationPlacements: { | |
type: new GraphQLList(AccommodationPlacementType) | |
} | |
}) | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment