Skip to content

Commit a8e59b9

Browse files
Alan-ChaErikWittern
authored andcommitted
Change target GraphQL type list
Signed-off-by: Alan Cha <[email protected]>
1 parent a0b7b81 commit a8e59b9

File tree

9 files changed

+21
-21
lines changed

9 files changed

+21
-21
lines changed

packages/openapi-to-graphql/lib/oas_3_tools.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/openapi-to-graphql/lib/oas_3_tools.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/openapi-to-graphql/lib/preprocessor.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/openapi-to-graphql/lib/preprocessor.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/openapi-to-graphql/lib/schema_builder.js

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/openapi-to-graphql/lib/schema_builder.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/openapi-to-graphql/src/oas_3_tools.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,7 @@ export function getSchemaTargetGraphQLType(
433433

434434
// CASE: array
435435
if (schema.type === 'array' || 'items' in schema) {
436-
return 'array'
436+
return 'list'
437437
}
438438

439439
// CASE: enum

packages/openapi-to-graphql/src/preprocessor.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -572,7 +572,7 @@ export function createDataDef(
572572
// Used type names and defs of union and object types are pushed during creation
573573
if (
574574
targetGraphQLType === 'object' ||
575-
targetGraphQLType === 'array' ||
575+
targetGraphQLType === 'list' ||
576576
targetGraphQLType === 'enum'
577577
) {
578578
data.usedTypeNames.push(saneName)
@@ -929,7 +929,7 @@ export function createDataDef(
929929

930930
if (targetGraphQLType) {
931931
switch (targetGraphQLType) {
932-
case 'array':
932+
case 'list':
933933
if (typeof consolidatedSchema.items === 'object') {
934934
// Break schema down into component parts
935935
// I.e. if it is an list type, create a reference to the list item type

packages/openapi-to-graphql/src/schema_builder.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ export function getGraphQLType({
101101
}
102102

103103
switch (def.targetGraphQLType) {
104-
// CASE: object - create ObjectType
104+
// CASE: object - create object type
105105
case 'object':
106106
return createOrReuseOt({
107107
def,
@@ -111,7 +111,7 @@ export function getGraphQLType({
111111
isInputObjectType
112112
})
113113

114-
// CASE: union - create UnionType
114+
// CASE: union - create union type
115115
case 'union':
116116
return createOrReuseUnion({
117117
def,
@@ -120,8 +120,8 @@ export function getGraphQLType({
120120
iteration
121121
})
122122

123-
// CASE: array - create ArrayType
124-
case 'array':
123+
// CASE: list - create list type
124+
case 'list':
125125
return createOrReuseList({
126126
def,
127127
operation,
@@ -130,14 +130,14 @@ export function getGraphQLType({
130130
isInputObjectType
131131
})
132132

133-
// CASE: enum - create EnumType
133+
// CASE: enum - create enum type
134134
case 'enum':
135135
return createOrReuseEnum({
136136
def,
137137
data
138138
})
139139

140-
// CASE: scalar - return scalar
140+
// CASE: scalar - return scalar type
141141
default:
142142
return getScalarType({
143143
def,

0 commit comments

Comments
 (0)