You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{"query": "subscription { CartReadModel(id:\"demo\") { id items } }" }
but removing the id, as I don't need to filter through id but getting all of the Messages available.
In this case, it returns an error saying that the ID is mandatory to perform the query
argument id of type ID is required but it was not provided
If I try to set the ID as optional in the ReadModel declaration, it shows an error, as the ReadModel decorator requires it
At this point, how is it possible to subscribe to all of the updates without that id??
The text was updated successfully, but these errors were encountered:
When retrieving several items, we shall use the right query. You can see them in the GraphQL schema
You can easily grab the schema through postwoman https://postwoman.io/graphql
{"query": "subscription { MessageReadModel { id body } }" }
The response I get is:
[RECEIVED]: {"errors":[{"message":"Field \"MessageReadModel\" argument \"id\" of type \"ID!\" is required, but it was not provided.","locations":[{"line":1,"column":16}]}]}
I tried getting the schema and it says that ID is mandatory, as the response. So, how can I get all of the MessageReadModels?? I mean, without setting that id
And also, removing the ID from the ReadModel declaration is not a possibility, as the ReadModel decorator needs it
I got to make it work. In my case the query was wrong, as I have to get MessageReadModels, note the 'S' at the end. Apart from that, I needed to set the filter. The final query that worked for me was
{"query": "subscription { MessageReadModels(id: {
operation: notEq
values: []
})
{
id
body
}
}" }
Submitted by @carlosper88 in Spectrum
The text was updated successfully, but these errors were encountered: