open-austin / BASTA-tfwa

Web application to help tenants keep track of documentss related to their rental unit
11 stars 9 forks source link

Bug - making graphql endpoint the default API URL breaks Image component #173

Open JamesBock opened 3 years ago

JamesBock commented 3 years ago

Using the graphql endpoint as the default API endpoint will cause the Image component to use the wrong url and return 404 for all images because this component calls the REST /image endpoint.

https://github.com/open-austin/BASTA-tfwa/blob/fa66e5f70c300651943b35fc045f3bbdf64f5086/.github/workflows/main.yml#L47

Remedies (not necessarily mutually exclusive):

  1. Drop graphql from env URL and add it to gql query URLs
  2. Fetch images from the client - Currently, image names are fetched via gql from the server, then the client is passing the names to the server again to the REST endpoint where the server accesses Google Cloud Storage then passes the image to the client. Fetching the images directly on the client seems like a much simpler solution.