Uploaded image for project: 'Data Management'
  1. Data Management
  2. DM-12231

Investigate GraphQL as an alternative to Django REST Framework for the squash-api microservice

    XMLWordPrintable

    Details

    • Type: Story
    • Status: Done
    • Resolution: Done
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      Implement a testbed for GraphQL using django-graphene and implement a proof of concept GraphQL Schema to query the Metrics/Measurements

        Attachments

          Issue Links

            Activity

            Hide
            afausti Angelo Fausti added a comment - - edited

            See initial implementation here:

            https://github.com/lsst-sqre/squash-api/blob/tickets/DM-12231

            there are some GraphQL sample queries in the README.md

            the docker image built is lsstsqre/squash-api:DM-12231

            and it was deployed here:

            https://squash-api-demo.lsst.codes/

            The Learning GraphQL course from Eve Procello is a good starting point https://www.lynda.com/JavaScript-tutorials/Learning-GraphQL/574714-2.html

            Show
            afausti Angelo Fausti added a comment - - edited See initial implementation here: https://github.com/lsst-sqre/squash-api/blob/tickets/DM-12231 there are some GraphQL sample queries in the README.md the docker image built is lsstsqre/squash-api: DM-12231 and it was deployed here: https://squash-api-demo.lsst.codes/ The Learning GraphQL course from Eve Procello is a good starting point https://www.lynda.com/JavaScript-tutorials/Learning-GraphQL/574714-2.html
            Hide
            afausti Angelo Fausti added a comment -

            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.)

            Show
            afausti Angelo Fausti added a comment - 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.)
            Hide
            afausti Angelo Fausti added a comment -

            Initial implementation deployed to production https://squash.lsst.codes

            Show
            afausti Angelo Fausti added a comment - Initial implementation deployed to production https://squash.lsst.codes
            Hide
            afausti Angelo Fausti added a comment -

            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.

            Show
            afausti Angelo Fausti added a comment - 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.

              People

              Assignee:
              afausti Angelo Fausti
              Reporter:
              afausti Angelo Fausti
              Watchers:
              Angelo Fausti
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Jenkins

                  No builds found.