Skip to content
This repository has been archived by the owner on Apr 10, 2020. It is now read-only.

API is not returning all messages in conversation #6

Open
ggros opened this issue May 15, 2019 · 1 comment · May be fixed by #14
Open

API is not returning all messages in conversation #6

ggros opened this issue May 15, 2019 · 1 comment · May be fixed by #14

Comments

@ggros
Copy link

ggros commented May 15, 2019

when calling getConvo, the messages returned are filtered with author==currentUser
Thus once we close the conversation and re-open later, we can only see our own messages.

Issue is due to the @auth in the graphql schema filtering the "type Message"
I would suggest to leave the read open as there are no direct query on Message, always thru connections

type Message 
  @model(subscriptions: null, queries: null) 
  @auth(rules: [{ allow: owner, ownerField: "authorId", operations: [create, update, delete]}]) {
  id: ID!
  author: User @connection(name: "UserMessages", keyField: "authorId")
  authorId: String
  content: String!
  conversation: Conversation! @connection(name: "ConvoMsgs")
  messageConversationId: ID!
	createdAt: String
	updatedAt: String
}
@swyxio
Copy link

swyxio commented Dec 25, 2019

tested this and it works. great fix! sending in a PR

swyxio added a commit to swyxio/aws-appsync-chat that referenced this issue Dec 25, 2019
allow open reads on Messages, solves amazon-archives#6
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants