Skip to content

I think Relation doesn't work. #416

Closed
@facuparedes

Description

@facuparedes

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 ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions