tnc-ca-geo / animl-api

Backend for https://animl.camera
4 stars 0 forks source link

TypeScript: Resolvers(query.imageErrors): Add count to ImageErrors pageInfo object #197

Closed alukach closed 3 weeks ago

alukach commented 3 weeks ago

Currently, in GraphQL, our types have us returning an ImageErrorsConnection from Query.ImageErrors: https://github.com/tnc-ca-geo/animl-api/blob/5522f6a70c3cc9d0eddf7a5f75b673626f53bc27/src/api/type-defs/root/Query.js#L10

That type has a PageInfo object: https://github.com/tnc-ca-geo/animl-api/blob/5522f6a70c3cc9d0eddf7a5f75b673626f53bc27/src/api/type-defs/payloads/ImageErrorsConnection.js#L2-L3

Which does not contain a count property: https://github.com/tnc-ca-geo/animl-api/blob/5522f6a70c3cc9d0eddf7a5f75b673626f53bc27/src/api/type-defs/objects/PageInfo.js#L2-L7

However, in our resolver, we are returning a count: https://github.com/tnc-ca-geo/animl-api/blob/5522f6a70c3cc9d0eddf7a5f75b673626f53bc27/src/api/resolvers/Query.js#L68-L78

This PR adds a count to the response type to appease TypeScript.