Open AuthorProxy opened 1 year ago
I then got players type in the test function isUniquePlayers
like this:
(parameter) players: {
__typename?: unknown;
project_id?: unknown;
certificate_id?: unknown;
name?: unknown;
how can I get a normal type for players object without optional keys, unknown values and typescript as
?!
You shouldn't need to fill the generics there, just remove them and let the schema determine the type. If you want to ensure things match a given interface then follow the docs for typescript usage and the migration issue pinned here
Вам не нужно заполнять туда дженерики, просто удалите их и позвольте схеме определить тип. Если вы хотите убедиться, что все соответствует данному интерфейсу, следуйте документации по использованию машинописного текста и проблеме миграции, закрепленной здесь.
Could you provide a link showing how to type yup schema based on interface?
You shouldn't need to fill the generics there, just remove them and let the schema determine the type. If you want to ensure things match a given interface then follow the docs for typescript usage and the migration issue pinned here
There is nothing about this part at migration guide, thats why i-am asking!!!
How it was before upgrade on 0.x.x version:
where Shape is:
export type Shape<T> = Partial<Record<keyof T, AnySchema>>;
How I fix
afterupgrade
errors on 1.x.x version: 1st variant:2nd variant:
Can you help me plz this part of code without using typescript
as
? If the 1variant good or any other way to achive this?