Closed N0SAFE closed 3 weeks ago
Fixed in the next release
Side note: there's still some cases where the schema type injection will fail, and to automate that part I'll have to add a good chunk of code to the generation engine, which I can't do right now. I'll keep this in mind whenever I have more time to deal with this, for now cases where it fails (like .aggregate), just use .request(aggregate()) instead.
And to be honest, even the SDK itself doesn't handle those types properly, like Partial
Description of the bug
when using the instance created by createTypesClient the function createUser does not have the same type safety as if i do DirectusSDKcreateUser()
type collections = { directus_users: { namteste: Types.Optional
}[]
}
const directus = createTypedClient('http://localhost:8055')
directus.createUser({ test: 'test', <- error: Object literal may only specify known properties, and 'test' does not exist in type X })
directus.request( DirectusSDK.createUser({ test: 'test', <- no error }) )
Steps To Reproduce
Additional Information
No response