-
Notifications
You must be signed in to change notification settings - Fork 127
Open
Labels
GraphQL APIRelated to the API (GraphQL) category/pluginsRelated to the API (GraphQL) category/pluginsapifeature-requestRequest a new featureRequest a new feature
Description
How did you install the Amplify CLI?
npm
If applicable, what version of Node.js are you using?
v18.15.0
Amplify CLI Version
11.0.3
What operating system are you using?
Windows
Did you make any manual changes to the cloud resources managed by Amplify? Please describe the changes made.
No manual changes.
Describe the bug
I have a schema like this:
type Baby
@model
@auth(rules: [
{allow: owner, ownerField: "caregivers", operations: [create, read, update, delete]}
]) {
id: ID!
caregivers: [String]!
...
}
When attempting to subscribe to updates to the model like this (android, kotlin):
Amplify.API.subscribe(
ModelSubscription.onUpdate(Baby::class.java),
/* onSubscriptionEstablished = */ { ... },
/* onNextResponse = */ {
if (it.errors.isNotEmpty()) {
Log.e("error response from baby update subscription", it.errors.toString())
} else {
...
}
},
/* onSubscriptionFailure = */ { ... },
/* onSubscriptionCompleted = */ { ... })I get this response:
[GraphQLResponse.Error{message='Validation error of type UnknownArgument: Unknown field argument caregivers @ 'onUpdateBaby'', locations='null', path='null', extensions='null'}]
Expected behavior
Log.e should never be called. And, it should wait to call onNextResponse until there is an actual update to the model.
Reproduction steps
- Create an API with the schema above.
- Try to subscribe as above.
Project Identifier
No response
Log output
No response
Additional information
No response
Before submitting, please confirm:
- I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
- I have removed any sensitive information from my code snippets and submission.
Metadata
Metadata
Assignees
Labels
GraphQL APIRelated to the API (GraphQL) category/pluginsRelated to the API (GraphQL) category/pluginsapifeature-requestRequest a new featureRequest a new feature