If both options are enabled (terminateCircularRelationships and useImplementingTypes), the fields where useImplementingTypes is in effect are not taking into account terminateCircularRelationships.
As an example, for the following schema:
type Query {
getUser(id: String!): User
}
type User {
id: String!
events: [Event!]
}
interface Event {
startDate: String
endDate: String
timeZone: String
}
type MeetingEvent implements Event {
endDate: String
startDate: String
timeZone: String
event: Event!
}
type OtherEvent implements Event {
endDate: String
startDate: String
timeZone: String
somethingElse: String!
}
Upon enabling both options, the library generates the following mocks:
As you can see, the fields where the Event type is used is not taking into account relationshipsToOmit, which means that the mock will fail because of the recursion.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
If both options are enabled (
terminateCircularRelationships
anduseImplementingTypes
), the fields whereuseImplementingTypes
is in effect are not taking into accountterminateCircularRelationships
.As an example, for the following schema:
Upon enabling both options, the library generates the following mocks:
As you can see, the fields where the Event type is used is not taking into account
relationshipsToOmit
, which means that the mock will fail because of the recursion.If that helps, I created a repository reproducing this here: https://github.com/Swanoo/graphql-mock-error