Array of objects in a mutation using Schema build – Graphql – Problem

Array of objects in a mutation using Schema build – Graphql – Problem

My problem is that, i make a mutation to update company profile, but when I put the networks field I get an error.
I am using buildSchema.
type Network {
name: String
url: String
}

input UpdateCompanyInput {
name: String
networks: [Network]
}

When i try it in GraphiQL:
mutation {
updateCompanyProfile(updateCompanyInput: {name: “Test”}) {
name
}
}

I got this error:
{
“errors”: [
{
“message”: “The type of UpdateCompanyInput.networks must be Input Type but got: [Network].”,
“locations”: [
{
“line”: 95,
“column”: 13
}
]
}
]
}

Thanks!

Solutions/Answers:

References

Loading...