1
Fork 0
mirror of https://github.com/Airsequel/AirGQL.git synced 2025-07-11 09:24:55 +03:00
Commit graph

52 commits

Author SHA1 Message Date
4fdbb30b5e Enable the foreign key pragma everywhere 2025-05-21 18:35:42 +00:00
Adrian Sieber
be818d626c Merge pull request from feramhq/hasura-comparison-docs-page
Support more of Hasura's syntax
2025-05-04 21:50:21 +00:00
Adrian Sieber
4ccae2adba Upgrade GHC to 9.8 and upgrade dependencies 2025-05-04 21:08:50 +00:00
71210de300 Update schema to be closer to the Hasura one 2025-04-17 13:03:44 +02:00
d54896341a Rename a few fields to match the Hasura api 2025-04-14 08:54:17 +02:00
41f1752983 Implement partial errors in grqphql API
Make it so the parent resolver returns a failed field named `foo` as
`__error_foo` containing the error message. This field can then be
picked up by the child resolver in order to produce a local error.
2025-03-10 21:38:31 +01:00
d8385cc08b Fix tiny cosmetic change 2024-12-07 20:10:48 +01:00
8b3b1bbe37 Add insertonly test
Moreover, this fixes the test for writeonly tokens, which used to create
a table in a db, and then try querying from a separate db, which ended
up not testing what it was supposed to at all.

I also changed the way mutations are guarded (the end result is pretty
much the same)
2024-12-07 20:00:09 +01:00
58e3f0bb7b Add insertonly endpoint to airgql server
I removed the `readonlyGqlPostHandler` thingy from airgql,
as it seemed to be a slightly worse version of the existing more
general gql post handler. The one difference is that it was trying
to use the readonly db directory, although the token already protected
the queries to reading only, so this didn't matter. Moreover, the
writeonly endpoint was also using the readonly directory, which seemed
like a mistake (I removed that handler as well in favour of passing the
`writeonly` access mode to the existing handler).

I also fixed a TODO, making it so the readonly airsequel-cli handler
takes the edition into account.
2024-12-07 16:47:58 +01:00
997455c3d8 Implement insert-only tokens 2024-12-07 16:30:24 +01:00
9f2888ddf5 Fix naming conflict file comment 2024-11-24 02:30:37 +01:00
d490179428 Move mutation tests into their own file & fix breaking tests 2024-11-20 03:51:40 +01:00
7a9914325d Prevent naming conflicts for _by_pk queries/mutations 2024-11-20 00:30:49 +01:00
c8a5e17f25 Implement _by_pk updates/deletes 2024-11-19 21:30:43 +01:00
4ce69aaefa Add introspection for _by_pk mutations 2024-11-19 19:18:47 +01:00
064248785e Remove another comment 2024-11-15 17:22:24 +01:00
6bae78311d Remove some unused stuff & some debugging lines 2024-11-15 17:04:17 +01:00
9088c8fd05 Remove commented out code from graphiql playground component
Also make it so `_by_pk` is only disallowed as a table suffix, not infix
2024-11-15 16:14:34 +01:00
768b711a6f Add tests for _by_pk queries 2024-11-15 14:34:36 +01:00
9cebb6dc2d Migrate all gql code to share types with introspection 2024-11-14 18:04:10 +01:00
4318c70053 Fix all tests! 2024-11-14 18:03:24 +01:00
67b37aabc5 Add basic directive support to introspection system 2024-11-14 18:03:23 +01:00
3322705709 Fix nullity of fields in update gql query 2024-11-14 18:03:23 +01:00
562214db98 Fix (most) introspection airgql tests
The only one that's still failing is one related to directives, which I
will fix in another commit soon(ish)
2024-11-14 18:03:08 +01:00
346a0e017c Split off introspection tests into their own file 2024-11-14 18:01:56 +01:00
c5fbeee8bd Add docs to standard graphql types 2024-11-14 18:01:56 +01:00
c161fbd288 Do not allow views to be mutated 2024-11-14 18:01:56 +01:00
2ee5152d54 Implement querying by PK
- I realised by PK querying doesn't need arguments like filter, limit or
offset, so I removed the argument name collision logic I added in the
last commit
- I implemented the actual logic for querying by PK. The code is a lot
shorter due to the new introspection system
- I moved the normal queries to the new introspection system for
consistency.
- I moved the logic of "coerce columns without a datatype" away from the
resolver and into the "sql -> gql" converter as to be able to reuse the
default introspection resolver which simply looks up fields into the
parent resolver's result.
- I added some comments documenting the Introspection.Resolver stuff and
it's behaviour
2024-11-14 18:01:55 +01:00
8febe6be43 Implement introspection for by_pk queries
- Make column names containing "_by_pk" disallowed on the client side (I
technically already did that on the server side with the previous
commit, but this makes it nicer)
- Implement the actual introspection logic
- If a primary key has a "reserved" argument name (i.e. a name we use
for built in airsequel arguments) like "filter" or "limit", then we
rename that to pk from <name> to <name>_. This might technically still
create collisions in the rare case where both <name> and <name>_ are
columns that are part of the same primary key, but I don't think that
matters in practice. The hasura playground doesn't seem to do any
renaming (I tried it in the playground), so we could also not do that at
all I guess...
2024-11-14 18:01:55 +01:00
8894f14002 Detect primary key constraints properly
So far we were going off the primary_key flag given to us by sqlite, but
this flag is only set to true for one column when using multi-column
primary keys.

Moreover, this commit also implements a `isRowid` property on
`ColumnEntry`, which is both there for convenience, and to reuse the
"proper" (i.e., taking into account rowid columns named _rowid_) rowid
detection logic.
2024-11-14 18:01:55 +01:00
ccf518c9eb Make introspection work with new graphiql verison 2024-11-14 18:01:55 +01:00
41a459fe09 Update graphiql & implement simpler introspection system 2024-11-14 18:01:55 +01:00
81018cd481 Fix typo 2024-10-01 02:39:50 +02:00
5394fcd9bc Explain what the "database or disk is full" error means to the user 2024-10-01 02:30:47 +02:00
faf63f0c6d Fix "database or disk is full" errors 2024-10-01 02:30:47 +02:00
d3378c7ecd Ensure sql names are always quoted properly 2024-10-01 02:02:19 +02:00
0d52017745 Add backend tests for reference following 2024-10-01 01:09:46 +02:00
cb0127ddd1 Implement main reference following mechanism on the backend 2024-10-01 01:09:46 +02:00
5372e9253c Add "goto reference" icon to frontend 2024-10-01 01:09:46 +02:00
449d6c84ff Bump sqlite parser 2024-09-04 23:26:40 +02:00
e8de9440e2 Expose sql query handler to fix tests 2024-07-25 00:49:08 +02:00
4350c1f539 Do not allow WITHOUT ROWID columns
PR: 
2024-07-21 00:16:34 +02:00
529573b675 Mark non-null gql query output fields as such 2024-07-20 21:58:05 +00:00
Adrian Sieber
94556eaca5 Improve wording 2024-07-10 23:18:40 +02:00
84a6c44abf Remove sql => gql blob conversion 2024-07-09 19:24:41 +02:00
f4323b661b Fix BLOB display in query tab 2024-07-09 19:18:02 +02:00
ad679d32ca Fix tests after previous change 2024-05-27 14:18:20 +02:00
3cef611c85 Mark primary keys as UNIQUE 2024-05-27 12:56:07 +02:00
6cf584e58a Mark omittable fields as optional in introspection. 2024-05-27 12:42:05 +02:00
51bf1ebd4d Tweak introspection to reflect previous change 2024-05-04 00:27:26 +02:00