DeltaSync-Update function in SubscriptionQuery is never called
I am implementing my own Sync object as I am working with connectionModels. Everything works fine with the BaseQuery and DeltaQuery objects. however when I do a mutation, I expect the update function from the SubscriptionQuery object to be called and then be able to update my queries according the most recent data, however this never happens. the update function is never called. I am working with this client https://github.com/awslabs/aws-mobile-appsync-sdk-js, i tried to debug the code but couldn't find any information.
This is how is my code as referenced on the amplify documentation https://aws-amplify.github.io/docs/js/api#delta-sync & the types detailed in the code https://github.com/awslabs/aws-mobile-appsync-sdk-js/blob/997e3d8a958ee2e2d9ffd00fd1eaf20e11343c98/packages/aws-appsync/src/client.ts#L275
subscriptionQuery: {
query: gql(onSubscription),
variables: {
id: { "eq": this.id},
},
update: (store, {data}) => {
console.log(data);
console.log(store);
}
},
Also I created a standard subscription, to check if the issue was on the backend but no, the subscription worked fine with the following code
this.randomSubscription = await this.client.subscribe({
query: gql(onSubscription),
variables: {
id: { "eq": this.id},
},
}).subscribe({
next: (data) => {
console.log(data);
},
error: error =>{
console.log('ERROR----->',error)
}
});
I would really appreciate your feedback on this issue.
Had an issue with GraphQL schema. On subscriptions I am not using filters, just plain variables, so the variables object of the subscriptionQuery was wrong.
Relevant questions
CloudFront Distribution not serving S3 Bucket pages unless /index.html included in URL
asked 3 months agoAccess denied when trying to GET objects uploaded to s3 bucket via aws sdk using cloudfront
Accepted Answerasked 6 months agoDeltaSync-Update function in SubscriptionQuery is never called
asked 3 years agoAWS Console Build Problem
asked 3 years agoSession not refreshing tokens
asked 2 years agoBuild-in Object Detection Algorithm and Sagemaker Neo
asked 3 years agoS3 Select Metadata query
Accepted Answerasked 3 years agoHow do I define a SQLite expression in DynamoDB 'object-mapping' DMS migration task?
asked 23 days agoUnable to create AmazonS3 object from builder in Lambda
asked 4 months agoHow do I restore deleted files in S3?
asked 2 months ago