Describe the bug
When from typing import TypeAlias
is used in the output models, it does not take into consideration that support for this was introduced in python 3.10. Any versions below 3.10 will generate models that will not work.
The potential solution would be to use `from typing_extensions import TypeAlias
To Reproduce
Example schema:
type DummyType {
id: ID!
label: String!
value: Int!
}
Used commandline:
$ datamodel-codegen --input ./example.graphql --input-file-type=graphql --output-model-type pydantic_v2.BaseModel --target-python-version 3.8 --output example_models.py
Expected behavior
The outputted example_models.py should be code that can be run using python3.8.
Version:
Additional context
Add any other context about the problem here.
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too