Forum Discussion

SheenaK's avatar
SheenaK
Champion
17 days ago

Using LiQL or SQL on Aurora instead of GraphQL?

We had an LiQL query we were using for years to surface community posts on our help center, and following the move to Aurora we need to update this to GraphQL. However, the developers on that team would prefer SQL/LiQL as their system is not set up for GraphQL.

Is it possible to still use LiQL or SQL queries while on Aurora? 

  • NickH's avatar
    NickH
    Khoros Staff

    Aurora still supports the legacy REST APIs, although the url path needs to be updated to append /t5/s to hit those legacy REST endpoints. I assume your developers aren't directly using LiQL or SQL rather that they are using REST endpoints where they pass LiQL to execute a query and get a response. While the REST APIs are still available today with that URL change, they will be deprecated in a future release with plenty of prior notice given.

    GraphQL is a query language but it still works through basic HTTP commands (post), the difference is you are passing along GraphQL queries in the request, often to a single endpoint, to request exactly the data you want returned. It's a more standardize structure to our proprietary LiQL queries. Outside of some helper libraries that making caching and state management easier, if any 3rd party app is making REST API calls, the transition to GraphQL API can use similar web/http requests. This can be experimented with basic web tools like Postman or even javascript fetch commands, curl etc.

    • SheenaK's avatar
      SheenaK
      Champion

      the url path needs to be updated to append /t5/s to hit those legacy REST endpoints.

      Okay, that could solve it, thanks! I'll relay it back to the team for a temporary fix, and then we can work on updating them to GraphQL properly.

      • NickH's avatar
        NickH
        Khoros Staff

        The other thing to check with be how they are authenticating. Most likley they are doing a proper auth flow, but classic also allowed the session id cookie to be used for API auth which was not recommended but possible in older instances of classic. To further protect the API and data, Aurora does not allow this to be used to authenticate APIs requests.

    • cblown's avatar
      cblown
      Boss

      Aurora still supports the legacy REST APIs

      Good to know... 🤔

  • Hi SheenaK - I don't believe this is possible, I'm sure some of the devs here might be able to help convert the query, can you share the LiQL query? 

    • SheenaK's avatar
      SheenaK
      Champion

      I have already converted the LiQL query to GraphQL, but our team internally can only use LiQL or SQL in their system. It appears that GraphQL is not universal to every system, whereas SQL often is, so this is probably going to be a point of frustration for a lot of people going forward.

      If anyone does learn about a workaround, I'd love to hear it.

      • NickH's avatar
        NickH
        Khoros Staff

        SheenaK see my response above, if you developers want to send over their query I'd be happy to review it. There wouldn't be any way for them to be making direct SQL queries against our database, so they are most likely making LiQL queries from the java class. If it's a liQL query its also very likely they are communicating over HTTP requests. GraphQL is a more industry standardized query language than LiQL, which is specific to Lithium Classic communities, both of which are wrapped around REST / HTTP queries to execute. Let me know if I can help review what is in use today and advise on mapping it over when the time is right (assuming the existing LiQL calls are working fine for now).