2

I have this query:

getMyTransactions {
  id
  createdAt
}

And I got this error:

  "message": "Cannot return null for non-nullable field Transaction.createdAt.",
  "path": [
    "_entities",
    0,
    "createdAt"
  ],
  "extensions": {
    "code": "INTERNAL_SERVER_ERROR",
    "serviceName": "XXX",
    "query": "query($representations:[_Any!]!){_entities(representations:$representations){...on Transaction{createdAt}}}",
    "variables": {
      "representations": [
        {
          "__typename": "Transaction",
          "id": "29bf75e5-b79e-4a7d-a021-84a8b5662aa8"
        },
        {
          "__typename": "Transaction",
          "id": "616f3f8a-3c81-4d2e-bce0-03d031a15062"
        }
      ]
    },
//etc

Why isvariables.representations missing createdAt values? When I do a query directly to DynamoDB I can see createdAt values for all those 2 items.

My schemas are like this:

extend type Transaction @key(fields: "id") {
  id: ID! @external
}

type Query {
  getMyTransactions: [Transaction!]!
}

And the other schema has Transaction type:

type Transaction @key(fields: "id") {
  id: ID!
  createdAt: String!
}
pmiranda
  • 7,602
  • 14
  • 72
  • 155

0 Answers0