interface ICountry {
    id: ID!
    name: String!
    phone_code: String!
    currency: String
    currency_symbol: String
    emoji: String
    location: GeoLocation
    createdAt: DateTime!
    updatedAt: DateTime!
}

type Country implements ICountry @entity {
    id: ID! @id
    name: String! @column
    phone_code: String! @column
    currency: String @column
    currency_symbol: String @column
    emoji: String @column
    location: GeoLocation @column(overrideType: "IGeoLocation")
    states(criteria: AnyObject, limit: Int, skip: Int, sort: Sort): States
    createdAt: DateTime! @column(overrideType: "Date")
    updatedAt: DateTime! @column(overrideType: "Date")
}

input CountryInput {
    name: String!
}

type Countries {
    totalCount: Int!
    data: [Country]
}

extend type Query {
    countries(criteria: AnyObject, limit: Int, skip: Int, sort: Sort): Countries!
    country(id: ID!): Country!
    countryByName(name: String!): Country!
}

extend type Mutation {
    createCountry(country: CountryInput!): Country!
    updateCountry(id: ID!, country: CountryInput!): Country!
    deleteCountry(id: ID!): Boolean!
}
