Skip to content

Commit 2e76452

Browse files
committed
Get EXPORTABLE from build
1 parent 35c70b4 commit 2e76452

7 files changed

Lines changed: 20 additions & 11 deletions

src/AddConnectionFilterOperatorPlugin.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import type { GraphQLInputType } from "graphql";
22
import { $$filters } from "./interfaces";
33
import { makeApplyPlanFromOperatorSpec } from "./PgConnectionArgFilterOperatorsPlugin";
4-
import { EXPORTABLE } from "graphile-export";
54

65
const { version } = require("../package.json");
76

@@ -51,6 +50,7 @@ export const AddConnectionFilterOperatorPlugin: GraphileConfig.Plugin = {
5150
},
5251
GraphQLInputObjectType_fields(inFields, build, context) {
5352
let fields = inFields;
53+
const { EXPORTABLE } = build;
5454
const {
5555
scope: { pgConnectionFilterOperators },
5656
Self,

src/PgConnectionArgFilterBackwardRelationsPlugin.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ export const PgConnectionArgFilterBackwardRelationsPlugin: GraphileConfig.Plugin
132132
Self,
133133
} = context;
134134

135-
const assertAllowed = makeAssertAllowed(build.options);
135+
const assertAllowed = makeAssertAllowed(build);
136136

137137
const source =
138138
pgCodec &&

src/PgConnectionArgFilterComputedAttributesPlugin.ts

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import {
33
getComputedAttributeResources,
44
isComputedScalarAttributeResource,
55
} from "./utils";
6-
import { EXPORTABLE } from "graphile-build";
76

87
const { version } = require("../package.json");
98

@@ -38,6 +37,7 @@ export const PgConnectionArgFilterComputedAttributesPlugin: GraphileConfig.Plugi
3837
inflection,
3938
connectionFilterOperatorsDigest,
4039
dataplanPg: { TYPES, PgConditionStep },
40+
EXPORTABLE,
4141
} = build;
4242
const {
4343
fieldWithHooks,
@@ -128,7 +128,12 @@ export const PgConnectionArgFilterComputedAttributesPlugin: GraphileConfig.Plugi
128128
description: `Filter by the object’s \`${fieldName}\` field.`,
129129
type: OperatorsType,
130130
applyPlan: EXPORTABLE(
131-
(PgConditionStep, computedAttributeResource, functionResultCodec) => function (
131+
(
132+
PgConditionStep,
133+
computedAttributeResource,
134+
functionResultCodec
135+
) =>
136+
function (
132137
$where: PgConditionStep<any>,
133138
fieldArgs: any
134139
) {
@@ -147,7 +152,11 @@ export const PgConnectionArgFilterComputedAttributesPlugin: GraphileConfig.Plugi
147152
};
148153
fieldArgs.apply($col);
149154
},
150-
[PgConditionStep, computedAttributeResource, functionResultCodec]
155+
[
156+
PgConditionStep,
157+
computedAttributeResource,
158+
functionResultCodec,
159+
]
151160
),
152161
}
153162
),

src/PgConnectionArgFilterForwardRelationsPlugin.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export const PgConnectionArgFilterForwardRelationsPlugin: GraphileConfig.Plugin
4444
fieldWithHooks,
4545
scope: { pgCodec, isPgConnectionFilter },
4646
} = context;
47-
const assertAllowed = makeAssertAllowed(build.options);
47+
const assertAllowed = makeAssertAllowed(build);
4848

4949
const source =
5050
pgCodec &&

src/PgConnectionArgFilterLogicalOperatorsPlugin.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export const PgConnectionArgFilterLogicalOperatorsPlugin: GraphileConfig.Plugin
2929
return fields;
3030
}
3131

32-
const assertAllowed = makeAssertAllowed(build.options);
32+
const assertAllowed = makeAssertAllowed(build);
3333

3434
const logicalOperatorFields = {
3535
and: fieldWithHooks(

src/PgConnectionArgFilterPlugin.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import type {
77
} from "graphql";
88
import { OperatorsCategory } from "./interfaces";
99
import { makeAssertAllowed } from "./utils";
10-
import { EXPORTABLE } from "graphile-export";
1110

1211
const { version } = require("../package.json"); // eslint-disable-line
1312

@@ -99,6 +98,7 @@ export const PgConnectionArgFilterPlugin: GraphileConfig.Plugin = {
9998
connectionFilterAllowedFieldTypes,
10099
connectionFilterArrays,
101100
},
101+
EXPORTABLE,
102102
} = build;
103103

104104
build.connectionFilterOperatorsDigest = (codec) => {
@@ -451,7 +451,7 @@ export const PgConnectionArgFilterPlugin: GraphileConfig.Plugin = {
451451
return args;
452452
}
453453

454-
const assertAllowed = makeAssertAllowed(build.options);
454+
const assertAllowed = makeAssertAllowed(build);
455455

456456
const attributeCodec =
457457
resource?.parameters && !resource?.codec.attributes

src/utils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import type {
77
import type { FieldArgs } from "grafast";
88
import type { GraphileBuild } from "graphile-build";
99
import type {} from "graphile-build-pg";
10-
import { EXPORTABLE } from "graphile-export";
1110

1211
export function isComputedScalarAttributeResource(
1312
s: PgResource<any, any, any, any, any>
@@ -57,7 +56,8 @@ export function getComputedAttributeResources(
5756
}
5857

5958
// TODO: rename. (Checks that the arguments aren't null/empty.)
60-
export function makeAssertAllowed(options: GraphileBuild.SchemaOptions) {
59+
export function makeAssertAllowed(build: GraphileBuild.Build) {
60+
const { options, EXPORTABLE } = build;
6161
const {
6262
connectionFilterAllowNullInput,
6363
connectionFilterAllowEmptyObjectInput,

0 commit comments

Comments
 (0)