Skip to content
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

SDK Field type checking fails #19815

Open
br41nslug opened this issue Sep 26, 2023 · 1 comment · Fixed by #21085 · May be fixed by #21089
Open

SDK Field type checking fails #19815

br41nslug opened this issue Sep 26, 2023 · 1 comment · Fixed by #21085 · May be fixed by #21089
Assignees
Labels

Comments

@br41nslug
Copy link
Member

Describe the Bug

There is a strange edge case with core collections where checking of field types fails.

To Reproduce

import { createDirectus, rest, readFiles } from "@directus/sdk";

interface Example {
    id: string;
    related: number[] | Relational[];
}

interface Relational {
    id: number;
}

interface Schema {
    example: Example[];
    relational: Relational[];
//  For some unexplained reason this fixes it
//    directus_non_existent: string;
}

const directus = createDirectus<Schema>("http://0.0.0.0:8055").with(rest());

const result = await directus.request(
    readFiles({
        fields: ["non-existing", "count(non-existing)"],
    })
);

console.log(result[0]);

Directus Version

10.6.3

Hosting Strategy

Self-Hosted (Docker Image)

@br41nslug
Copy link
Member Author

Extra test case #21069

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: 👀 In review
4 participants