I want to be able to "suppress" the default HotChocolate (server) behavior and ignore schema errors on query.
Let me try to give example. Let assume we do have the following schema:
type Query {
myTypes: [MyType]
}
type MyType{
id: ID!
name: String
}
If I try to make query like:
{
myTypes {
id,
name
}
}
Everything is okay. However, if I make something like:
{
myTypes {
id,
name,
notKnownProperty
}
}
The query fails. Which in general is desired behavior (the whole benefit of strict schema), but not in my particular case.
The use case is when we have 2 or more services, that expose one and the same schema (with different data) and some of those services evolve with different speed. Unfortunately we cannot control versions of those services, as some of them are on-premise. And we end up in situation where some of the services have newer versions (with more fields on the same types) than others. This restricts us to use only the oldest clients available. We would like to do the opposite - use the newest clients and handle missing fields in them (with default values for example).
One possible solution is to be implemented some sort of versioning. Either in the path (aka /graphql/v1) or in the object types itself (aka MyType1, MyType2, etc.). But I personally don't like those approaches.
Any ideas and input are appreciated !
Thanks in advance!