Every GraphQL document (Query or Mutation) will have some response behind it. That response is returned as JSON, and in the format that the official GraphQL spec requires. More details can be found in this documentation here.
MIPs GraphQL formatter is nothing more than a regular apex Class that has the role of intercepting every field in the resulting JSON and format it in a custom way before it is actually returned.
We accomplish that by having a custom class that implements MIPs IFormatter interface that has 10 methods. Each of the methods is responsible for formatting one or more field DisplayTypes:
(methodName) : (DisplayTypes it formats)
By having this structure, anyone can build its own custom class and have some custom logic applied in formatting the field values sorted by DisplayTypes.
MIP comes with three predefined GraphQL Formatters.
Although this Formatter provides just a basic manipulation of field values, it is still the heaviest. That means that in large Queries there will be an impact on the time which takes the result to be returned.
This formatter just goes through every field in the result and returns the same value. It does not apply any formatting. Its main purpose is that other classes can override it and provide their own implementation. There is also the potential for future adding of common formatting that is deemed to be necessary.
This is the lightest and quickest formatter. Performance gain will be the greatest if this formatter is used. It does not provide any value manipulation and it never will. You can reference the custom settings section to