You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We could make use of the Collections in the Directus SDK. But const directus = new Directus<Collections>('url') wouldn't work, because the <Collections> must extend from TypeMap by definition. To overcome this, we could simply generate the Collections also as type.
Have you tested this for your use-case? If that works I'm all for it, but I did not make this extension for the Directus sdk. I explicitly developed it to improve the development experience of developing extension.
Let me know if you tested this, how you tested it and how it worked for you.
You don't have to change Chappio/directus-extension-models to test it, just edit the generated sources and try to run your application. If that works well for you I will consider publishing the change in this repo.
Indeed, I'm testing it on a new project for some days now and it perfectly works.
In my case it makes the front-end development work combined with the sdk way more simpler or at least type safer.
I would definitely recommend it.
...and drop a hint in the docs ;) I could open a PR once the change here is made.
We could make use of the Collections in the Directus SDK. But
const directus = new Directus<Collections>('url')
wouldn't work, because the<Collections>
must extend fromTypeMap
by definition. To overcome this, we could simply generate the Collections also as type.That way:
What do you think?
The text was updated successfully, but these errors were encountered: