
Hello,
I was wondering the best way to strongly type using typescript the return type of listDocuments
etc. Is the below correct or is there a better way to do this/generate types?
type Test = {
name: string
} & Models.Document
const result = await databases.listDocuments<Test>()
result.documents[0].name
Thank you

How to type the documents that come back using typescript

There's currently no support for this but there's this tool if thats of any help (haven't tried personally though) - https://discord.com/channels/564160730845151244/837593904952901634/1292063850371350560
Recommended threads
- Relationship performance between collect...
Say I have a collection of "teachers" and "students" where a teacher has a relationship-attribute to asign multiple students to one teacher. When I fetch data...
- Getting CORS error for GraphQL query on ...
Getting CORS error when making GraphQL queries using Appwrite's SDK in Next.js (client-side). Login/signup works fine. Only GraphQL is failing on both localhost...
- Looking for Guidance: GraphQL + Relation...
Hey everyone! đź‘‹ I'm building a project using Next.js and exploring different backend options. I want to set up a proper backend with GraphQL and support for tw...
