Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃殌 Feature: Export Typescript interfaces for collections #5441

Open
2 tasks done
HannesPaa opened this issue Apr 27, 2023 · 10 comments
Open
2 tasks done

馃殌 Feature: Export Typescript interfaces for collections #5441

HannesPaa opened this issue Apr 27, 2023 · 10 comments
Assignees
Labels
enhancement New feature or request product / databases Fixes and upgrades for the Appwrite Database.

Comments

@HannesPaa
Copy link

馃敄 Feature description

For each collection there is a button to download a typescript interface not just with the normal "Document Object" Types, but with all attributes.
For example:

interface collection1 = {
    "$id": string,
    "$collectionId": string,
    "$databaseId": string,
    "$createdAt": string,
    "$updatedAt": string,
    "$permissions": string[],
    "attribute1": string,
    "attribute2": int,
    "attribute3": Boolean
}

or

interface collection2 extends Models.Document = {
    "attribute1": string,
    "attribute2": int,
    "attribute3": Boolean
}

馃帳 Pitch

The benefits of Typescript are obviously great, especially when working with data.
When i want to work with data from Appwrite i must be sure that i don't mix up types, so i often make my own interfaces. This feature would save some work and make sure that there are no errors in the interfaces.

馃憖 Have you spent some time to check if this issue has been raised before?

  • I checked and didn't find similar issue

馃彚 Have you read the Code of Conduct?

@Vishrut19
Copy link

Can I try to work on this issue?

@christyjacob4
Copy link
Member

@HannesPaa this is a nice idea, It would be beneficial to have this support not just for typescript but also for other languages and frameworks like java, kotlin, dart etc.

@joeyouss joeyouss assigned joeyouss and unassigned joeyouss May 1, 2023
@joeyouss
Copy link

joeyouss commented May 1, 2023

Sure @Vishrut19 go for it

@fliitor
Copy link

fliitor commented May 2, 2023

FYI we are working on a typescript abstraction layer for all appwrite configuration, which serves as a reference base (appwrite.json much more accomplished) with automatic typing, base schema update, tsx export, etc... It is currently used for our internal needs, we are optimizing it and in a few months we will probably make it available

@Vishrut19
Copy link

So, should I work on this issue or not?

@ShayanAliProgrammar
Copy link

This feature should be implemented as soon as possible

@joeyouss
Copy link

Good to know @fliitor , how is it going now with the the layer?

@joeyouss
Copy link

Also @Vishrut19 , this issue was assigned to you to work on, please let us know any updates : )

@joeyouss joeyouss added product / databases Fixes and upgrades for the Appwrite Database. feature labels Aug 24, 2023
@Vishrut19
Copy link

Can someone suggest me where I need to make changes, like in which file or in which folder should I look for? @joeyouss if possible please help

@fliitor
Copy link

fliitor commented Sep 25, 2023

Good to know @fliitor , how is it going now with the the layer?

We abandoned the idea of making it accessible because the code had become too specific to our needs.

However, it is possible to use codegen to generate tsx from graphql

@stnguyen90 stnguyen90 added enhancement New feature or request and removed feature labels Mar 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request product / databases Fixes and upgrades for the Appwrite Database.
Projects
None yet
Development

No branches or pull requests

7 participants