Closed rudyhadoux closed 4 years ago
Hi @rudyhadoux
Can you tell what is the error you are getting when you said schema is rejected?
Also can you tell how did you setup your API so that I can reproduce this?
The schema failed after compilation without explanation. Cognito user pool is the default auth mode.
I have an Api key and a Cognito user pool. And storage for other objects.
I have other Amplify web apps workîng but with only a Cognito user pool.
I do not know if in my Angular web app i must have two appsync clients or if the schéma.graphql configuration is enough.
Hi @rudyhadoux
You can change your Type Query to either remove arguments from the listUsers like below:
type Query {
listUsers: [User]
@aws_api_key
}
or you can put some arguments in your query:
type Query {
listUsers(id : ID!): [User]
@aws_api_key
}
Let me know if this solve for issue.
The schema.graphql was wrong.
That is the good one.
type User @model(subscriptions: { level: public }) @key(name: "userByUsername", fields: ["username"], queryField: "userByUsername") @auth( rules: [ { allow: public, operations: [read] } { allow: private, operations: [read, create, update, delete] } ] ) { id: ID! username: String! online: Boolean conversations: [Conversation] @connection(name: "UserConversations") @auth(rules: [{ allow: private, operations: [read, create, update, delete] }]) createdAt: String updatedAt: String }
This issue has been automatically locked since there hasn't been any recent activity after it was closed. Please open a new issue for related bugs.
Looking for a help forum? We recommend joining the Amplify Community Discord server *-help
channels for those types of questions.
Hi,
It is a schema for a chat user. I want that the list of users is public (without private conversations). Sorry to tell that but I think that multiple auth documentation is bad explained.
I do not understand why this does not work :
This schema is rejected. And how to use that with Angular ?