0

I've implemented the Amplify JS Library with a Vue project and have had success with all of the features of the library except this issue. When I query a model with Elasticsearch, it returns the appropriate results, but also the error of "ResolverExecutionLimitReached".

This is the request:

let destinations = await API.graphql(graphqlOperation(queries.searchDestinations, {filter: { deviceId: { eq: params.id }}}))

This is the schema:

type Destination 
  @model
  @searchable
  @auth(rules: [{ allow: public }, { allow: private }])
  @key(name: "byXpoint", fields: ["xpoint"])
  @key(name: "byDevice", fields: ["deviceId"])
  {
    id: ID!
    index: Int!
    levels: [String]
    name: String!
    xpoint: String
    sourceId: ID
    Source: Source @connection
    lock: Boolean
    breakaway: Boolean
    breakaways: String
    probeId: ID!
    probe: Probe @connection(fields: ["probeId"])
    deviceId: ID!
    device: Device @connection(fields: ["deviceId"])
    orgId: ID!
    org: Org @connection(fields: ["orgId"])
}

And this returns:

{
    data: {
        searchDestinations: {items: Array(100), nextToken: "ba1dc119-2266-4567-9b83-f7eee4961e63", total: 384}
    },
    errors: [
        {
            data: null
            errorInfo: null
            errorType: "ResolverExecutionLimitReached"
            locations: []
            message: "Resolver invocation limit reached."
            path: []
        }
    ]
}

My understanding is the AppSync API has a hard limit of returning more than 1000 entries, but this query is on a table with only ~600 entries and is only returning 384. I am executing the same command via AppSync directly via a NodeJS application and it works without issue.

Not sure where to investigate further to determine what is triggering this error. Any help or direction is greatly appreciated.

jlommori
  • 161
  • 1
  • 13
  • 1
    If my assumptions are correct it has to do with the connections you've added to your model: Probe, Device, Org. What's happening is everytime you query this model it also has to do 3 lookups to each of these other tables/models. So in reality it's pulling 384 entries but for each one of those it pulls in 3 other entries from the other tables. That means 384 x 4 = 1536. Breaking down the 4 is 1 for the actual model values, 1 for Probe, 1 for Device, and 1 for Org. That easily puts you over the 1000 limit. – Mickers Jan 21 '21 at 20:24

1 Answers1

1

Connections in the schema were causing the single request to go beyond the 1000 request limit (exactly as stated by Mickers in the comments). Updated schema with less connections on fetch and issue was resolved.

jlommori
  • 161
  • 1
  • 13