question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

AppSync query does not work, but the record is added to DynamoDB.

See original GitHub issue

Created the following schema:

type Profile
  @model
  @auth(
    rules: [
      { allow: owner, ownerField: "owner", operations: [create, update, delete] }
      { allow: groups, groups: ["admin"] }
    ]
  ) {
  id: ID!
  firstName: String!
  lastName: String!
  email: String!
  avatar: S3Object!
  owner: String
}

type S3Object {
  bucket: String!
  region: String!
  key: String!
}

Caused a mutation:

await API.graphql(graphqlOperation(createProfile, { input: values })) link ✅Successful answer

After I make a query

await API.graphql(graphqlOperation(listProfiles))

link

❌ An empty array is returned when requested in the application, as well as in the AppSync console

Снимок экрана 2020-07-23 в 22 56 06 Снимок экрана 2020-07-23 в 22 42 51

But there is a record in the DynamoDB database itself.

Снимок экрана 2020-07-23 в 22 43 20

What is the problem?

Repository

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
gHashTagcommented, Jul 24, 2020

@djsmedes

Is the user you are testing this with in the “admin” group?

yes

0reactions
github-actions[bot]commented, May 25, 2021

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshooting and Common Mistakes - AWS AppSync
This section discusses some common errors and how to troubleshoot them. Incorrect DynamoDB Key Mapping. If your GraphQL operation returns the following ...
Read more >
Data live in DynamoDB however AppSync list query doesn't ...
Describe the bug I have an AWS Amplify app in which I add a GraghQL backend and create the model like this: type...
Read more >
AWS AppSync not returning all the records from DynamoDB
The reason I say this: Let's suppose you are running the query with a filter, and you are not getting any results, but...
Read more >
How to use DynamoDB with AppSync
How to store, retrieve, and query items in a DynamoDB table with an AppSync resolver ... AppSync natively supports reading and writing data...
Read more >
AWS AppSync Subscriptions with DynamoDB Streams ...
With AWS AppSync a GraphQL Subscription always has to be triggered by a GraphQL Mutation. But there are use cases in which you...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found