Skip to content
Merged

updates #1209

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions graphile/graphile-bucket-provisioner-plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,13 @@
"@pgsql/quotes": "^17.1.0"
},
"peerDependencies": {
"grafast": "1.0.0",
"graphile-build": "5.0.0",
"graphile-build-pg": "5.0.0",
"graphile-config": "1.0.0",
"grafast": "1.0.2",
"graphile-build": "5.0.2",
"graphile-build-pg": "5.0.2",
"graphile-config": "1.0.1",
"graphile-utils": "5.0.0",
"graphql": "16.13.0",
"postgraphile": "5.0.0"
"postgraphile": "5.0.3"
},
"devDependencies": {
"@types/node": "^22.19.11",
Expand Down
14 changes: 7 additions & 7 deletions graphile/graphile-bulk-mutations/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,13 @@
"pgsql-test": "workspace:^"
},
"peerDependencies": {
"@dataplan/pg": "1.0.0",
"grafast": "1.0.0",
"graphile-build": "5.0.0",
"graphile-build-pg": "5.0.0",
"graphile-config": "1.0.0",
"@dataplan/pg": "1.0.3",
"grafast": "1.0.2",
"graphile-build": "5.0.2",
"graphile-build-pg": "5.0.2",
"graphile-config": "1.0.1",
"graphql": "16.13.0",
"pg-sql2": "5.0.0",
"postgraphile": "5.0.0"
"pg-sql2": "5.0.1",
"postgraphile": "5.0.3"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import '../augmentations';

import { sideEffectWithPgClient } from '@dataplan/pg';
import type { GraphileConfig } from 'graphile-config';
import type { GraphQLOutputType, GraphQLInputType } from 'graphql';

const version = '0.1.0';

Expand Down Expand Up @@ -58,8 +59,8 @@ export const BulkDeletePlugin: GraphileConfig.Plugin = {
const inputTypeName = inflection.bulkDeleteInputType(typeName);
const payloadTypeName = inflection.bulkDeletePayloadType(typeName);

const inputType = build.getTypeByName(inputTypeName);
const payloadType = build.getTypeByName(payloadTypeName);
const inputType = build.getTypeByName(inputTypeName) as GraphQLInputType | undefined;
const payloadType = build.getTypeByName(payloadTypeName) as GraphQLOutputType | undefined;
if (!inputType || !payloadType) continue;

const fieldToAttr: Record<string, string> = {};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import '../augmentations';

import { sideEffectWithPgClient } from '@dataplan/pg';
import type { GraphileConfig } from 'graphile-config';
import type { GraphQLInputType, GraphQLOutputType } from 'graphql';

import type { NestedRelationInfo } from '../utils/relations';
import { discoverNestedRelations } from '../utils/relations';
Expand Down Expand Up @@ -72,8 +73,8 @@ export const BulkInsertPlugin: GraphileConfig.Plugin = {
const inputTypeName = inflection.bulkInsertInputType(typeName);
const payloadTypeName = inflection.bulkInsertPayloadType(typeName);

const inputType = build.getTypeByName(inputTypeName);
const payloadType = build.getTypeByName(payloadTypeName);
const inputType = build.getTypeByName(inputTypeName) as GraphQLInputType | undefined;
const payloadType = build.getTypeByName(payloadTypeName) as GraphQLOutputType | undefined;
if (!inputType || !payloadType) continue;

// Pre-compute column specs for SQL generation
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import '../augmentations';

import type { GraphileConfig } from 'graphile-config';
import type { GraphQLInputType } from 'graphql';

import { discoverNestedRelations } from '../utils/relations';

Expand Down Expand Up @@ -106,7 +107,7 @@ export const BulkRelationalPlugin: GraphileConfig.Plugin = {
const inputType = build.getGraphQLTypeByPgCodec(
attr.codec,
'input'
);
) as GraphQLInputType | undefined;
if (!inputType) continue;

const isRequired = !!attr.notNull && !attr.hasDefault;
Expand Down Expand Up @@ -168,7 +169,7 @@ export const BulkRelationalPlugin: GraphileConfig.Plugin = {
parentTypeName,
childTypeName
);
const nestedInputType = build.getTypeByName(nestedInputTypeName);
const nestedInputType = build.getTypeByName(nestedInputTypeName) as GraphQLInputType | undefined;
if (!nestedInputType) continue;

fields = build.extend(
Expand Down
31 changes: 16 additions & 15 deletions graphile/graphile-bulk-mutations/src/plugins/BulkTypesPlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import '../augmentations';
import { pgSelectFromRecords } from '@dataplan/pg';
import { access } from 'grafast';
import type { GraphileConfig } from 'graphile-config';
import type { GraphQLInputType, GraphQLOutputType } from 'graphql';

const version = '0.1.0';

Expand Down Expand Up @@ -215,15 +216,15 @@ export const BulkTypesPlugin: GraphileConfig.Plugin = {
() => ({
description:
'The unique constraint to use for conflict detection.',
type: build.getTypeByName(constraintEnumName)
type: build.getTypeByName(constraintEnumName) as GraphQLInputType
})
),
action: fieldWithHooks(
{ fieldName: 'action' },
() => ({
description: 'The action to take on conflict.',
type: new build.graphql.GraphQLNonNull(
build.getTypeByName('ConflictAction')
build.getTypeByName('ConflictAction') as GraphQLInputType
)
})
)
Expand Down Expand Up @@ -253,7 +254,7 @@ export const BulkTypesPlugin: GraphileConfig.Plugin = {
description:
'The unique constraint to use for conflict detection.',
type: new build.graphql.GraphQLNonNull(
build.getTypeByName(constraintEnumName)
build.getTypeByName(constraintEnumName) as GraphQLInputType
)
})
),
Expand All @@ -264,7 +265,7 @@ export const BulkTypesPlugin: GraphileConfig.Plugin = {
'Columns to update on conflict. If omitted, all non-key columns are updated.',
type: new build.graphql.GraphQLList(
new build.graphql.GraphQLNonNull(
build.getTypeByName(columnEnumName)
build.getTypeByName(columnEnumName) as GraphQLInputType
)
)
})
Expand Down Expand Up @@ -389,7 +390,7 @@ export const BulkTypesPlugin: GraphileConfig.Plugin = {
type: new build.graphql.GraphQLNonNull(
new build.graphql.GraphQLList(
new build.graphql.GraphQLNonNull(
build.getTypeByName(itemTypeName)
build.getTypeByName(itemTypeName) as GraphQLInputType
)
)
)
Expand All @@ -400,7 +401,7 @@ export const BulkTypesPlugin: GraphileConfig.Plugin = {
() => ({
description:
'Optional ON CONFLICT handling for duplicate keys.',
type: build.getTypeByName(onConflictName)
type: build.getTypeByName(onConflictName) as GraphQLInputType
})
)
})
Expand Down Expand Up @@ -429,7 +430,7 @@ export const BulkTypesPlugin: GraphileConfig.Plugin = {
type: new build.graphql.GraphQLNonNull(
new build.graphql.GraphQLList(
new build.graphql.GraphQLNonNull(
build.getTypeByName(itemTypeName)
build.getTypeByName(itemTypeName) as GraphQLInputType
)
)
)
Expand All @@ -441,7 +442,7 @@ export const BulkTypesPlugin: GraphileConfig.Plugin = {
description:
'The unique constraint to target and which columns to update.',
type: new build.graphql.GraphQLNonNull(
build.getTypeByName(onConflictName)
build.getTypeByName(onConflictName) as GraphQLInputType
)
})
)
Expand All @@ -466,13 +467,13 @@ export const BulkTypesPlugin: GraphileConfig.Plugin = {
() => {
// Try to use connection-filter type if available
const filterTypeName = `${typeName}Filter`;
const filterType = build.getTypeByName(filterTypeName);
const filterType = build.getTypeByName(filterTypeName) as GraphQLInputType | undefined;
// Fall back to PostGraphile's built-in condition type
const conditionTypeName = inflection.conditionType(
typeName
);
const conditionType =
build.getTypeByName(conditionTypeName);
build.getTypeByName(conditionTypeName) as GraphQLInputType | undefined;
const whereType = filterType || conditionType;
return {
description:
Expand All @@ -488,7 +489,7 @@ export const BulkTypesPlugin: GraphileConfig.Plugin = {
() => ({
description: 'The fields to update.',
type: new build.graphql.GraphQLNonNull(
build.getTypeByName(patchTypeName)
build.getTypeByName(patchTypeName) as GraphQLInputType
)
})
)
Expand All @@ -511,12 +512,12 @@ export const BulkTypesPlugin: GraphileConfig.Plugin = {
{ fieldName: 'where' },
() => {
const filterTypeName = `${typeName}Filter`;
const filterType = build.getTypeByName(filterTypeName);
const filterType = build.getTypeByName(filterTypeName) as GraphQLInputType | undefined;
const conditionTypeName = inflection.conditionType(
typeName
);
const conditionType =
build.getTypeByName(conditionTypeName);
build.getTypeByName(conditionTypeName) as GraphQLInputType | undefined;
const whereType = filterType || conditionType;
return {
description:
Expand Down Expand Up @@ -545,7 +546,7 @@ export const BulkTypesPlugin: GraphileConfig.Plugin = {
() => ({
description,
fields: ({ fieldWithHooks }: any) => {
const outputType = build.getTypeByName(typeName);
const outputType = build.getTypeByName(typeName) as GraphQLOutputType | undefined;
const fields: Record<string, any> = {
clientMutationId: fieldWithHooks(
{ fieldName: 'clientMutationId' },
Expand Down Expand Up @@ -602,7 +603,7 @@ export const BulkTypesPlugin: GraphileConfig.Plugin = {
() => ({
description:
'Access the root query type. Useful for re-fetching data after a mutation.',
type: build.getTypeByName('Query')
type: build.getTypeByName('Query') as GraphQLOutputType
})
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import '../augmentations';

import { sideEffectWithPgClient } from '@dataplan/pg';
import type { GraphileConfig } from 'graphile-config';
import type { GraphQLInputType, GraphQLOutputType } from 'graphql';

const version = '0.1.0';

Expand Down Expand Up @@ -58,8 +59,8 @@ export const BulkUpdatePlugin: GraphileConfig.Plugin = {
const inputTypeName = inflection.bulkUpdateInputType(typeName);
const payloadTypeName = inflection.bulkUpdatePayloadType(typeName);

const inputType = build.getTypeByName(inputTypeName);
const payloadType = build.getTypeByName(payloadTypeName);
const inputType = build.getTypeByName(inputTypeName) as GraphQLInputType | undefined;
const payloadType = build.getTypeByName(payloadTypeName) as GraphQLOutputType | undefined;
if (!inputType || !payloadType) continue;

// Build field-to-attribute mapping for patch resolution
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import '../augmentations';

import { sideEffectWithPgClient } from '@dataplan/pg';
import type { GraphileConfig } from 'graphile-config';
import type { GraphQLInputType, GraphQLOutputType } from 'graphql';

import type { ColumnSpec } from '../utils/sql-builder';
import { buildBulkInsertSQL } from '../utils/sql-builder';
Expand Down Expand Up @@ -60,8 +61,8 @@ export const BulkUpsertPlugin: GraphileConfig.Plugin = {
const inputTypeName = inflection.bulkUpsertInputType(typeName);
const payloadTypeName = inflection.bulkUpsertPayloadType(typeName);

const inputType = build.getTypeByName(inputTypeName);
const payloadType = build.getTypeByName(payloadTypeName);
const inputType = build.getTypeByName(inputTypeName) as GraphQLInputType | undefined;
const payloadType = build.getTypeByName(payloadTypeName) as GraphQLOutputType | undefined;
if (!inputType || !payloadType) continue;

const columnSpecs: ColumnSpec[] = [];
Expand Down
2 changes: 1 addition & 1 deletion graphile/graphile-cache/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"graphile-realtime-subscriptions": "workspace:^",
"lru-cache": "^11.2.7",
"pg-cache": "workspace:^",
"postgraphile": "5.0.0"
"postgraphile": "5.0.3"
},
"devDependencies": {
"@types/express": "^5.0.6",
Expand Down
12 changes: 6 additions & 6 deletions graphile/graphile-connection-filter/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@
"pgsql-test": "workspace:^"
},
"peerDependencies": {
"@dataplan/pg": "1.0.0",
"graphile-build": "5.0.0",
"graphile-build-pg": "5.0.0",
"graphile-config": "1.0.0",
"@dataplan/pg": "1.0.3",
"graphile-build": "5.0.2",
"graphile-build-pg": "5.0.2",
"graphile-config": "1.0.1",
"graphql": "16.13.0",
"pg-sql2": "5.0.0",
"postgraphile": "5.0.0"
"pg-sql2": "5.0.1",
"postgraphile": "5.0.3"
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import '../augmentations';
import type { GraphileConfig } from 'graphile-config';
import type { GraphQLInputType, GraphQLNamedType } from 'graphql';
import { isEmpty } from '../utils';

const version = '1.0.0';
Expand Down Expand Up @@ -64,12 +65,12 @@ export const ConnectionFilterArgPlugin: GraphileConfig.Plugin = {
const nodeType = build.getGraphQLTypeByPgCodec(
returnCodec,
'output'
);
) as GraphQLNamedType | undefined;
if (!nodeType) return args;

const nodeTypeName = nodeType.name;
const filterTypeName = inflection.filterType(nodeTypeName);
const FilterType = build.getTypeByName(filterTypeName);
const FilterType = build.getTypeByName(filterTypeName) as GraphQLInputType | undefined;
if (!FilterType) return args;

// For setof functions returning scalars, track the codec
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import '../augmentations';
import type { GraphileConfig } from 'graphile-config';
import type { GraphQLInputType } from 'graphql';
import { isEmpty } from '../utils';

const version = '1.0.0';
Expand Down Expand Up @@ -64,7 +65,7 @@ export const ConnectionFilterAttributesPlugin: GraphileConfig.Plugin = {
const digest = connectionFilterOperatorsDigest(attribute.codec);
if (!digest) continue;

const OperatorsType = build.getTypeByName(digest.operatorsTypeName);
const OperatorsType = build.getTypeByName(digest.operatorsTypeName) as GraphQLInputType | undefined;
if (!OperatorsType) continue;

const {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import '../augmentations';
import type { GraphileConfig } from 'graphile-config';
import type { GraphQLInputType } from 'graphql';
import {
isComputedScalarAttributeResource,
getComputedAttributeResources,
Expand Down Expand Up @@ -118,7 +119,7 @@ export const ConnectionFilterComputedAttributesPlugin: GraphileConfig.Plugin = {

const OperatorsType = build.getTypeByName(
digest.operatorsTypeName
);
) as GraphQLInputType | undefined;
if (!OperatorsType) {
continue;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import '../augmentations';
import type { GraphileConfig } from 'graphile-config';
import type { GraphQLInputType } from 'graphql';
import type { ConnectionFilterOperatorSpec } from '../types';
import { $$filters } from '../types';
import { makeApplyFromOperatorSpec } from './operatorApply';
Expand Down Expand Up @@ -137,7 +138,7 @@ export const ConnectionFilterCustomOperatorsPlugin: GraphileConfig.Plugin = {
const codecGraphQLType = build.getGraphQLTypeByPgCodec(
inputCodec,
'input'
);
) as GraphQLInputType | undefined;
if (!codecGraphQLType) {
continue;
}
Expand Down
Loading
Loading