I have a type with a lambda field that uses concatenation of the name parts to form the name. If I ask for any of the type up to 560 first results, I get the correct data. However if I ask for 560+ first nodes, then I get the error:
Evaluation of custom field failed because external request returned an error: unexpected error with: 413 for field: name within type: Contact.
I was thinking that maybe my node in position 561 had an error somehow. But I can offset a lower first and get that Node+
My query up to the point of working:
query {
queryContact(first: 561 offset: 1) {
id
firstName
name
}
}
Schema Snippet (w/out auth):
type Contact {
id: ID
prefix: String
firstName: String
nickName: String
middleName: String
lastName: String
suffix: String
organization: String
abbreviation: String
# ... A lot more!
}
My lambda file:
const contactNameResolver = ({ parent: { prefix, firstName, nickName, middleName, lastName, suffix, organization, abbreviation } }) => {
let name = ''
if (organization) {
name = organization
if (abbreviation) name += ` (${abbreviation})`
} else {
if (prefix) name = prefix
if (firstName) name += ` ${firstName}`
if (nickName) name += ` "${nickName}"`
if (middleName) name += ` ${middleName}`
if (lastName) name += ` ${lastName}`
if (suffix) name += ` ${suffix}`
name = name.trim()
}
return name
}
self.addGraphQLResolvers({
'Contact.name': contactNameResolver,
})
I have not tested this with other lambda functions or on other types so I am not sure if 561 is a hard limit or just deterministic given my type, data, and script?