Skip to content

I think Relation doesn't work. #416

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

Closed
facuparedes opened this issue Aug 12, 2020 · 0 comments
Closed

I think Relation doesn't work. #416

facuparedes opened this issue Aug 12, 2020 · 0 comments

Comments

@facuparedes
Copy link
Contributor

facuparedes commented Aug 12, 2020

Hi! I'm trying to use Parse Server in my new app. I have the following db schema:

image

As you can see, class Chats has columns: Users (a Relation), and Messages (another Relation). However, when I try to do a simple request:

ParseResponse res = await ParseObject('Chats').getAll();
print(res.results);

I get the following log:

Payload: [{"className":"Chats","objectId":"lr6D880lmt","createdAt":"2020-08-11T22:46:51.609Z","updatedAt":"2020-08-12T05:36:36.234Z","users":{"__type":"Relation","className":null,"objects":null},"messages":{"__type":"Relation","className":null,"objects":null}}]

Pay attention to "users" and "messages" response. Both returns "className":null. That should not happen. At least, with JS and Node.JS, I don't get any "null" value.

Furthermore, I need to get Chats class filtered by 'email' column from Users on 'user' column. And get all messages from 'messages' column.

So, I tried get all messages with:

ParseObject obj = (await ParseObject('Chats').getAll()).results[0];

ParseRelation rel = obj.getRelation('messages');

rel.getQuery().query().then((value) => print(value.results));

However, I got this Parse Request:

I/flutter ( 6813): ╭-- Parse Request
I/flutter ( 6813): curl -X GET -H 'user-agent: Flutter Parse SDK 1.0.26' -H 'X-Parse-Application-Id: **************' -H 'X-Parse-Master-Key: **************' https://parseapi.back4app.com/classes/null?where=%7B%7D
I/flutter ( 6813):
I/flutter ( 6813):  https://parseapi.back4app.com/classes/null?where={}
I/flutter ( 6813): ╰--

As u can see, request's url is: classes/null, so obviously, I got a null response:

I/flutter ( 6813): ╭-- Parse Response
I/flutter ( 6813): Class: null
I/flutter ( 6813): Function: ParseApiRQ.query
I/flutter ( 6813): Status Code: 200
I/flutter ( 6813): Reponse: OK
I/flutter ( 6813): ╰--

Can you help me ?

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

No branches or pull requests

1 participant