nyx97
nyx97

Reputation: 211

Graphql mutation error in aws amplify appsync

I am trying to insert/mutate a data using graphql to a dynamodb, see image below having error while inserting data. I am confused if the error exist while creating the schema or while mutating the data. The table was created using amplify

this is the schema script

type PersonalAttributes {
  FirstName: String
  LastName: String
  MiddleName: String
  Email: String
  Highlights: String
}

type Configurations {
  StudyTopic: String
  SpokenLanguage: String
  Gender: String
  ReadbackSpeed: Float
}

type Chapter {
  CTitle: String
  Content: String
  TermHighlights: [String]
}

type Book {
  Title: String
  Author: String
  HighlightsChapter: [Chapter]
}

type Athena @model {
  UserKey: ID
  UserName: String!
  PersonalInformation: [PersonalAttributes]
  SysConfig: [Configurations]
  Books: [Book]
}

error

Upvotes: 0

Views: 360

Answers (1)

Jameson
Jameson

Reputation: 6669

I recommend including an id: ID! for your Athena model. Provide a valid ID whenever you create Athena objects.

The error indicates that no id was provided (Dynamo wanted a valid, non-null String, but it got null.)

The error results from the create mutation call, not from setup of the Dynamo table.

Upvotes: 0

Related Questions