timwis
10/27/2017, 11:28 AMschema.graphql
file need to define a type that reflects the API response? If so, I think I need 2 types: one that’s a list of the other. But apparently resolvers can only have one type 😕timwis
10/27/2017, 11:29 AMtype TwilioPhoneNumberCapabilities {
voice: Boolean
SMS: Boolean
MMS: Boolean
}
type TwilioPhoneNumber {
friendly_name: String
phone_number: String
lata: String
rate_center: String
latitude: String
longitude: String
region: String
postal_code: String
iso_counry: String
capabilities: TwilioPhoneNumberCapabilities
beta: Boolean
}
type TwilioPhoneNumberList {
uri: String
available_phone_numbers: [TwilioPhoneNumber]
}
extend type Mutation {
getAvailablePhoneNumbers(
areaCode: String
): TwilioPhoneNumberList
}
Ben
10/27/2017, 11:34 AMagartha
10/27/2017, 1:32 PMextend type Mutation {
getAvailablePhoneNumbers(
areaCode: String
): [TwilioPhoneNumber]
}
and either split capabilities or make it a Json fieldagartha
10/27/2017, 1:32 PMtimwis
10/27/2017, 2:18 PMagartha
10/27/2017, 2:22 PMtimwis
10/27/2017, 2:52 PM