PeanutBase / jekyll-peanutbase

A "starter" Jekyll site that uses the jekyll-theme-legumeinfo submodule
Apache License 2.0
0 stars 0 forks source link

Gene Search: Shows 'Failed to load data' #49

Closed sdash-github closed 9 months ago

sdash-github commented 9 months ago

'Failed to load data' error upon search for any term, both in dev and prod.
https://dev.peanutbase.org/tools/gene-keyword-search.html

adf-ncgr commented 9 months ago

I think I've fixed it, although I'm a little unclear as to the state of the code. The problematic file was ./tools/js/graphql.js in which on prod I changed it from:

// query a local instance of the LIS GraphQL server:
// https://github.com/legumeinfo/graphql-server
const uri = 'https://dev.peanutbase.org/graphql';

to const uri = 'https://www.peanutbase.org/graphql'; I thought the graphql endpoint was supposed to be controlled from the _config.yml file, but peanutbase may have diverged early on when that wasn't supported. On dev the problem was simply that the graphql server there had stopped running, so I've restarted it. @svengato I think you still have a TODO here to review the state of the code with respect to using the graphql_uri from the config file.

adf-ncgr commented 9 months ago

NB: the use of www.peanutbase.org seems to be needed because otherwise the proxy server returns a redirect that the current code doesn't handle (tries to parse the response as JSON, which it isn't). Not really a problem, just noting it for future reference.

svengato commented 9 months ago

@svengato I think you still have a TODO here to review the state of the code with respect to using the graphql_uri from the config file.

Is that in an issue? I do not see it.

adf-ncgr commented 9 months ago

I didn't make a separate issue for it, I just meant that the current issue will probably recur until we move the setting of the graphql endpoint out of code and into config so trying to make sure that the little bandaid I stuck on it is not considered the actual fix.

svengato commented 9 months ago

Looking at it now. Is the point to eliminate tools/js/graphql.js ? Because that alone does not work.

adf-ncgr commented 9 months ago

no, the point is just to get the value of the uri from config instead of hardcoding; I think it should be similar to how it is done here

svengato commented 9 months ago

It works now in both development and production. I pulled other recent changes as well (to graphql-server, web-components, jekyll-theme-legumeinfo, and jekyll-peanutbase).