ReferenceInput with graphql not populating data on react admin

Viewed 50

i have a graphql query where i want to edit my customers to another partner: below is the return graphql data i get back, so in this case i wish to edit Customer of id "1n" to partners of "2n"

{
  "data": {
    "getCustomer": {
      "id": "1n",
      "name": "customer A",
      "partner_id": "1n",
      "Partner": {
        "id": "1n",
        "name": "partner andrew"
      }
    },
    "listPartners": [
      {
        "id": "1n",
        "name": "partner andrew"
      },
      {
        "id": "2n",
        "name": "partner joseph"
      }
    ],
    "getPartner": {
      "id": "1n",
      "name": "partner andrew"
    }
  }
}

the customerEdit is as shown:

export const CustomerEdit = (props:any) =>{

return (


    <Edit {...props}>
        <SimpleForm>
            <TextInput disabled label="id" source="id"/>
                <ReferenceInput reference="partners" source="partner_id" label="Partner Name" >
                    <SelectInput optionText="name"/>
                </ReferenceInput>
            <TextInput label="name" source="name" />
        </SimpleForm>
    </Edit>)
}

App.tsx - some lines

      <Resource name="Partners" list={PartnersList} edit={PartnerEdit} create={PartnerCreate} icon={UserIcon} />
      <Resource name="Customers" list={CustomersList} edit={CustomerEdit} create={CustomerCreate}icon={UserIcon} />

i was able to see the api call to list the relevant Partners which according to the docs is the list enter image description here

and i also see the corresponding getPartner through getMany call from the docs enter image description here

however my simple form doesnt show any option, any help?

enter image description here

1 Answers

ok it was a bug on the Customer API where it did not display some graphql data points when theres a bug for that particular query. after fixing it the display was able to render.

Related