News for hackers. Stuff that matters.
Re:Tuql: Automatically create a GraphQL server from a SQLite... by codethief on Wednesday April 26, 2023 @10:18AM (#35714046)
Very cool, though I'm not sure how production-ready this is, given that there doesn't seem to be a way to add authorization for certain fields / queries.

Also, does the generated schema include the primary keys? Otherwise caching in the frontend might turn out to be difficult.

Re:Tuql: Automatically create a GraphQL server from a SQLite... by runlaszlorun on Wednesday April 26, 2023 @10:52AM (#35714565)
Which graphql frameworks do handle auth? It’s a genuine question, I don’t know the space but had to rule out graphql in its early days for a seeming lack in this area. But I’ve got a project now where it might be a great fit.
Re:Tuql: Automatically create a GraphQL server from a SQLite... by amichal on Wednesday April 26, 2023 @11:10AM (#35714908)
Hasura has authz this (but ive only used it it toy situations) authn is jwt or custom integration https://hasura.io/docs/latest/auth/authorization/permissions...

Edit: roles via jwt token https://hasura.io/docs/latest/auth/authentication/jwt/

Re:Tuql: Automatically create a GraphQL server from a SQLite... by codethief on Wednesday April 26, 2023 @10:58AM (#35714682)
Authorization is usually not handled by a GraphQL framework. You typically have a business layer between your GraphQL API and your database. (And probably some basic JWT authentication layer in front of your API. Notice the difference between authorization & authentication.)
Re:Tuql: Automatically create a GraphQL server from a SQLite... by runlaszlorun on Wednesday April 26, 2023 @01:31PM (#35717274)
Sorry, yes, I meant authorization. So you're saying to just effectively run a filter in the business layer based on allowed role/user/whatever. Seems pretty straightforward but I wonder if I'm missing something.
Re:Tuql: Automatically create a GraphQL server from a SQLite... by codethief on Wednesday April 26, 2023 @02:37PM (#35718122)
> run a filter in the business layer based on allowed role/user/whatever

Yup, this is the way I've seen it implemented everywhere so far.

Re:Tuql: Automatically create a GraphQL server from a SQLite... by jensneuse on Wednesday April 26, 2023 @01:01PM (#35716831)
You could use WunderGraph in front of your GraphQL and REST APIs to add auth, e.g. using OpenID Connect: https://docs.wundergraph.com/docs/auth/cookie-based-auth/ope...
Re:Tuql: Automatically create a GraphQL server from a SQLite... by bradleyboy on Wednesday April 26, 2023 @11:02AM (#35714758)
Hey - I'm the author of tuql (if you can still call it authorship, I haven't updated this library in a long time :) )

I originally wrote this to speed up prototyping / development projects, I'd never recommend shipping this anywhere near production.