Skip to content

Commit 3e7f98f

Browse files
authored
feat(deps): support for GraphQL v15 (#689)
1 parent 6b3c051 commit 3e7f98f

52 files changed

Lines changed: 10151 additions & 9742 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
"eslint_d": "^9.1.2",
4747
"flow-bin": "^0.106.3",
4848
"flow-copy-source": "^2.0.9",
49-
"graphql": ">=0.6 <15",
49+
"graphql": ">=0.6 <16",
5050
"jest": "25.x",
5151
"lerna": "^3.18.4",
5252
"pg": ">=6.1.0 <9",
@@ -58,5 +58,8 @@
5858
"engines": {
5959
"node": ">=8.6",
6060
"yarn": ">=1.3.2"
61+
},
62+
"resolutions": {
63+
"graphql": "^15.4.0"
6164
}
6265
}

packages/graphile-build-pg/src/plugins/PageInfoStartEndCursor.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,10 @@ export default (function PageInfoStartEndCursor(builder) {
1919
({ addDataGenerator }) => {
2020
addDataGenerator(() => ({ usesCursor: [true] }));
2121
return {
22-
description:
22+
description: build.wrapDescription(
2323
"When paginating backwards, the cursor to continue.",
24+
"field"
25+
),
2426
type: Cursor,
2527
};
2628
},
@@ -33,8 +35,10 @@ export default (function PageInfoStartEndCursor(builder) {
3335
({ addDataGenerator }) => {
3436
addDataGenerator(() => ({ usesCursor: [true] }));
3537
return {
36-
description:
38+
description: build.wrapDescription(
3739
"When paginating forwards, the cursor to continue.",
40+
"field"
41+
),
3842
type: Cursor,
3943
};
4044
},

packages/graphile-build-pg/src/plugins/PgAllRows.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,12 @@ export default (async function PgAllRows(
8484
fieldName,
8585
({ getDataFromParsedResolveInfoFragment }) => {
8686
return {
87-
description: isConnection
88-
? `Reads and enables pagination through a set of \`${tableTypeName}\`.`
89-
: `Reads a set of \`${tableTypeName}\`.`,
87+
description: build.wrapDescription(
88+
isConnection
89+
? `Reads and enables pagination through a set of \`${tableTypeName}\`.`
90+
: `Reads a set of \`${tableTypeName}\`.`,
91+
"field"
92+
),
9093
type: isConnection
9194
? ConnectionType
9295
: new GraphQLList(new GraphQLNonNull(TableType)),

packages/graphile-build-pg/src/plugins/PgBackwardRelationPlugin.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,10 @@ export default (function PgBackwardRelationPlugin(
213213
return {
214214
description:
215215
constraint.tags.backwardDescription ||
216-
`Reads a single \`${tableTypeName}\` that is related to this \`${foreignTableTypeName}\`.`,
216+
build.wrapDescription(
217+
`Reads a single \`${tableTypeName}\` that is related to this \`${foreignTableTypeName}\`.`,
218+
"field"
219+
),
217220
type: gqlTableType,
218221
args: {},
219222
resolve: (data, _args, resolveContext, resolveInfo) => {
@@ -392,7 +395,10 @@ export default (function PgBackwardRelationPlugin(
392395
return {
393396
description:
394397
constraint.tags.backwardDescription ||
395-
`Reads and enables pagination through a set of \`${tableTypeName}\`.`,
398+
build.wrapDescription(
399+
`Reads and enables pagination through a set of \`${tableTypeName}\`.`,
400+
"field"
401+
),
396402
type: isConnection
397403
? new GraphQLNonNull(ConnectionType)
398404
: new GraphQLNonNull(

packages/graphile-build-pg/src/plugins/PgConditionComputedColumnPlugin.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,10 @@ export default (function PgConditionComputedColumnPlugin(builder) {
8484
[fieldName]: fieldWithHooks(
8585
fieldName,
8686
{
87-
description: `Checks for equality with the object’s \`${fieldName}\` field.`,
87+
description: build.wrapDescription(
88+
`Checks for equality with the object’s \`${fieldName}\` field.`,
89+
"field"
90+
),
8891
type: Type,
8992
},
9093
{

packages/graphile-build-pg/src/plugins/PgConnectionArgCondition.js

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,10 @@ export default (function PgConnectionArgCondition(builder) {
2626
newWithHooks(
2727
GraphQLInputObjectType,
2828
{
29-
description: `A condition to be used against \`${tableTypeName}\` object types. All fields are tested for equality and combined with a logical ‘and.’`,
29+
description: build.wrapDescription(
30+
`A condition to be used against \`${tableTypeName}\` object types. All fields are tested for equality and combined with a logical ‘and.’`,
31+
"type"
32+
),
3033
name: inflection.conditionType(inflection.tableType(table)),
3134
fields: context => {
3235
const { fieldWithHooks } = context;
@@ -42,7 +45,10 @@ export default (function PgConnectionArgCondition(builder) {
4245
[fieldName]: fieldWithHooks(
4346
fieldName,
4447
{
45-
description: `Checks for equality with the object’s \`${fieldName}\` field.`,
48+
description: build.wrapDescription(
49+
`Checks for equality with the object’s \`${fieldName}\` field.`,
50+
"field"
51+
),
4652
type:
4753
pgGetGqlInputTypeByTypeIdAndModifier(
4854
attr.typeId,
@@ -181,8 +187,10 @@ export default (function PgConnectionArgCondition(builder) {
181187
args,
182188
{
183189
condition: {
184-
description:
190+
description: build.wrapDescription(
185191
"A condition to be used in determining which values should be returned by the collection.",
192+
"arg"
193+
),
186194
type: TableConditionType,
187195
},
188196
},

packages/graphile-build-pg/src/plugins/PgConnectionArgFirstLastBeforeAfter.js

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -87,33 +87,46 @@ export default (function PgConnectionArgs(builder) {
8787
args,
8888
{
8989
first: {
90-
description: "Only read the first `n` values of the set.",
90+
description: build.wrapDescription(
91+
"Only read the first `n` values of the set.",
92+
"arg"
93+
),
9194
type: GraphQLInt,
9295
},
9396
...(isPgFieldConnection
9497
? {
9598
last: {
96-
description: "Only read the last `n` values of the set.",
99+
description: build.wrapDescription(
100+
"Only read the last `n` values of the set.",
101+
"arg"
102+
),
97103
type: GraphQLInt,
98104
},
99105
}
100106
: null),
101107
offset: {
102-
description: isPgFieldConnection
103-
? "Skip the first `n` values from our `after` cursor, an alternative to cursor based pagination. May not be used with `last`."
104-
: "Skip the first `n` values.",
108+
description: build.wrapDescription(
109+
isPgFieldConnection
110+
? "Skip the first `n` values from our `after` cursor, an alternative to cursor based pagination. May not be used with `last`."
111+
: "Skip the first `n` values.",
112+
"arg"
113+
),
105114
type: GraphQLInt,
106115
},
107116
...(isPgFieldConnection
108117
? {
109118
before: {
110-
description:
119+
description: build.wrapDescription(
111120
"Read all values in the set before (above) this cursor.",
121+
"arg"
122+
),
112123
type: Cursor,
113124
},
114125
after: {
115-
description:
126+
description: build.wrapDescription(
116127
"Read all values in the set after (below) this cursor.",
128+
"arg"
129+
),
117130
type: Cursor,
118131
},
119132
}

packages/graphile-build-pg/src/plugins/PgConnectionArgOrderBy.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,10 @@ export default (function PgConnectionArgOrderBy(builder, { orderByNullsLast }) {
2626
GraphQLEnumType,
2727
{
2828
name: inflection.orderByType(tableTypeName),
29-
description: `Methods to use when ordering \`${tableTypeName}\`.`,
29+
description: build.wrapDescription(
30+
`Methods to use when ordering \`${tableTypeName}\`.`,
31+
"type"
32+
),
3033
values: {
3134
NATURAL: {
3235
value: {
@@ -174,7 +177,10 @@ export default (function PgConnectionArgOrderBy(builder, { orderByNullsLast }) {
174177
args,
175178
{
176179
orderBy: {
177-
description: `The method to use when ordering \`${tableTypeName}\`.`,
180+
description: build.wrapDescription(
181+
`The method to use when ordering \`${tableTypeName}\`.`,
182+
"arg"
183+
),
178184
type: new GraphQLList(new GraphQLNonNull(TableOrderByType)),
179185
},
180186
},

packages/graphile-build-pg/src/plugins/PgConnectionTotalCount.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,10 @@ export default (function PgConnectionTotalCount(builder) {
4848
};
4949
});
5050
return {
51-
description: `The count of *all* \`${nodeTypeName}\` you could get from the connection.`,
51+
description: build.wrapDescription(
52+
`The count of *all* \`${nodeTypeName}\` you could get from the connection.`,
53+
"field"
54+
),
5255
type: new GraphQLNonNull(GraphQLInt),
5356
resolve(parent) {
5457
return (

packages/graphile-build-pg/src/plugins/PgForwardRelationPlugin.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,10 @@ export default (function PgForwardRelationPlugin(builder, { subscriptions }) {
178178
return {
179179
description:
180180
constraint.tags.forwardDescription ||
181-
`Reads a single \`${foreignTableTypeName}\` that is related to this \`${tableTypeName}\`.`,
181+
build.wrapDescription(
182+
`Reads a single \`${foreignTableTypeName}\` that is related to this \`${tableTypeName}\`.`,
183+
"field"
184+
),
182185
type: gqlForeignTableType, // Nullable since RLS may forbid fetching
183186
resolve: (rawData, _args, resolveContext, resolveInfo) => {
184187
const data = isMutationPayload ? rawData.data : rawData;

0 commit comments

Comments
 (0)