apollo-tooling
apollo-tooling copied to clipboard
apollo client:codegen behaves differently when using endpoint VS when using key+variant
Intended outcome:
I am trying to generate types using two different commands:
yarn apollo client:codegen . --target=typescript --passthroughCustomScalars --includes=packages/**/*.gql --endpoint=https://***
yarn apollo client:codegen . --target=typescript --passthroughCustomScalars --includes=packages/**/*.gql --key=*** variant=current
I would expect the generated types to be the same, since both are pointing to the same schema.
Actual outcome:
The actual outcome is not as expected: the types are the same, but the order of the tuples and interface keys are not the same.
Using the first command, the keys are sorted alphabetically. Using the second command, it is not the case (the order is consistent for each run, but I don't know what the logic behind it is).
How to reproduce the issue:
Run the commands on your favorite schema (using Apollo Studio to retrieve the key and variant).
Versions
"apollo": "2.33.6"