Rank 2: Process
I attempted to batch multiple document deletion operations into a single GraphQL request, as shown in the following code:
Votes
0
Replies
11
Participants
Unknown
Messages
12
Rank 2: Process
I attempted to batch multiple document deletion operations into a single GraphQL request, as shown in the following code:
Rank 2: Process
queries = []count = 0
for message_id in body["delete"]: temp = {} count += 1 query = ( f"mutation DeleteDocument{count}" + """($databaseId: String!, $collectionId: String!, $documentId: String!){ databasesDeleteDocument( databaseId: $databaseId, collectionId: $collectionId, documentId: $documentId ) { status } } """ ) variables = { "databaseId": "651f17af2552b5dc8126", "collectionId": "651f17d6a1d4cdf7c76a", "documentId": "{}".format(message_id), }
temp["query"] = query temp["operationName"] = f"DeleteDocument{count}" temp["variables"] = variables queries.append(temp)result = graphql.mutation(queries)print(f"result = > {result}")for re in result: print(re)```Rank 2: Process
However, it only deleted one document and returned a single response. Is this issue caused by the Appwrite GraphQL Delete operation? I ask because I tried a different operation, like batching many create operations, and it worked. So, what is the problem and how can I solve it in the GraphQL batching?
Btw, it's best to use 3 back ticks with multi-line code. See https://www.markdownguide.org/extended-syntax/#syntax-highlighting
Rank 2: Process
??
What exactly was the full response?
Rank 2: Process
It just return one response of deleting one message only:
b''
hmmmm this is sort of expected....the regular deleteDocument() doesn't return anything
Rank 2: Process
Does deleting a document disrupt the GraphQL request, and is this the reason for only deleting one document only?
Rank 2: Process
??
As far as I know, it shouldn't
Rank 2: Process
So why does it delete only one document and return a single response for all queries?