satisfactorymodding / smr-frontend

Next generation Satisfactory Modding Repository (SMR) frontend
https://satisfactorymodding.github.io/smr-frontend/main/
GNU General Public License v3.0
6 stars 24 forks source link

fix: user page getting incomplete mod data #102

Closed mircearoata closed 1 year ago

mircearoata commented 1 year ago

The tags were missing from the user query and therefore the ModCards were passing undefined to the TagList, which caused the whole page to error.

Using fragments for the information a component requires would help in avoiding this in the future.

Enabling strict null checking would also improve the type safety of the code in this regard. There are many places using optional chaining already, without marking the variable as allowing undefined/null, making these issues harder to spot.

If strict null check is enabled, graphql-codegen should also be configured with

avoidOptionals:
        object: true
        field: true

Both of these suggestions are outside the scope of this hot-fix PR, but good to have written down for the future.