tnc-ca-geo / animl-api

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

[IN PROGRESS] TypeScript: 4. Convert GraphQL resolvers to TS #196

Closed alukach closed 3 weeks ago

alukach commented 3 weeks ago

What I'm changing

This PR continues the GraphQL conversion towards TS, converting the resolvers. These types makes use of the auto-generated types introduced in #195.

How I did it

This PR is a mostly straight-forward conversion. However, src/api/resolvers/Scalars.ts required new strict type-checking before marshaling data between types.

Additionally, I was required to change import GraphQLJSON from 'graphql-type-json' to import * as GraphQLJSON from 'graphql-type-json' in order to conform to the types reported by the graphql-type-json module. This was a bit concerning and should be tested.

How you can test it

Deploy to staging, test API endpoints that work with a DateTime field.


part of #188

[!NOTE] This PR builds off of the work done in #195. As such, #195 should be merged before this PR and this PR's target should be update to main before merging.

alukach commented 3 weeks ago

I'm going to close this to do a bit more work with the resolvers, adding return types.