Hi.
export const UserEdit = props => {
return (
<Edit {...props}>
<SimpleForm>
<DisabledInput source="id" />
<TextInput source="name" />
<ReferenceManyField
reference="Customer"
target="userId"
>
<Datagrid>
<TextField source="organizationName" />
</Datagrid>
</ReferenceManyField>
</SimpleForm>
</Edit>
);
}
It was expected that the record would be returned as in the documentation.
The query filter gets an object in the object, which prevents you from working further.
expected filter:
variables: {filter: {userId:"cjoa0w1z5005y0b91ka78ug3r"}}
Here's what gets into Request payload:
{operationName: "allCustomers", variables: {filter: {id: {id: "cjoa0w1z5005y0b91ka78ug3r"}}},…}
operationName: "allCustomers"
query: "query allCustomers($filter: CustomerFilter) {↵ items: allCustomers(filter: $filter) {↵ id↵ type↵ organizationName↵ organizationInn↵ payment↵ __typename↵ }↵ total: _allCustomersMeta(filter: $filter) {↵ count↵ __typename↵ }↵}↵"
variables: {filter: {userId: {id: "cjoa0w1z5005y0b91ka78ug3r"}}}
filter: {userId: {id: "cjoa0w1z5005y0b91ka78ug3r"}}
userId: {id: "cjoa0w1z5005y0b91ka78ug3r"}
id: "cjoa0w1z5005y0b91ka78ug3r"
the response from the server:
operationName: null
link.js:48
variables:
link.js:49
{
link.js:50
"_v0_where": {
"AND": [
{
"userId_contains": "[object Object]"
}
]
},
"_v1_orderBy": "id_ASC"
}
- React-admin version: 2.4.2
- Last version that did not exhibit the issue (if applicable):
- React version:16.5.2
- Browser: Chrome 70.0.3538.110
- Use: ra-data-graphql-simple
Hi.
It was expected that the record would be returned as in the documentation.
The query filter gets an object in the object, which prevents you from working further.
expected filter:
variables: {filter: {userId:"cjoa0w1z5005y0b91ka78ug3r"}}
Here's what gets into Request payload:
the response from the server: