0
votes

I am using AWS Amplify to configure Appsync in my project. In my schema.graphql, I have the following types:

type Post @model {
  id: ID!
  tweet: Tweet
}

type Tweet {
  id: ID
  text: String!
}

Tweet is a nested object under Post, it is intentionally not a @model.

When I upload to AWS via the cli (amplify push), it removes the Tweet's id field from TweetInput on the generated schema. This is the generated schema from the AWS console:

input CreatePostInput {
    id: ID
    tweet: TweetInput
}

type Tweet {
    id: ID
    text: String!
}

input TweetInput {
    text: String!
}

I have searched the Appsync documentation, but I cannot find anywhere that says I can't use an id field on an object type.

Is there any way around this? I'd like to avoid renaming the field if I can.

1

1 Answers

0
votes

Turns out that this is a bug in the CLI https://github.com/aws-amplify/amplify-cli/issues/1984

Hopefully it gets resolved soon.