Closed alukach closed 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
ImageErrorsConnection
Query.ImageErrors
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
PageInfo
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
count
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.
Currently, in GraphQL, our types have us returning an
ImageErrorsConnection
fromQuery.ImageErrors
: https://github.com/tnc-ca-geo/animl-api/blob/5522f6a70c3cc9d0eddf7a5f75b673626f53bc27/src/api/type-defs/root/Query.js#L10That type has a
PageInfo
object: https://github.com/tnc-ca-geo/animl-api/blob/5522f6a70c3cc9d0eddf7a5f75b673626f53bc27/src/api/type-defs/payloads/ImageErrorsConnection.js#L2-L3Which does not contain a
count
property: https://github.com/tnc-ca-geo/animl-api/blob/5522f6a70c3cc9d0eddf7a5f75b673626f53bc27/src/api/type-defs/objects/PageInfo.js#L2-L7However, in our resolver, we are returning a
count
: https://github.com/tnc-ca-geo/animl-api/blob/5522f6a70c3cc9d0eddf7a5f75b673626f53bc27/src/api/resolvers/Query.js#L68-L78This PR adds a
count
to the response type to appease TypeScript.