@pothos/plugin-drizzle 0.7.2 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,10 +1,8 @@
1
1
  import { PothosValidationError } from '@pothos/core';
2
2
  import {
3
3
  type DBQueryConfig,
4
- RelationalSchemaConfig,
5
4
  type SQL,
6
5
  type TableRelationalConfig,
7
- TablesRelationalConfig,
8
6
  getOperators,
9
7
  } from 'drizzle-orm';
10
8
  import type { PothosDrizzleSchemaConfig } from './config';
@@ -21,6 +19,7 @@ export interface SelectionState {
21
19
  mappings: LoaderMappings;
22
20
  parent?: SelectionState;
23
21
  depth: number;
22
+ skipDeferredFragments: boolean;
24
23
  }
25
24
 
26
25
  export type SelectionMap = DBQueryConfig<'one', false>;
@@ -102,9 +101,14 @@ export function mergeState(state: SelectionState, newState: SelectionState) {
102
101
  }
103
102
  }
104
103
 
105
- export function createState(table: TableRelationalConfig, parent?: SelectionState): SelectionState {
104
+ export function createState(
105
+ table: TableRelationalConfig,
106
+ skipDeferredFragments: boolean,
107
+ parent?: SelectionState,
108
+ ): SelectionState {
106
109
  return {
107
110
  table,
111
+ skipDeferredFragments,
108
112
  parent,
109
113
  query: {},
110
114
  columns: new Set(),
@@ -168,7 +172,7 @@ export function mergeSelection(
168
172
  if (state.with.has(key)) {
169
173
  mergeSelection(config, state.with.get(key)!, selection);
170
174
  } else {
171
- const relatedState = createState(table, state);
175
+ const relatedState = createState(table, state.skipDeferredFragments, state);
172
176
  mergeSelection(config, relatedState, selection);
173
177
  state.with.set(key, relatedState);
174
178
  }