/getCountryByIso/{iso}

Implementation Notes:

  • The Country model should be structured to reflect the fields expected by the client. It should contain fields like name, iso2, iso3, numericCode, currencyCode, currencyName, phoneCode, capital, continent, and languages, along with any additional fields that are relevant to countries.
  • The languages field is expected to be an array of objects that contain code, name, and native properties, which represent the languages spoken in the country.
  • The ISO code provided as an argument in getCountryByIso is normalized to uppercase before querying the database to ensure case-insensitive matching.
  • Error handling is done using ApolloError, which allows the client to understand that a database error occurred. The use of specific error codes like 'DATABASE_ERROR' helps in identifying the nature of the error quickly.
  • Ensure that error messages do not reveal sensitive information about the database structure or the nature of the backend systems.
  • Please verify that the actual implementation of your GraphQL API reflects this documentation, including all the fields that your Country model supports, and adhere to best practices for error handling and data retrieval.
Language
Click Try It! to start a request and see the response here!