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] Expected response type of item query unequals SDK response type #22310

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 5 additions & 2 deletions sdk/src/types/output.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { FieldsWildcard, HasManyToAnyRelation, PickRelationalFields } from './fields.js';
import type { MappedFunctionFields } from './functions.js';
import type { ItemType } from './schema.js';
import type { ItemType, RemoveRelationships } from './schema.js';
import type { IfAny, IsNullable, Merge, Mutable, UnpackList } from './utils.js';

/**
Expand All @@ -22,7 +22,10 @@ export type ApplyQueryFields<
Record<string, any>,
Merge<
MappedFunctionFields<Schema, CollectionItem> extends infer FF
? MapFlatFields<CollectionItem, FlatFields, FF extends Record<string, string> ? FF : Record<string, string>>
? RemoveRelationships<
Schema,
MapFlatFields<CollectionItem, FlatFields, FF extends Record<string, string> ? FF : Record<string, string>>
>
: never,
RelationalFields extends never
? never
Expand Down