KIMERA_RECURSIVITY_DEPTH_LIMIT
This is a env variable that controls the depth to which Kimera will recursively mock types that reference each other recursively.
# default value set to 20
export KIMERA_RECURSIVITY_DEPTH_LIMIT=20;
Take the following cyclical schema:
type Query {
me: User
}
type User {
id: ID!
username: String!
trip: Launch
}
type Launch {
site: String!
pilot: User
}
When automocking the me
query, Kimera will attempt to:
- mock the
me
field on theQuery
type which will lead it to - mock the
trip
field on theUser
type which will lead it to - mock the
pilot
field on theLaunch
type which will lead it to - mock the
trip
field on theUser
type which will lead it to - mock the
pilot
field on theLaunch
type ...
... and so it keeps going. With no mocking depth limit the process would run out of memory.
By default Kimera limits the mocking depth to 20. When the depth has been exceeded, Kimera mocks that field at the depth edge with a resolver which throws a Mocking depth exceeded
error.
If you need to change the depth to which Kimera allows mocking you can do so using the KIMERA_RECURSIVITY_DEPTH_LIMIT
enviornment variable.