codeforboston / mattapan-mapping

Mattapan Mapping application. A collaborative between powerfulpathways.org & codeforboston.org . Ideation phase.
https://mattapan-pp.netlify.app/
MIT License
5 stars 16 forks source link

Implement GraphQL #135

Closed endy-imam closed 2 years ago

endy-imam commented 2 years ago

So I manage to set up GraphQL query with the inclusion of the Apollo client, end-to-end type safety with GraphQL Code Generation and set up an environment variable for querying Hasura database for the app. All of the setups are documented on the README.md.

The way GraphQL API calls seem simple enough with a simple fetch and load approach (as an example here), but I keep getting stuck with how to set up loading screens to render while juggling between dependent useEffects and page components. The MeetPage.tsx seems more straightforward as the <CommunityVideoComponent> seems more self-contained, so I didn't have much in terms of problems. But when trying to implement loading at MapPage.tsx, that is when I got lost on what useState hooks are dependent on by what components and errors result from it. I fear that I might have to severely refactor MapPage.tsx, seeing how intertwined it seems.

Outside of loading issues, I am also unsure how I set up GraphQL codegen or how to organize GraphQL queries in the project, but I do want some consensus on how to structure it moving forward.

netlify[bot] commented 2 years ago

Deploy request for mattapan-mapping pending review.

Visit the deploys page to approve it

Name Link
Latest commit 3d1d195d32eebc6b6dd15533c7729cc5d3d7aba8
thadk commented 2 years ago

I think I got the graphql query for the Mapbox storytelling folder working on my localhost. Nice!

What do you think the next step would be to get the table to be controlled in the mattapan-mapping admin panel for demoing?