Description
Currently, we do not guarantee that generated field names or type names will stay the same across different versions of OtG. The same OAS may also produce different field names or type names if the operations are ordered different as the GraphQL interface is built up incrementally.
We need to find a way that will allow us to guarantee that field names and type names will stay the same regardless of input or package version.
Currently, the option operationIdFieldNames
allows the user to manually override field name generation. I think there is potential in outputting an edited OAS that replaces the operationId
s with the generated field names. That way, a user can use the operationIdFieldName
option to guarantee the same field names across different versions of OtG.
However, this may not always be an option as a user might be working with a generated OAS.
Alternatively, we can output an object that contains the mapping from operation method, operation path, and HTTP status (relating to a single response body) to field name and schema to type name. This object can also be consumed to allow us to generate more consistent interfaces.
Another consideration we may have to make is storing the field names for linked operations.