New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot make Directus SDK types match. #11913
Comments
I think I've just hit this issue today (using the SDK from Directus 9.9.1). I think that tweaking the Before
After
But like you, I am defining my o2m relations as So taking this a step further, would it make sense for the Happy to submit a PR if it's useful. |
@wfoxall Any PR to improve the typescript setup of the SDK is more than welcome 👍🏻 🚀 |
I did run into the same issue with filter types. The same fix seems to work. |
I'm still having this issue on SDK 12.0.1. It says:
|
This issue is for a previous version of the SDK before it was rewritten so this cannot be applicable to your problem. Please do look for more recent issues or create one. |
Preflight Checklist
Describe the Bug
I cannot request for a resource and it's translations because the Type for the deep property of the query expects and instance ofthe resource and not of it's translation.
To Reproduce
I am trying to set up the Directus SDK in a project and i have resources that have translations. I have currently created them as follows:
When trying to make a request for marketing tiles including translations i write:
When i try this i get a type error that i cannot assign that object to the deep parameter because apparently deep expects an instance of MarketingTile and it cannot find the languagesCode property to filter by it. Am i defining the types wrong? How should i go about this?
The code works, but i am using an aggresive linter and cannot get passed this linter error.
Errors Shown
No response
What version of Directus are you using?
9.5.2
What version of Node.js are you using?
14.16.0
What database are you using?
Directus CMS
What browser are you using?
Chrome
What operating system are you using?
Windows
How are you deploying Directus?
running locally
The text was updated successfully, but these errors were encountered: