appwrite / sdk-for-web

[READ-ONLY] Official Appwrite Web SDK ๐Ÿงก
https://appwrite.io
BSD 3-Clause "New" or "Revised" License
286 stars 61 forks source link

๐Ÿ› Bug Report: OrderAsc throws Server Error #101

Closed NickHatBoecker closed 2 weeks ago

NickHatBoecker commented 1 month ago

๐Ÿ‘Ÿ Reproduction steps

In my app I have a list of database entries. With sdk-for-web@13.0.0 the following query works without errors. But with sdk-for-web@15.0.0 an errors occurs.

import { Databases, Query } from 'appwrite'

const databases = new Databases(...)

const { documents } = await databases.listDocuments('myapp', 'mytable', [
    Query.orderAsc('title'),
])

Looking at the docs nothing has changed regarding the Query.orderAsc function: https://appwrite.io/docs/products/databases/order#one-column

๐Ÿ‘ Expected behavior

Should return an array of objects.

๐Ÿ‘Ž Actual Behavior

GET /v1/databases/lyricly/collections/lyrics/documents?queries%5B0%5D=%7B%22method%22%3A%22orderAsc%22%2C%22attribute%22%3A%22songtitle%22%7D 500 (Internal Server Error)

client.ts:440 Uncaught (in promise) AppwriteException: Server Error at Client. (http://localhost:5173/node_modules/.vite/deps/appwrite.js?v=b1d84f26:419:17) at Generator.next () at fulfilled (http://localhost:5173/node_modules/.vite/deps/appwrite.js?v=b1d84f26:13:24)

๐ŸŽฒ Appwrite version

Version 1.4.9

๐Ÿ’ป Operating system

Linux

๐Ÿงฑ Your Environment

No response

๐Ÿ‘€ Have you spent some time to check if this issue has been raised before?

๐Ÿข Have you read the Code of Conduct?

stnguyen90 commented 2 weeks ago

@NickHatBoecker, thanks for creating this issue! ๐Ÿ™๐Ÿผ

This is expected because Version 15 of the SDK is meant for Appwrite 1.5. See https://github.com/appwrite/sdk-for-web/blob/15.0.0/README.md?plain=1#L9