C# GraphQL Error InsertMany

Hello I’m using GraphQL in a C# app to insert records. If I copy my mutation into the GraphQL editor in the mongo realm tab it works fine. But running the query with

await client.SendQueryAsync(request)

give me this error

reason=“insert not permitted for document with _id: ObjectID(“6195356b084421da0fb1dd55”)”; code=“ArgumentsNotAllowed”; untrusted=“insert not permitted”; details=map[]

My GraphQL query is:

mutation {
insertManyMyType(data: [{_id:“6195356b084421da0fb1dd55”,
myTypeGuid:“a18dd551-34b0-47be-a1d4-b393a785e70e”,
partition:“1”,
dataHubVersion:“1521069293”,
createDateTimeStamp:“2017-09-28T00:43:01.91Z”}]
)
{
insertedIds
}}

I’m able to insert one record successfully with the single mutation insertOneMyType in the C# app fine so it’s not a permission issue.

Thanks,

Tam

1 Like

Nevermind I found the issue my InsertMany was trying to insert a record for a partition I didn’t have access to. I’ll leave this post here though to help if anyone else has the same error.

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.