2

I am using an AWS DynamoDB database for my Android application. I am using AWS Amplify API (GraphQL API) to query and mutate.

However, I am not able to interact with two or more tables. I want to know how to purposefully have 2 or more table use. I am new to it and can't figure out. Thanks.

1
  • 1
    How do you want to pull the data from these two tables? is the data related or not. is the data hierarchical. you need to give more info on that Commented May 15, 2020 at 7:02

1 Answer 1

2

You can simply create two separate schema such as :

type Table1 @model {
  id: ID!
  name: String!
  posts: [Post] @connection(name: "BlogPosts")
}

type Table2 @model {
  id: ID!
  title: String!
  blog: Blog @connection(name: "BlogPosts")
  comments: [Comment] @connection(name: "PostComments")
}

you will have a graphql folder created which will contain the sample code for mutation , update and query for both of the tables.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.