grafast 0.0.1-0.21 → 0.0.1-0.23

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.
@@ -51,7 +51,7 @@ export interface GrafastInputFieldExtensions {
51
51
  applyPlan?: InputObjectFieldApplyPlanResolver;
52
52
  }
53
53
  export interface GrafastObjectTypeExtensions {
54
- Step?: {
54
+ Step?: ((step: ExecutableStep<any>) => asserts step is ExecutableStep<any>) | {
55
55
  new (...args: any[]): ExecutableStep;
56
56
  displayName?: string;
57
57
  };
@@ -261,5 +261,10 @@ export interface JSONObject {
261
261
  }
262
262
  export interface JSONArray extends Array<JSONValue> {
263
263
  }
264
+ export type UnwrapPlanTuple<TIn extends readonly ExecutableStep<any>[]> = {
265
+ [Index in keyof TIn]: TIn[Index] extends ExecutableStep<infer U> ? U : never;
266
+ } & {
267
+ length: number;
268
+ };
264
269
  export {};
265
270
  //# sourceMappingURL=interfaces.d.ts.map
@@ -1,4 +1,4 @@
1
- import type { ExecutionExtra, PromiseOrDirect } from "../interfaces.js";
1
+ import type { ExecutionExtra, PromiseOrDirect, UnwrapPlanTuple } from "../interfaces.js";
2
2
  import type { ExecutableStep } from "../step.js";
3
3
  import { UnbatchedExecutableStep } from "../step.js";
4
4
  export declare class LambdaStep<TIn, TOut> extends UnbatchedExecutableStep<TOut> {
@@ -15,9 +15,7 @@ export declare class LambdaStep<TIn, TOut> extends UnbatchedExecutableStep<TOut>
15
15
  deduplicate(peers: LambdaStep<any, any>[]): LambdaStep<TIn, TOut>[];
16
16
  unbatchedExecute(_extra: ExecutionExtra, value: TIn): PromiseOrDirect<TOut>;
17
17
  }
18
- declare function lambda<TIn extends [...any[]], TOut>(plans: {
19
- [Index in keyof TIn]: ExecutableStep<TIn[Index]>;
20
- }, fn: (value: TIn) => PromiseOrDirect<TOut>, isSyncAndSafe?: boolean): LambdaStep<TIn, TOut>;
21
- declare function lambda<TIn, TOut>($plan: ExecutableStep<TIn> | null | undefined, fn: (value: TIn) => PromiseOrDirect<TOut>, isSyncAndSafe?: boolean): LambdaStep<TIn, TOut>;
18
+ declare function lambda<const TIn extends readonly ExecutableStep<any>[], TOut>(plans: TIn, fn: (value: UnwrapPlanTuple<TIn>) => PromiseOrDirect<TOut>, isSyncAndSafe?: boolean): LambdaStep<UnwrapPlanTuple<TIn>, TOut>;
19
+ declare function lambda<const TIn, TOut>($plan: ExecutableStep<TIn> | null | undefined, fn: (value: TIn) => PromiseOrDirect<TOut>, isSyncAndSafe?: boolean): LambdaStep<TIn, TOut>;
22
20
  export { lambda };
23
21
  //# sourceMappingURL=lambda.d.ts.map
@@ -1,17 +1,14 @@
1
- import type { ExecutionExtra } from "../interfaces.js";
1
+ import type { ExecutionExtra, UnwrapPlanTuple } from "../interfaces.js";
2
2
  import type { ExecutableStep } from "../step.js";
3
3
  import { UnbatchedExecutableStep } from "../step.js";
4
- type UnwrapPlanTuple<TPlanTuple extends readonly ExecutableStep<any>[]> = [
5
- ...(TPlanTuple extends readonly ExecutableStep<infer U>[] ? readonly U[] : never)
6
- ];
7
- export declare class ListStep<TPlanTuple extends readonly ExecutableStep<any>[]> extends UnbatchedExecutableStep<UnwrapPlanTuple<TPlanTuple>> {
4
+ export declare class ListStep<const TPlanTuple extends readonly ExecutableStep<any>[]> extends UnbatchedExecutableStep<UnwrapPlanTuple<TPlanTuple>> {
8
5
  static $$export: {
9
6
  moduleName: string;
10
7
  exportName: string;
11
8
  };
12
9
  isSyncAndSafe: boolean;
13
10
  allowMultipleOptimizations: boolean;
14
- constructor(list: readonly [...TPlanTuple]);
11
+ constructor(list: TPlanTuple);
15
12
  toStringMeta(): string;
16
13
  tupleToTuple(results: Array<UnwrapPlanTuple<TPlanTuple>>, tuple: UnwrapPlanTuple<TPlanTuple>): UnwrapPlanTuple<TPlanTuple>;
17
14
  execute(values: any[][]): Array<UnwrapPlanTuple<TPlanTuple>>;
@@ -19,6 +16,5 @@ export declare class ListStep<TPlanTuple extends readonly ExecutableStep<any>[]>
19
16
  deduplicate(peers: ListStep<TPlanTuple>[]): ListStep<TPlanTuple>[];
20
17
  at<TIndex extends keyof TPlanTuple>(index: TIndex): TPlanTuple[TIndex];
21
18
  }
22
- export declare function list<TPlanTuple extends ExecutableStep<any>[]>(list: TPlanTuple): ListStep<TPlanTuple>;
23
- export {};
19
+ export declare function list<const TPlanTuple extends readonly ExecutableStep<any>[]>(list: TPlanTuple): ListStep<TPlanTuple>;
24
20
  //# sourceMappingURL=list.d.ts.map
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=thereCanBeOnlyOne.d.ts.map
package/dist/utils.d.ts CHANGED
@@ -18,7 +18,7 @@ export type ObjectTypeFields<TContext extends Grafast.Context, TParentStep exten
18
18
  export type ObjectTypeSpec<TContext extends Grafast.Context, TParentStep extends ExecutableStep<any>, TFields extends ObjectTypeFields<TContext, TParentStep>> = Omit<GraphQLObjectTypeConfig<any, TContext>, "fields"> & {
19
19
  fields: TFields | (() => TFields);
20
20
  };
21
- export declare function objectSpec<TContext extends Grafast.Context, TParentStep extends ExecutableStep<any>, TFields extends ObjectTypeFields<TContext, TParentStep>>(spec: ObjectTypeSpec<TContext, TParentStep, TFields>, Step: {
21
+ export declare function objectSpec<TContext extends Grafast.Context, TParentStep extends ExecutableStep<any>, TFields extends ObjectTypeFields<TContext, TParentStep>>(spec: ObjectTypeSpec<TContext, TParentStep, TFields>, Step: ((step: ExecutableStep<any>) => asserts step is ExecutableStep<any>) | {
22
22
  new (...args: any[]): TParentStep;
23
23
  } | null): GraphQLObjectTypeConfig<any, TContext>;
24
24
  export type GraphileObjectType<TContext extends Grafast.Context, TParentStep extends ExecutableStep<any>, TFields extends ObjectTypeFields<TContext, TParentStep>> = GraphQLObjectType<TParentStep extends ExecutableStep<infer U> ? U : never, TContext> & {
@@ -28,7 +28,7 @@ export type GraphileObjectType<TContext extends Grafast.Context, TParentStep ext
28
28
  export declare function newObjectTypeBuilder<TContext extends Grafast.Context, TParentStep extends ExecutableStep<any>>(Step: {
29
29
  new (...args: any[]): TParentStep;
30
30
  }): <TFields extends ObjectTypeFields<TContext, TParentStep>>(spec: ObjectTypeSpec<TContext, TParentStep, TFields>) => GraphileObjectType<TContext, TParentStep, TFields>;
31
- export declare function objectFieldSpec<TContext extends Grafast.Context, TSource extends ExecutableStep<any>, TResult extends ExecutableStep<any> = ExecutableStep<any>, TArgs extends BaseGraphQLArguments = BaseGraphQLArguments>(graphileSpec: GraphileFieldConfig<GraphQLOutputType, TContext, TSource, TResult, TArgs>): GraphQLFieldConfig<any, TContext, TArgs>;
31
+ export declare function objectFieldSpec<TContext extends Grafast.Context, TSource extends ExecutableStep<any>, TResult extends ExecutableStep<any> = ExecutableStep<any>, TArgs extends BaseGraphQLArguments = BaseGraphQLArguments>(graphileSpec: GraphileFieldConfig<GraphQLOutputType, TContext, TSource, TResult, TArgs>, path: string): GraphQLFieldConfig<any, TContext, TArgs>;
32
32
  export declare function newGraphileFieldConfigBuilder<TContext extends Grafast.Context, TParentStep extends ExecutableStep<any>>(): <TType extends GraphQLOutputType, TFieldStep extends OutputPlanForType<TType>, TArgs extends BaseGraphQLArguments>(config: GraphileFieldConfig<TType, TContext, TParentStep, TFieldStep, TArgs>) => typeof config;
33
33
  export type GraphileInputFieldConfigMap<TContext extends Grafast.Context, TParentStep extends ModifierStep<any>> = {
34
34
  [key: string]: GraphileInputFieldConfig<GraphQLInputType, TContext, TParentStep, any, any>;
@@ -42,7 +42,7 @@ export type GraphileInputObjectType<TContext extends Grafast.Context, TParentSte
42
42
  TFields: TFields;
43
43
  };
44
44
  export declare function newInputObjectTypeBuilder<TContext extends Grafast.Context, TParentStep extends ModifierStep<any>>(): <TFields extends GraphileInputFieldConfigMap<TContext, TParentStep>>(spec: InputObjectTypeSpec<TContext, TParentStep, TFields>) => GraphileInputObjectType<TContext, TParentStep, TFields>;
45
- export declare function inputObjectFieldSpec<TContext extends Grafast.Context, TParent extends ModifierStep<any>, TResult extends ModifierStep<TParent> = ModifierStep<TParent>, TInput extends InputStep = InputStep>(graphileSpec: GraphileInputFieldConfig<GraphQLInputType, TContext, TParent, TResult, TInput>): GraphQLInputFieldConfig;
45
+ export declare function inputObjectFieldSpec<TContext extends Grafast.Context, TParent extends ModifierStep<any>, TResult extends ModifierStep<TParent> = ModifierStep<TParent>, TInput extends InputStep = InputStep>(graphileSpec: GraphileInputFieldConfig<GraphQLInputType, TContext, TParent, TResult, TInput>, path: string): GraphQLInputFieldConfig;
46
46
  declare module "graphql" {
47
47
  interface GraphQLEnumType {
48
48
  [$$valueConfigByValue]?: Record<string, GraphQLEnumValueConfig>;
@@ -60,5 +60,6 @@ export declare function stepADependsOnStepB(stepA: ExecutableStep, stepB: Execut
60
60
  export declare function stepAMayDependOnStepB($a: ExecutableStep, $b: ExecutableStep): boolean;
61
61
  export declare function stepsAreInSamePhase(ancestor: ExecutableStep, descendent: ExecutableStep): boolean;
62
62
  export declare const canonicalJSONStringify: (o: object) => string;
63
+ export declare function assertNotAsync(fn: any, name: string): void;
63
64
  export {};
64
65
  //# sourceMappingURL=utils.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "grafast",
3
- "version": "0.0.1-0.21",
3
+ "version": "0.0.1-0.23",
4
4
  "description": "Cutting edge GraphQL planning and execution engine",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -51,7 +51,7 @@
51
51
  },
52
52
  "peerDependencies": {
53
53
  "@envelop/core": "^3.0.4",
54
- "graphile-config": "^0.0.1-0.5",
54
+ "graphile-config": "^0.0.1-0.6",
55
55
  "graphql": "^16.1.0-experimental-stream-defer.6"
56
56
  },
57
57
  "peerDependenciesMeta": {