Skip to content

includeObject doesn't work #211

New issue

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

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
cantaspinar opened this issue Jul 3, 2019 · 8 comments
Closed

includeObject doesn't work #211

cantaspinar opened this issue Jul 3, 2019 · 8 comments

Comments

@cantaspinar
Copy link

cantaspinar commented Jul 3, 2019

I have the following query:

var queryBuilder = QueryBuilder<ParseObject>(ParseObject('Robot')) ..includeObject(["location"]);

However, it doesn't include the object from Location class. When I enable debug mode I get the following url:

https://parseapi.back4app.com/classes/Robot?where={}&include=location

It includes the pointer when I make a get request with a REST client. However the result I get from the plugin is different and doesn't include the pointer.

@RodrigoSMarques
Copy link
Contributor

Hi @cantaspinar
Which version?
I'm using it in version 1.0.21 with no problems.

xxxx\classes/Ad?where={"state": "ES"}&limit=1000&include=category,owner&order=createdAt
..."category":{"__type":"Pointer","className":"Categories","objectId":"6XyD5UhBRm"},"owner":{"__type":"Pointer", ...

@cantaspinar
Copy link
Author

cantaspinar commented Jul 4, 2019

Hi @RodrigoSMarques
I am using version 1.0.21 as well.
I can’t see the data in your output too. Isn’t it just a pointer? Can you access fields?

@RodrigoSMarques
Copy link
Contributor

Hi.
I do the following:

    final user = object.get<ParseUser>('owner');

    final category = object.get<ParseObject>('category');

@cantaspinar
Copy link
Author

I will try it, I assumed it hasn’t fetched the data since I can’t see the data in payload.

@RodrigoSMarques
Copy link
Contributor

Do you have a pointer or a relationship?

@cantaspinar
Copy link
Author

It is a pointer

@cantaspinar
Copy link
Author

Hi.
I do the following:

    final user = object.get<ParseUser>('owner');

    final category = object.get<ParseObject>('category');

Yeah, this works. What I was doing was converting each result to string and than map it to my own model. But it appears like you can't get full object string with pointers included without calling get method on parent object.

@srkraut
Copy link

srkraut commented Mar 31, 2020

Hello , i am having a simple problem , i have list of post with author pointer user , in list view i want to show author name from that user pointer but cant access the name , any idea ?

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants