Instant GraphQL APIs on SQLite with Turso
What can the Hasura Turso connector do?
What capabilities does the Hasura Turso connector have?
query Query {
turso_album {
albumId
artistId
title
}
}
query Query {
simple_predicate: turso_album(where: {albumId: {_eq: 10}}) {
albumId
artistId
title
}
and_predicate: turso_album(
where: {_and: [{albumId: {_gt: 1}}, {albumId: {_lte: 2}}]}
) {
albumId
artistId
title
}
}
query Query {
order_by: turso_album(order_by: {albumId: Desc}) {
albumId
artistId
title
}
paginate: turso_album(offset: 10, limit: 10) {
albumId
artistId
title
}
}
query Query {
complex_query: turso_album(
limit: 10
offset: 10
order_by: {albumId: Desc}
where: {_or: [{albumId: {_lt: 10}}, {albumId: {_gt: 20}}]}
) {
albumId
artistId
title
}
}
query Query {
relationship_query: turso_album {
albumId
title
artist {
artistId
name
}
tracks {
trackId
name
}
}
}
query Query {
relationship_filter_query: turso_album {
albumId
title
tracks(
limit: 10
order_by: {trackId: Desc}
where: {name: {_like: "%Spellbound%"}}
) {
trackId
name
}
}
}
query Query {
relationship_predicate_query: turso_album(
where: {tracks: {name: {_like: "%Spellbound%"}}}
) {
albumId
title
tracks {
trackId
name
}
}
}
mutation Mutation {
turso_insertAlbumOne(object: {albumId: 1000, artistId: 10, title: "New Album"}) {
albumId
artistId
title
}
}
mutation Mutation {
turso_updateAlbumByPk(
pkColumns: {albumId: 1000}
set: {title: "The New Album"}
inc: {artistId: 1}
) {
albumId
artistId
title
}
}
mutation Mutation {
turso_deleteAlbumByPk(pkColumns: {albumId: 1000}) {
albumId
artistId
title
}
}
Conclusion
Related reading