Add account info endpoint and merge data which this API provides with clan members info. Also add helper function which gives a dictionary of requested fields in resolvers. This function made it possible to decide, which fields are needed and make requests only for them. For example, if we make query like
we can determine that in our query there aren't fields which are specific only for clan info data, so we can do only one request to account/info
The code could seem tricky, but it solves the issue. The main moment is that graphene camelcases every field in nodes, but out API returns data with keys in snakecase, so we have to dance around it with snakecase() and camelcase() functions. In future we'll have a better architecture for load balancing and solving the problems how to load and combine data, I hope.
Also, because of members in clan info method have account_name field, which is completely the same as nickname in account info method I was forced to add workaround which add to result nickname field either account_name value or nickname value
Add account info endpoint and merge data which this API provides with clan members info. Also add helper function which gives a dictionary of requested fields in resolvers. This function made it possible to decide, which fields are needed and make requests only for them. For example, if we make query like
we can determine that in our query there aren't fields which are specific only for clan info data, so we can do only one request to
account/info
The code could seem tricky, but it solves the issue. The main moment is that graphene camelcases every field in nodes, but out API returns data with keys in snakecase, so we have to dance around it with
snakecase()
andcamelcase()
functions. In future we'll have a better architecture for load balancing and solving the problems how to load and combine data, I hope.Also, because of members in clan info method have
account_name
field, which is completely the same asnickname
in account info method I was forced to add workaround which add to resultnickname
field eitheraccount_name
value ornickname
value