[Bug]: The variables input contains a field name 'modules' that is not defined for input object type 'UpdateRoomInput'
See original GitHub issueI am getting this error while updating the form of modules resource.
Here’s my schema
type Room
@model
@key(name: "customerIndex", fields: ["customerId"], queryField: "listRoomsByCustomerId")
@auth(rules: [
{ allow: groups, groupsField: "customerId" },
{ allow: groups, groups: ["Admin"] }
]){
id: ID!
customerId: ID! # This will be retrieved by scanning
name: String!
type: RoomType!
modules: [Module] @connection(keyName: "byRoom", fields: ["id"])
}
type Module
@model
@key(name: "byRoom", fields: ["roomId"], queryField: "listModulesByRoomId")
@auth(rules: [
{ allow: groups, groupsField: "customerId" },
{ allow: groups, groups: ["Admin"] }
]){
id: ID! # This will be retrived by scanning
roomId: ID!
customerId: ID!
room: Room @connection(fields: ["roomId"])
appliances: [Appliance] @connection(keyName: "byModule", fields: ["id"])
}
And here’s my RoomEdit script:
function RoomEdit(props) {
return (
<RA.Edit {...props}>
<RA.TabbedForm>
<RA.FormTab label="Summary">
<RA.TextInput disabled label="Id" source="id"/>
<RA.TextInput disabled label="Customer ID" source="customerId"/>
<RA.TextInput label="Name" source="name"/>
<RA.SelectInput
source="type"
choices={[
{id: "LivingRoom", name: "Living Room"},
{id: "BedRoom", name: "Bed Room"},
{id: "Kitchen", name: "Kitchen"},
{id: "BathRoom", name: "BathRoom"}
]}
/>
</RA.FormTab>
<RA.FormTab label="Modules">
<RA.ReferenceManyField reference="modules" target="roomId" addLabel={false}>
<RA.Datagrid>
<RA.TextField source="id"/>
<RA.DateField source="createdAt"/>
<RA.DateField source="updatedAt"/>
<RA.EditButton/>
</RA.Datagrid>
</RA.ReferenceManyField>
</RA.FormTab>
</RA.TabbedForm>
</RA.Edit>
);
}
export default RoomEdit;
I am not sure why am I getting this error. Am I doing anything wrong or Is it a bug in the library?
Issue Analytics
- State:
- Created 3 years ago
- Comments:10 (4 by maintainers)
Top Results From Across the Web
AWS Amplify: The variables input contains a field name that is ...
I ran into this problem with a Lambda function and found that in order to pass in the correct user properties (owner) I...
Read more >Error on mutation with new GraphQL Helpers #1399 - GitHub
The variables input contains a field name 'userTalesId' that is not defined for input object type 'CreateTaleInput'.
Read more >graphql/type
The graphql/type module is responsible for defining GraphQL types and schema. ... An input object type within GraphQL that represents structured inputs.
Read more >AWS-Amplify/Lobby - Gitter
I get an error: The variables input contains a field name 'task' that is not defined for input object type 'CreateAssignmInput''. I have...
Read more >graphql-transformer-core - npm
Define a GraphQL object type and annotate it with the @model directive to store objects ... on OBJECT input AuthRule { allow: AuthStrategy!, ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
OK maybe you need to remove the modules field when submitting the form. Try with transform attribute, something like:
yeah, it solved the problem. Thanks.