Fix Version/s: None
Implement a testbed for GraphQL using django-graphene and implement a proof of concept GraphQL Schema to query the Metrics/Measurements
- relates to
DM-12194 Redesign SQuaSH REST API to make it complaint with lsst.verify
GraphQL can potentially improve the data access for SQuaSH bokeh apps and in addition provides a nice query interface for the squash database. The current vision is that it is complementary to the squash REST API. For instance, POST requests used to push data to SQuaSH could still be done in DRF.
The next step is to extend the initial GraphQL schema implemented in this ticket.
Note that for now it was deployed in production as an independent service squash-graphql and the workflow for that was not conventional I've created that repo just for the deployment
$ git push https://github.com/lsst-sqre/squash-graphql.git +tickets/DM-12231:master
I don't expect to make changes to it - the ultimate goal is to have GraphQL in the squash-api repo and I plan to do that once the squash db schema is reviewed and all dependencies in the squash-api are updated (same versions of django etc.)
Initial implementation deployed to production https://squash.lsst.codes
CONCLUSION: GraphQL can be used in addition to the REST API as an alternative to query the SQuaSH data. Sendin requests with large bodies however should still be done using POST requests against the REST API.
There's also a flask-graphene extension and it shouldn't be difficult to use that when we move to the Flask SQuaSH REST API implementation.
See initial implementation here:
there are some GraphQL sample queries in the README.md
the docker image built is lsstsqre/squash-api:
and it was deployed here: