Reputation: 73
I need to enter multiple Ids to a field in my mutations. How can I achieve that seeing array is not included in the scalar type. I'm using Laravel lighthouse
package.
I have tried to use []
to pass in the Ids but not working.
mutation{
syncPermissions(roleId: 1 permissions: [1, 2, 3]){
name
}
}
I expect to access the permissions (in this case Ids) as an array in my resolve method.
Upvotes: 2
Views: 1530
Reputation: 358
You simply wrap the type in []
, in your schema.
Example:
extend type Mutation {
syncPermissions(roleId: Int!, permissions: [Int!])
@field(resolver: "MyResolver@update")
}
Upvotes: 2