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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 Bug Report: GraphQL returns arrays as objects #5299

Open
2 tasks done
stnguyen90 opened this issue Mar 29, 2023 · 2 comments
Open
2 tasks done

🐛 Bug Report: GraphQL returns arrays as objects #5299

stnguyen90 opened this issue Mar 29, 2023 · 2 comments
Labels
product / databases Fixes and upgrades for the Appwrite Database.

Comments

@stnguyen90
Copy link
Contributor

stnguyen90 commented Mar 29, 2023

👟 Reproduction steps

  1. Create a Collection with an array attribute
  2. Create a Document in that Collection
  3. Use the GraphQL API to fetch the Document

👍 Expected behavior

The array attribute should be a JSON array

👎 Actual Behavior

The array attribute is a JSON object:

image

Originally posted by @scriptsman in #5292 (reply in thread)

🎲 Appwrite version

Version 1.2.x

💻 Operating system

Windows

🧱 Your Environment

Last versions. The Android manifest file is modified correctly with the appwrite's callbacks added

👀 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?

@stnguyen90
Copy link
Contributor Author

This looks like a bug in serializing the PHP array to JSON. Since PHP doesn't differentiate between an array and an object, the data is returned as an object.

@stnguyen90 stnguyen90 added the product / databases Fixes and upgrades for the Appwrite Database. label Mar 29, 2023
@stnguyen90 stnguyen90 changed the title GraphQL returns arrays as objects 🐛 Bug Report: GraphQL returns arrays as objects Mar 30, 2023
@DiySane
Copy link

DiySane commented Oct 14, 2023

@stnguyen90 I would like to work on this. Can you please assign this to me?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
product / databases Fixes and upgrades for the Appwrite Database.
Projects
None yet
Development

No branches or pull requests

2 participants