Back

I can't get to access document list from appwrite functions in dart

  • 0
  • Databases
  • Functions
paritodev
20 Feb, 2024, 08:38

I'm absolutely new to appwrite and flutter and dart, I quite literally started playing with appwrite today a few hours ago and flutter and dart a month or so ago.

I'm trying to make a function that read and write the database based on some external server calls. I added some boilerplate documents in the database for testing purposes and started writing the logic.

I was initially trying to do some query but kept getting a blank response so I removed the query and most of the logic and kept this very simple test code but it also return nothing from the database, I'm not sure if there's something very obviously wrong in the code below that can cause this that I don't catch.

In the picture is the whole code as long as the response I keep getting.

I'm not sure how to properly debug this issue, my main point of interest is about how to verify that the function actually talk to the API, What I have tried :

  • Initially, the project id and key were set in environment variables, I instead copied them directly and pasted them as strings directly into the code.
  • Similarly, I wrote databaseId and collectionId directly as strings for testing purposes
  • I double checked them multiple times to verify there was no mixup.

Please, can anyone help?

TL;DR
Developers having trouble accessing document lists from appwrite functions in Dart. Despite adjusting API key permissions and collection permissions, the issue persists. The code seems correct, but responses from the database are blank. Debugging attempts include setting variables directly in the code and verifying them. Looking for guidance on verifying API communication.
paritodev
20 Feb, 2024, 08:58

Also, to add to this:

  • the API key was initially scopped to document read and write only but I then have it full access to everything, including database read and write but that didn't change anything as well.
  • Permission for read & write are given to any for the collection I'm trying to access

Neither of which solve the issue

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more