0
votes

I am using the following Graphql schema:

Connection {
  items: [String]
}

connected to the DynamoDB response resolver:

{
}

which is obviously empty, but still, the GraphiQL console of AWS returns an array with one null element:

{
  data: {
    items: [null]
  }
}

Is this an intended behavior? I would expect the returned result to be

{
  data: {
    items: null
  }
}

(without the array, just null). How do I get Appsync to only return null?

1
What is your query? - Michael Willingham

1 Answers

0
votes

This setup returns null for items.

Schema:

type Connection {
  items: [String]
}

query {
  listNull: Connection
}

Request template:

{
    "version" : "2017-02-28",
    "operation" : "Scan",
}

Response Template:

{
}

Query:

query ListNull {
  listNull {
    items
  }
}

Result:

{
  "data": {
    "listNull": {
      "items": null
    }
  }
}