Back

GraphQL Query.usersList issue

  • 0
  • GraphQL
  • Cloud
EniXo
8 Mar, 2024, 13:14

Hello everyone, :appwritecheers:

I'm facing an issue using GraphQL in order to retrieve information from a user from prefs field.

TypeScript
https://cloud.appwrite.io/v1/graphql
query {
    usersList {
        total
        users {
            _id
            name
            prefs {
                data
            }
        }
    }
}```
RESPONSE :
```JSON
{
    "data": {
        "usersList": {
            "total": 1,
            "users": [
                {
                    "_id": "65eb064279c82abf12ee",
                    "name": "EniXo",
                    "prefs": null
                }
            ]
        }
    }
}```
I've tried with REST and it is working find 👀 

https://cloud.appwrite.io/v1/users

TypeScript
RESPONSE (partial) :
```JSON
{
    "total": 1,
    "users": [
        {
            "$id": "65eb064279c82abf12ee",
            "name": "EniXo",
            "prefs": {
                "firstName": "Valentin",
                "lastName": "Lebarbanchon"
            },
        }
    ]
}

Are you aware of this issue or is it a miss configuration on my side ?

Thanks in advance :appwritebow:

TL;DR
Issue: Unable to retrieve information from the **prefs** field using GraphQL query `usersList`. Solution: The issue seems to be with the GraphQL query, as the response shows `prefs` as null. Consider checking the query and potential misconfigurations. Alternatively, the REST API endpoint `/users` provides the expected data.
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